45{
49 bool signA;
52 struct uint128 uiZ;
55 struct exp32_sig64 normExpSig;
58 struct uint128 rem;
60 struct uint128
y, term;
63
64
65
67 uiA64 = uA.s.signExp;
68 uiA0 = uA.s.signif;
71 sigA = uiA0;
72
73
74 if ( expA == 0x7FFF ) {
75 if ( sigA &
UINT64_C( 0x7FFFFFFFFFFFFFFF ) ) {
77 uiZ64 = uiZ.v64;
78 uiZ0 = uiZ.v0;
79 goto uiZ;
80 }
81 if ( ! signA )
return a;
82 goto invalid;
83 }
84
85
86 if ( signA ) {
87 if ( ! sigA ) goto zero;
88 goto invalid;
89 }
90
91
92 if ( ! expA ) expA = 1;
93 if ( ! (sigA &
UINT64_C( 0x8000000000000000 )) ) {
94 if ( ! sigA ) goto zero;
96 expA += normExpSig.exp;
97 sigA = normExpSig.sig;
98 }
99
100
101
102
103
104 expZ = ((expA - 0x3FFF)>>1) + 0x3FFF;
105 expA &= 1;
106 sig32A = sigA>>32;
109 if ( expA ) {
110 sig32Z >>= 1;
112 } else {
114 }
116
117
120 sigZ = x64 + (q<<3);
122
123
124
125 for (;;) {
128 if ( ! (rem.v64 &
UINT64_C( 0x8000000000000000 )) )
break;
129 --q;
130 sigZ -= 1<<3;
131 }
132
133
134 q = (((rem.v64>>2) * recipSqrt32)>>32) + 2;
135 x64 = sigZ;
136 sigZ = (sigZ<<1) + (q>>25);
138
139
140 if ( (q & 0xFFFFFF) <= 2 ) {
148 if ( rem.v64 &
UINT64_C( 0x8000000000000000 ) ) {
149 if ( ! sigZExtra ) --sigZ;
150 --sigZExtra;
151 } else {
152 if ( rem.v64 | rem.v0 ) sigZExtra |= 1;
153 }
154 }
155 return
158
159
160 invalid:
164 goto uiZ;
165
166
167 zero:
169 uiZ0 = 0;
170 uiZ:
171 uZ.s.signExp = uiZ64;
172 uZ.s.signif = uiZ0;
173 return uZ.f;
174
175}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
struct uint128 softfloat_propagateNaNExtF80UI(uint_fast16_t uiA64, uint_fast64_t uiA0, uint_fast16_t uiB64, uint_fast64_t uiB0)
void softfloat_raiseFlags(uint_fast8_t flags)
#define defaultNaNExtF80UI0
#define defaultNaNExtF80UI64
#define packToExtF80UI64(sign, exp)
#define expExtF80UI64(a64)
#define signExtF80UI64(a64)
uint32_t softfloat_approxRecipSqrt32_1(unsigned int oddExpA, uint32_t a)
THREAD_LOCAL uint_fast8_t extF80_roundingPrecision
struct uint128 softfloat_add128(uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0)
struct uint128 softfloat_mul64ByShifted32To128(uint64_t a, uint32_t b)
struct exp32_sig64 softfloat_normSubnormalExtF80Sig(uint_fast64_t sig)
extFloat80_t softfloat_roundPackToExtF80(bool sign, int_fast32_t exp, uint_fast64_t sig, uint_fast64_t sigExtra, uint_fast8_t roundingPrecision)
struct uint128 softfloat_shortShiftLeft128(uint64_t a64, uint64_t a0, uint_fast8_t dist)
struct uint128 softfloat_sub128(uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0)
unsigned __int64 uint64_t