60{
66 bool signRem;
69 uint32_t rem[3], x[3], sig32B, q, recip32, rem2[3], *remPtr, *altRemPtr;
71
72
73
77
78
82
83
84 if ( (expA == 0x7FFF) || (expB == 0x7FFF) ) {
86 if ( expA == 0x7FFF ) goto invalid;
87
88
89
90
91
92
93 expB += expB;
94 }
95
96
97 if ( ! expB ) expB = 1;
99 if ( ! (x64 &
UINT64_C( 0x8000000000000000 )) ) {
100 if ( ! x64 ) goto invalid;
102 }
104 if ( ! expA ) expA = 1;
106 if ( ! (sigA &
UINT64_C( 0x8000000000000000 )) ) {
107 if ( ! sigA ) {
108 expA = 0;
109 goto copyA;
110 }
112 }
113
114
115 expDiff = expA - expB;
116 if ( expDiff < -1 ) goto copyA;
121 sig32B = x64>>32;
122 x64 >>= 2;
125 if ( expDiff < 1 ) {
126 if ( expDiff ) {
127 --expB;
129 q = 0;
130 } else {
133 }
134 } else {
136 expDiff -= 30;
137 for (;;) {
139 if ( expDiff < 0 ) break;
140 q = (x64 + 0x80000000)>>32;
144 }
145 expDiff -= 29;
146 }
147
148
149
150 q = (
uint32_t) (x64>>32)>>(~expDiff & 31);
153 remPtr = rem;
154 altRemPtr = rem2;
156 goto selectRem;
157 }
158 }
159
160
161 remPtr = rem;
162 altRemPtr = rem2;
163 do {
164 ++q;
165 newRemPtr = altRemPtr;
167 altRemPtr = remPtr;
168 remPtr = newRemPtr;
169 }
while ( ! (remPtr[
indexWordHi( 3 )] & 0x80000000) );
170 selectRem:
173 if (
174 (wordMeanRem & 0x80000000)
175 || (! wordMeanRem && (q & 1) && ! x[
indexWord( 3, 0 )]
177 ) {
178 remPtr = altRemPtr;
179 }
181 signRem = ! signRem;
183 }
185 return;
186
187
188 invalid:
190 return;
191
192
193 copyA:
194 if ( expA < 1 ) {
195 sigA >>= 1 - expA;
196 expA = 0;
197 }
200
201}
void softfloat_normRoundPackMToExtF80M(bool, int32_t, uint32_t *, uint_fast8_t, struct extFloat80M *)
#define packToExtF80UI64(sign, exp)
#define expExtF80UI64(a64)
void softfloat_invalidExtF80M(struct extFloat80M *)
#define signExtF80UI64(a64)
bool softfloat_tryPropagateNaNExtF80M(const struct extFloat80M *, const struct extFloat80M *, struct extFloat80M *)
int softfloat_normExtF80SigM(uint64_t *)
#define indexWord(total, n)
#define indexWordHi(total)
int_fast8_t softfloat_compare96M(const uint32_t *aPtr, const uint32_t *bPtr)
#define softfloat_negX96M(zPtr)
#define softfloat_add96M(aPtr, bPtr, zPtr)
#define softfloat_sub96M(aPtr, bPtr, zPtr)
#define softfloat_remStep96MBy32(remPtr, dist, bPtr, q, zPtr)
uint32_t softfloat_approxRecip32_1(uint32_t a)
unsigned __int64 uint64_t