Revision 750afe93 fpu/softfloat.c
b/fpu/softfloat.c | ||
---|---|---|
2023 | 2023 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
2024 | 2024 |
*----------------------------------------------------------------------------*/ |
2025 | 2025 |
|
2026 |
flag float32_eq( float32 a, float32 b STATUS_PARAM )
|
|
2026 |
int float32_eq( float32 a, float32 b STATUS_PARAM )
|
|
2027 | 2027 |
{ |
2028 | 2028 |
|
2029 | 2029 |
if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) |
... | ... | |
2045 | 2045 |
| Arithmetic. |
2046 | 2046 |
*----------------------------------------------------------------------------*/ |
2047 | 2047 |
|
2048 |
flag float32_le( float32 a, float32 b STATUS_PARAM )
|
|
2048 |
int float32_le( float32 a, float32 b STATUS_PARAM )
|
|
2049 | 2049 |
{ |
2050 | 2050 |
flag aSign, bSign; |
2051 | 2051 |
|
... | ... | |
2068 | 2068 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
2069 | 2069 |
*----------------------------------------------------------------------------*/ |
2070 | 2070 |
|
2071 |
flag float32_lt( float32 a, float32 b STATUS_PARAM )
|
|
2071 |
int float32_lt( float32 a, float32 b STATUS_PARAM )
|
|
2072 | 2072 |
{ |
2073 | 2073 |
flag aSign, bSign; |
2074 | 2074 |
|
... | ... | |
2092 | 2092 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
2093 | 2093 |
*----------------------------------------------------------------------------*/ |
2094 | 2094 |
|
2095 |
flag float32_eq_signaling( float32 a, float32 b STATUS_PARAM )
|
|
2095 |
int float32_eq_signaling( float32 a, float32 b STATUS_PARAM )
|
|
2096 | 2096 |
{ |
2097 | 2097 |
|
2098 | 2098 |
if ( ( ( extractFloat32Exp( a ) == 0xFF ) && extractFloat32Frac( a ) ) |
... | ... | |
2112 | 2112 |
| IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
2113 | 2113 |
*----------------------------------------------------------------------------*/ |
2114 | 2114 |
|
2115 |
flag float32_le_quiet( float32 a, float32 b STATUS_PARAM )
|
|
2115 |
int float32_le_quiet( float32 a, float32 b STATUS_PARAM )
|
|
2116 | 2116 |
{ |
2117 | 2117 |
flag aSign, bSign; |
2118 | 2118 |
|
... | ... | |
2138 | 2138 |
| Standard for Binary Floating-Point Arithmetic. |
2139 | 2139 |
*----------------------------------------------------------------------------*/ |
2140 | 2140 |
|
2141 |
flag float32_lt_quiet( float32 a, float32 b STATUS_PARAM )
|
|
2141 |
int float32_lt_quiet( float32 a, float32 b STATUS_PARAM )
|
|
2142 | 2142 |
{ |
2143 | 2143 |
flag aSign, bSign; |
2144 | 2144 |
|
... | ... | |
2952 | 2952 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
2953 | 2953 |
*----------------------------------------------------------------------------*/ |
2954 | 2954 |
|
2955 |
flag float64_eq( float64 a, float64 b STATUS_PARAM )
|
|
2955 |
int float64_eq( float64 a, float64 b STATUS_PARAM )
|
|
2956 | 2956 |
{ |
2957 | 2957 |
|
2958 | 2958 |
if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) |
... | ... | |
2974 | 2974 |
| Arithmetic. |
2975 | 2975 |
*----------------------------------------------------------------------------*/ |
2976 | 2976 |
|
2977 |
flag float64_le( float64 a, float64 b STATUS_PARAM )
|
|
2977 |
int float64_le( float64 a, float64 b STATUS_PARAM )
|
|
2978 | 2978 |
{ |
2979 | 2979 |
flag aSign, bSign; |
2980 | 2980 |
|
... | ... | |
2997 | 2997 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
2998 | 2998 |
*----------------------------------------------------------------------------*/ |
2999 | 2999 |
|
3000 |
flag float64_lt( float64 a, float64 b STATUS_PARAM )
|
|
3000 |
int float64_lt( float64 a, float64 b STATUS_PARAM )
|
|
3001 | 3001 |
{ |
3002 | 3002 |
flag aSign, bSign; |
3003 | 3003 |
|
... | ... | |
3021 | 3021 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
3022 | 3022 |
*----------------------------------------------------------------------------*/ |
3023 | 3023 |
|
3024 |
flag float64_eq_signaling( float64 a, float64 b STATUS_PARAM )
|
|
3024 |
int float64_eq_signaling( float64 a, float64 b STATUS_PARAM )
|
|
3025 | 3025 |
{ |
3026 | 3026 |
|
3027 | 3027 |
if ( ( ( extractFloat64Exp( a ) == 0x7FF ) && extractFloat64Frac( a ) ) |
... | ... | |
3041 | 3041 |
| IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
3042 | 3042 |
*----------------------------------------------------------------------------*/ |
3043 | 3043 |
|
3044 |
flag float64_le_quiet( float64 a, float64 b STATUS_PARAM )
|
|
3044 |
int float64_le_quiet( float64 a, float64 b STATUS_PARAM )
|
|
3045 | 3045 |
{ |
3046 | 3046 |
flag aSign, bSign; |
3047 | 3047 |
|
... | ... | |
3067 | 3067 |
| Standard for Binary Floating-Point Arithmetic. |
3068 | 3068 |
*----------------------------------------------------------------------------*/ |
3069 | 3069 |
|
3070 |
flag float64_lt_quiet( float64 a, float64 b STATUS_PARAM )
|
|
3070 |
int float64_lt_quiet( float64 a, float64 b STATUS_PARAM )
|
|
3071 | 3071 |
{ |
3072 | 3072 |
flag aSign, bSign; |
3073 | 3073 |
|
... | ... | |
3890 | 3890 |
| Arithmetic. |
3891 | 3891 |
*----------------------------------------------------------------------------*/ |
3892 | 3892 |
|
3893 |
flag floatx80_eq( floatx80 a, floatx80 b STATUS_PARAM )
|
|
3893 |
int floatx80_eq( floatx80 a, floatx80 b STATUS_PARAM )
|
|
3894 | 3894 |
{ |
3895 | 3895 |
|
3896 | 3896 |
if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) |
... | ... | |
3920 | 3920 |
| Floating-Point Arithmetic. |
3921 | 3921 |
*----------------------------------------------------------------------------*/ |
3922 | 3922 |
|
3923 |
flag floatx80_le( floatx80 a, floatx80 b STATUS_PARAM )
|
|
3923 |
int floatx80_le( floatx80 a, floatx80 b STATUS_PARAM )
|
|
3924 | 3924 |
{ |
3925 | 3925 |
flag aSign, bSign; |
3926 | 3926 |
|
... | ... | |
3953 | 3953 |
| Arithmetic. |
3954 | 3954 |
*----------------------------------------------------------------------------*/ |
3955 | 3955 |
|
3956 |
flag floatx80_lt( floatx80 a, floatx80 b STATUS_PARAM )
|
|
3956 |
int floatx80_lt( floatx80 a, floatx80 b STATUS_PARAM )
|
|
3957 | 3957 |
{ |
3958 | 3958 |
flag aSign, bSign; |
3959 | 3959 |
|
... | ... | |
3986 | 3986 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
3987 | 3987 |
*----------------------------------------------------------------------------*/ |
3988 | 3988 |
|
3989 |
flag floatx80_eq_signaling( floatx80 a, floatx80 b STATUS_PARAM )
|
|
3989 |
int floatx80_eq_signaling( floatx80 a, floatx80 b STATUS_PARAM )
|
|
3990 | 3990 |
{ |
3991 | 3991 |
|
3992 | 3992 |
if ( ( ( extractFloatx80Exp( a ) == 0x7FFF ) |
... | ... | |
4013 | 4013 |
| to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
4014 | 4014 |
*----------------------------------------------------------------------------*/ |
4015 | 4015 |
|
4016 |
flag floatx80_le_quiet( floatx80 a, floatx80 b STATUS_PARAM )
|
|
4016 |
int floatx80_le_quiet( floatx80 a, floatx80 b STATUS_PARAM )
|
|
4017 | 4017 |
{ |
4018 | 4018 |
flag aSign, bSign; |
4019 | 4019 |
|
... | ... | |
4049 | 4049 |
| IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
4050 | 4050 |
*----------------------------------------------------------------------------*/ |
4051 | 4051 |
|
4052 |
flag floatx80_lt_quiet( floatx80 a, floatx80 b STATUS_PARAM )
|
|
4052 |
int floatx80_lt_quiet( floatx80 a, floatx80 b STATUS_PARAM )
|
|
4053 | 4053 |
{ |
4054 | 4054 |
flag aSign, bSign; |
4055 | 4055 |
|
... | ... | |
5010 | 5010 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
5011 | 5011 |
*----------------------------------------------------------------------------*/ |
5012 | 5012 |
|
5013 |
flag float128_eq( float128 a, float128 b STATUS_PARAM )
|
|
5013 |
int float128_eq( float128 a, float128 b STATUS_PARAM )
|
|
5014 | 5014 |
{ |
5015 | 5015 |
|
5016 | 5016 |
if ( ( ( extractFloat128Exp( a ) == 0x7FFF ) |
... | ... | |
5040 | 5040 |
| Arithmetic. |
5041 | 5041 |
*----------------------------------------------------------------------------*/ |
5042 | 5042 |
|
5043 |
flag float128_le( float128 a, float128 b STATUS_PARAM )
|
|
5043 |
int float128_le( float128 a, float128 b STATUS_PARAM )
|
|
5044 | 5044 |
{ |
5045 | 5045 |
flag aSign, bSign; |
5046 | 5046 |
|
... | ... | |
5072 | 5072 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
5073 | 5073 |
*----------------------------------------------------------------------------*/ |
5074 | 5074 |
|
5075 |
flag float128_lt( float128 a, float128 b STATUS_PARAM )
|
|
5075 |
int float128_lt( float128 a, float128 b STATUS_PARAM )
|
|
5076 | 5076 |
{ |
5077 | 5077 |
flag aSign, bSign; |
5078 | 5078 |
|
... | ... | |
5105 | 5105 |
| according to the IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
5106 | 5106 |
*----------------------------------------------------------------------------*/ |
5107 | 5107 |
|
5108 |
flag float128_eq_signaling( float128 a, float128 b STATUS_PARAM )
|
|
5108 |
int float128_eq_signaling( float128 a, float128 b STATUS_PARAM )
|
|
5109 | 5109 |
{ |
5110 | 5110 |
|
5111 | 5111 |
if ( ( ( extractFloat128Exp( a ) == 0x7FFF ) |
... | ... | |
5132 | 5132 |
| IEC/IEEE Standard for Binary Floating-Point Arithmetic. |
5133 | 5133 |
*----------------------------------------------------------------------------*/ |
5134 | 5134 |
|
5135 |
flag float128_le_quiet( float128 a, float128 b STATUS_PARAM )
|
|
5135 |
int float128_le_quiet( float128 a, float128 b STATUS_PARAM )
|
|
5136 | 5136 |
{ |
5137 | 5137 |
flag aSign, bSign; |
5138 | 5138 |
|
... | ... | |
5168 | 5168 |
| Standard for Binary Floating-Point Arithmetic. |
5169 | 5169 |
*----------------------------------------------------------------------------*/ |
5170 | 5170 |
|
5171 |
flag float128_lt_quiet( float128 a, float128 b STATUS_PARAM )
|
|
5171 |
int float128_lt_quiet( float128 a, float128 b STATUS_PARAM )
|
|
5172 | 5172 |
{ |
5173 | 5173 |
flag aSign, bSign; |
5174 | 5174 |
|
... | ... | |
5283 | 5283 |
} |
5284 | 5284 |
|
5285 | 5285 |
#define COMPARE(s, nan_exp) \ |
5286 |
INLINE char float ## s ## _compare_internal( float ## s a, float ## s b, \
|
|
5286 |
INLINE int float ## s ## _compare_internal( float ## s a, float ## s b, \
|
|
5287 | 5287 |
int is_quiet STATUS_PARAM ) \ |
5288 | 5288 |
{ \ |
5289 | 5289 |
flag aSign, bSign; \ |
... | ... | |
5317 | 5317 |
} \ |
5318 | 5318 |
} \ |
5319 | 5319 |
\ |
5320 |
char float ## s ## _compare( float ## s a, float ## s b STATUS_PARAM ) \
|
|
5320 |
int float ## s ## _compare( float ## s a, float ## s b STATUS_PARAM ) \
|
|
5321 | 5321 |
{ \ |
5322 | 5322 |
return float ## s ## _compare_internal(a, b, 0 STATUS_VAR); \ |
5323 | 5323 |
} \ |
5324 | 5324 |
\ |
5325 |
char float ## s ## _compare_quiet( float ## s a, float ## s b STATUS_PARAM ) \
|
|
5325 |
int float ## s ## _compare_quiet( float ## s a, float ## s b STATUS_PARAM ) \
|
|
5326 | 5326 |
{ \ |
5327 | 5327 |
return float ## s ## _compare_internal(a, b, 1 STATUS_VAR); \ |
5328 | 5328 |
} |
Also available in: Unified diff