48{
51 bool signA;
56 bool signB;
59 bool signZ;
62#ifdef SOFTFLOAT_FAST_DIV32TO16
65#else
66 int index;
69#endif
72
73
74
76 uiA = uA.ui;
80 uB.f = b;
81 uiB = uB.ui;
85 signZ = signA ^ signB;
86
87
88 if ( expA == 0x1F ) {
89 if ( sigA ) goto propagateNaN;
90 if ( expB == 0x1F ) {
91 if ( sigB ) goto propagateNaN;
92 goto invalid;
93 }
94 goto infinity;
95 }
96 if ( expB == 0x1F ) {
97 if ( sigB ) goto propagateNaN;
98 goto zero;
99 }
100
101
102 if ( ! expB ) {
103 if ( ! sigB ) {
104 if ( ! (expA | sigA) ) goto invalid;
106 goto infinity;
107 }
109 expB = normExpSig.exp;
110 sigB = normExpSig.sig;
111 }
112 if ( ! expA ) {
113 if ( ! sigA ) goto zero;
115 expA = normExpSig.exp;
116 sigA = normExpSig.sig;
117 }
118
119
120 expZ = expA - expB + 0xE;
121 sigA |= 0x0400;
122 sigB |= 0x0400;
123#ifdef SOFTFLOAT_FAST_DIV32TO16
124 if ( sigA < sigB ) {
125 --expZ;
127 } else {
129 }
130 sigZ = sig32A / sigB;
131 if ( ! (sigZ & 7) ) sigZ |= ((
uint_fast32_t) sigB * sigZ != sig32A);
132#else
133 if ( sigA < sigB ) {
134 --expZ;
135 sigA <<= 5;
136 } else {
137 sigA <<= 4;
138 }
139 index = sigB>>6 & 0xF;
142 * (sigB & 0x3F))
143 >>10);
145 rem = (sigA<<10) - sigZ * sigB;
147
148
149 ++sigZ;
150 if ( ! (sigZ & 7) ) {
151 sigZ &= ~1;
152 rem = (sigA<<10) - sigZ * sigB;
153 if ( rem & 0x8000 ) {
154 sigZ -= 2;
155 } else {
156 if ( rem ) sigZ |= 1;
157 }
158 }
159#endif
161
162
163 propagateNaN:
165 goto uiZ;
166
167
168 invalid:
171 goto uiZ;
172
173
174 infinity:
176 goto uiZ;
177
178
179 zero:
181 uiZ:
182 uZ.ui = uiZ;
183 return uZ.f;
184
185}
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
uint_fast16_t softfloat_propagateNaNF16UI(uint_fast16_t uiA, uint_fast16_t uiB)
void softfloat_raiseFlags(uint_fast8_t flags)
const uint16_t softfloat_approxRecip_1k0s[]
const uint16_t softfloat_approxRecip_1k1s[]
float16_t softfloat_roundPackToF16(bool, int_fast16_t, uint_fast16_t)
struct exp8_sig16 softfloat_normSubnormalF16Sig(uint_fast16_t)
#define packToF16UI(sign, exp, sig)
@ softfloat_flag_infinite