45{
49 bool signA;
55 bool signB;
58 bool signZ;
59 struct exp32_sig64 normExpSig;
61 struct uint128 rem;
64 int ix;
67 struct uint128 term;
69 struct uint128 uiZ;
73
74
75
77 uiA64 = uA.s.signExp;
78 uiA0 = uA.s.signif;
81 sigA = uiA0;
82 uB.f = b;
84 uiB0 = uB.s.signif;
87 sigB = uiB0;
88 signZ = signA ^ signB;
89
90
91 if ( expA == 0x7FFF ) {
92 if ( sigA &
UINT64_C( 0x7FFFFFFFFFFFFFFF ) )
goto propagateNaN;
93 if ( expB == 0x7FFF ) {
94 if ( sigB &
UINT64_C( 0x7FFFFFFFFFFFFFFF ) )
goto propagateNaN;
95 goto invalid;
96 }
97 goto infinity;
98 }
99 if ( expB == 0x7FFF ) {
100 if ( sigB &
UINT64_C( 0x7FFFFFFFFFFFFFFF ) )
goto propagateNaN;
101 goto zero;
102 }
103
104
105 if ( ! expB ) expB = 1;
106 if ( ! (sigB &
UINT64_C( 0x8000000000000000 )) ) {
107 if ( ! sigB ) {
108 if ( ! sigA ) goto invalid;
110 goto infinity;
111 }
113 expB += normExpSig.exp;
114 sigB = normExpSig.sig;
115 }
116 if ( ! expA ) expA = 1;
117 if ( ! (sigA &
UINT64_C( 0x8000000000000000 )) ) {
118 if ( ! sigA ) goto zero;
120 expA += normExpSig.exp;
121 sigA = normExpSig.sig;
122 }
123
124
125 expZ = expA - expB + 0x3FFF;
126 if ( sigA < sigB ) {
127 --expZ;
129 } else {
131 }
133 sigZ = 0;
134 ix = 2;
135 for (;;) {
137 q = (q64 + 0x80000000)>>32;
138 --ix;
139 if ( ix < 0 ) break;
143 if ( rem.v64 &
UINT64_C( 0x8000000000000000 ) ) {
144 --q;
146 }
147 sigZ = (sigZ<<29) + q;
148 }
149
150
151 if ( ((q + 1) & 0x3FFFFF) < 2 ) {
156 if ( rem.v64 &
UINT64_C( 0x8000000000000000 ) ) {
157 --q;
160 ++q;
162 }
163 if ( rem.v64 | rem.v0 ) q |= 1;
164 }
165
166
167 sigZ = (sigZ<<6) + (q>>23);
169 return
172
173
174 propagateNaN:
176 uiZ64 = uiZ.v64;
177 uiZ0 = uiZ.v0;
178 goto uiZ;
179
180
181 invalid:
185 goto uiZ;
186
187
188 infinity:
190 uiZ0 =
UINT64_C( 0x8000000000000000 );
191 goto uiZ;
192
193
194 zero:
196 uiZ0 = 0;
197 uiZ:
198 uZ.s.signExp = uiZ64;
199 uZ.s.signif = uiZ0;
200 return uZ.f;
201
202}
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_approxRecip32_1(uint32_t a)
THREAD_LOCAL uint_fast8_t extF80_roundingPrecision
@ softfloat_flag_infinite
struct uint128 softfloat_add128(uint64_t a64, uint64_t a0, uint64_t b64, uint64_t b0)
bool softfloat_le128(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