Changeset 1b20da0 in mainline for uspace/lib/softfloat/div.c
- Timestamp:
- 2018-02-28T17:52:03Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/softfloat/div.c
rdf6ded8 r1b20da0 151 151 152 152 cfrac = (afrac << 32) / bfrac; 153 if ((cfrac & 0x3F) == 0) { 153 if ((cfrac & 0x3F) == 0) { 154 154 cfrac |= (bfrac * cfrac != afrac << 32); 155 155 } … … 195 195 } 196 196 197 result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); 197 result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); 198 198 199 199 return result; … … 208 208 * 209 209 */ 210 float64 div_float64(float64 a, float64 b) 210 float64 div_float64(float64 a, float64 b) 211 211 { 212 212 float64 result; 213 213 int64_t aexp, bexp, cexp; 214 uint64_t afrac, bfrac, cfrac; 214 uint64_t afrac, bfrac, cfrac; 215 215 uint64_t remlo, remhi; 216 216 uint64_t tmplo, tmphi; … … 291 291 /* normalize it*/ 292 292 aexp++; 293 /* afrac is nonzero => it must stop */ 293 /* afrac is nonzero => it must stop */ 294 294 while (!(afrac & FLOAT64_HIDDEN_BIT_MASK)) { 295 295 afrac <<= 1; … … 300 300 if (bexp == 0) { 301 301 bexp++; 302 /* bfrac is nonzero => it must stop */ 302 /* bfrac is nonzero => it must stop */ 303 303 while (!(bfrac & FLOAT64_HIDDEN_BIT_MASK)) { 304 304 bfrac <<= 1; … … 315 315 } 316 316 317 cexp = aexp - bexp + FLOAT64_BIAS - 2; 317 cexp = aexp - bexp + FLOAT64_BIAS - 2; 318 318 319 319 cfrac = div128est(afrac, 0x0ll, bfrac);
Note:
See TracChangeset
for help on using the changeset viewer.