Changeset 99255 in vbox for trunk/src/libs/softfloat-3e/source
- Timestamp:
- Mar 31, 2023 11:02:33 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/softfloat-3e/source/extF80_log2.c
r96965 r99255 37 37 #include <iprt/x86.h> 38 38 39 /** The log2e constant as 128-bit floating point value. 40 * base-10: 1.44269504088896340735992468100189185 41 * base-16: 1.71547652b82fe1777d0ffda0d239 42 * base-2 : 1.0111000101010100011101100101001010111000001011111110000101110111011111010000111111111101101000001101001000111001 */ 43 const RTFLOAT128U g_r128Log2e = RTFLOAT128U_INIT_C(0, 0x71547652b82f, 0xe1777d0ffda0d239, 0x3fff); 44 39 45 extFloat80_t extF80_ylog2x(extFloat80_t y, extFloat80_t x SOFTFLOAT_STATE_DECL_COMMA) 40 46 { … … 45 51 int_fast32_t expX; 46 52 uint_fast64_t sigX; 47 extFloat80_t v ;53 extFloat80_t v, log2e, log2m; 48 54 49 55 uX.f = x; … … 54 60 sigX = uiX0; 55 61 62 /* Linear approximation of log2x in the range [1, 2.0) (to be improved) */ 56 63 uXM.s.signExp = RTFLOAT80U_EXP_BIAS; 57 64 uXM.s.signif = sigX; 58 65 59 v = ui32_to_extF80(expX - RTFLOAT80U_EXP_BIAS - 1, pState); 60 v = extF80_add(v, uXM.f, pState); 66 v = i32_to_extF80(1, pState); 67 v = extF80_sub(uXM.f, v, pState); 68 69 log2e = f128_to_extF80(*(float128_t *)&g_r128Log2e, pState); 70 log2m = extF80_mul(v, log2e, pState); 71 72 v = i32_to_extF80(expX - RTFLOAT80U_EXP_BIAS, pState); 73 v = extF80_add(v, log2m, pState); 61 74 v = extF80_mul(y, v, pState); 62 75 63 76 return v; 64 77 } 65 66 /** The log2e constant as 128-bit floating point value.67 * base-10: 1.4426950408889634073599246810018918568 * base-16: 1.71547652b82fe1777d0ffda0d23969 * base-2 : 1.0111000101010100011101100101001010111000001011111110000101110111011111010000111111111101101000001101001000111001 */70 const RTFLOAT128U g_r128Log2e = RTFLOAT128U_INIT_C(0, 0x71547652b82f, 0xe1777d0ffda0d239, 0x3fff);71 78 72 79 extFloat80_t extF80_ylog2xp1(extFloat80_t y, extFloat80_t x SOFTFLOAT_STATE_DECL_COMMA)
Note:
See TracChangeset
for help on using the changeset viewer.