45{
49 bool signA;
55 bool signB;
58 bool signZ;
60 struct exp32_sig64 normExpSig;
62 struct uint128 sig128Z, uiZ;
66
67
68
70 uiA64 = uA.s.signExp;
71 uiA0 = uA.s.signif;
74 sigA = uiA0;
75 uB.f = b;
77 uiB0 = uB.s.signif;
80 sigB = uiB0;
81 signZ = signA ^ signB;
82
83
84 if ( expA == 0x7FFF ) {
85 if (
86 (sigA &
UINT64_C( 0x7FFFFFFFFFFFFFFF ))
87 || ((expB == 0x7FFF) && (sigB &
UINT64_C( 0x7FFFFFFFFFFFFFFF )))
88 ) {
89 goto propagateNaN;
90 }
91 magBits = expB | sigB;
92 goto infArg;
93 }
94 if ( expB == 0x7FFF ) {
95 if ( sigB &
UINT64_C( 0x7FFFFFFFFFFFFFFF ) )
goto propagateNaN;
96 magBits = expA | sigA;
97 goto infArg;
98 }
99
100
101 if ( ! expA ) expA = 1;
102 if ( ! (sigA &
UINT64_C( 0x8000000000000000 )) ) {
103 if ( ! sigA ) goto zero;
105 expA += normExpSig.exp;
106 sigA = normExpSig.sig;
107 }
108 if ( ! expB ) expB = 1;
109 if ( ! (sigB &
UINT64_C( 0x8000000000000000 )) ) {
110 if ( ! sigB ) goto zero;
112 expB += normExpSig.exp;
113 sigB = normExpSig.sig;
114 }
115
116
117 expZ = expA + expB - 0x3FFE;
119 if ( sig128Z.v64 <
UINT64_C( 0x8000000000000000 ) ) {
120 --expZ;
121 sig128Z =
123 sig128Z.v64, sig128Z.v0, sig128Z.v64, sig128Z.v0 );
124 }
125 return
128
129
130 propagateNaN:
132 uiZ64 = uiZ.v64;
133 uiZ0 = uiZ.v0;
134 goto uiZ;
135
136
137 infArg:
138 if ( ! magBits ) {
142 } else {
144 uiZ0 =
UINT64_C( 0x8000000000000000 );
145 }
146 goto uiZ;
147
148
149 zero:
151 uiZ0 = 0;
152 uiZ:
153 uZ.s.signExp = uiZ64;
154 uZ.s.signif = uiZ0;
155 return uZ.f;
156
157}
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)
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_mul64To128(uint64_t a, uint64_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)