Fix float to long long conversion on ARM when the result would fit in an int.
Unified · Split
| @@ -34,7 +34,7 @@ REGS_RETURN(double_unsigned_struct, double_unsigned_struct) · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | /* float to [unsigned] long long conversion */ |
| 37 | −#define DEFINE__AEABIT_F2XLZ(name, with_sign) \ | |
| 37 | +#define DEFINE__AEABI_F2XLZ(name, with_sign) \ | |
| 38 | 38 | void __aeabi_ ## name(unsigned val) \ |
| 39 | 39 | { \ |
| 40 | 40 | int exp, high_shift, sign; \ |
| @@ -74,7 +74,7 @@ void __aeabi_ ## name(unsigned val) \ · 33 unmodified lines | ||
| 74 | 74 | if (exp > FLOAT_FRAC_BITS) \ |
| 75 | 75 | ret.low |= val << (exp - FLOAT_FRAC_BITS); \ |
| 76 | 76 | else \ |
| 77 | − ret.low = val >> (FLOAT_FRAC_BITS - exp); \ | |
| 77 | + ret.low |= val >> (FLOAT_FRAC_BITS - exp); \ | |
| 78 | 78 | } \ |
| 79 | 79 | \ |
| 80 | 80 | /* encode negative integer using 2's complement */ \ |
| @@ -92,13 +92,13 @@ void __aeabi_ ## name(unsigned val) \ · 11 unmodified lines | ||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /* float to unsigned long long conversion */ |
| 95 | −DEFINE__AEABIT_F2XLZ(f2ulz, 0) | |
| 95 | +DEFINE__AEABI_F2XLZ(f2ulz, 0) | |
| 96 | 96 | |
| 97 | 97 | /* float to long long conversion */ |
| 98 | −DEFINE__AEABIT_F2XLZ(f2lz, 1) | |
| 98 | +DEFINE__AEABI_F2XLZ(f2lz, 1) | |
| 99 | 99 | |
| 100 | 100 | /* double to [unsigned] long long conversion */ |
| 101 | −#define DEFINE__AEABIT_D2XLZ(name, with_sign) \ | |
| 101 | +#define DEFINE__AEABI_D2XLZ(name, with_sign) \ | |
| 102 | 102 | void __aeabi_ ## name(double_unsigned_struct val) \ |
| 103 | 103 | { \ |
| 104 | 104 | int exp, high_shift, sign; \ |
| @@ -143,7 +143,7 @@ void __aeabi_ ## name(double_unsigned_struct val) \ · 38 unmodified lines | ||
| 143 | 143 | ret.low |= val.high << high_shift; \ |
| 144 | 144 | ret.low |= val.low >> (32 - high_shift); \ |
| 145 | 145 | } else \ |
| 146 | − ret.low = val.high >> (DOUBLE_FRAC_BITS - 32 - exp); \ | |
| 146 | + ret.low |= val.high >> (DOUBLE_FRAC_BITS - 32 - exp); \ | |
| 147 | 147 | } \ |
| 148 | 148 | \ |
| 149 | 149 | /* encode negative integer using 2's complement */ \ |
| @@ -161,10 +161,10 @@ void __aeabi_ ## name(double_unsigned_struct val) \ · 11 unmodified lines | ||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /* double to unsigned long long conversion */ |
| 164 | −DEFINE__AEABIT_D2XLZ(d2ulz, 0) | |
| 164 | +DEFINE__AEABI_D2XLZ(d2ulz, 0) | |
| 165 | 165 | |
| 166 | 166 | /* double to long long conversion */ |
| 167 | −DEFINE__AEABIT_D2XLZ(d2lz, 1) | |
| 167 | +DEFINE__AEABI_D2XLZ(d2lz, 1) | |
| 168 | 168 | |
| 169 | 169 | /* long long to float conversion */ |
| 170 | 170 | #define DEFINE__AEABI_XL2F(name, with_sign) \ |