Changeset 1433ecda in mainline for uspace/lib/softfloat
- Timestamp:
- 2018-04-04T15:42:37Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- uspace/lib/softfloat
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/softfloat/add.c
r47b2d7e3 r1433ecda 383 383 384 384 lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 7, 385 &tmp_hi, &tmp_lo);385 &tmp_hi, &tmp_lo); 386 386 and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo); 387 387 if (lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) { … … 391 391 } 392 392 393 if ((exp1 == FLOAT128_MAX_EXPONENT 393 if ((exp1 == FLOAT128_MAX_EXPONENT) || (exp2 > exp1)) { 394 394 /* overflow - set infinity as result */ 395 395 a.parts.exp = FLOAT64_MAX_EXPONENT; -
uspace/lib/softfloat/common.c
r47b2d7e3 r1433ecda 500 500 void not128( 501 501 uint64_t a_hi, uint64_t a_lo, 502 502 uint64_t *r_hi, uint64_t *r_lo) 503 503 { 504 504 *r_hi = ~a_hi; -
uspace/lib/softfloat/div.c
r47b2d7e3 r1433ecda 527 527 } 528 528 529 cfrac_lo |= ((rem_hilo | rem_lohi | rem_lolo) != 0 529 cfrac_lo |= ((rem_hilo | rem_lohi | rem_lolo) != 0); 530 530 } 531 531 -
uspace/lib/softfloat/sub.c
r47b2d7e3 r1433ecda 56 56 57 57 expdiff = a.parts.exp - b.parts.exp; 58 if ((expdiff < 0 58 if ((expdiff < 0) || ((expdiff == 0) && 59 59 (a.parts.fraction < b.parts.fraction))) { 60 60 if (is_float32_nan(b)) { … … 141 141 done: 142 142 /* TODO: find first nonzero digit and shift result and detect possibly underflow */ 143 while ((exp1 > 0) && (!(frac1 & (FLOAT32_HIDDEN_BIT_MASK << 6 143 while ((exp1 > 0) && (!(frac1 & (FLOAT32_HIDDEN_BIT_MASK << 6)))) { 144 144 --exp1; 145 145 frac1 <<= 1; … … 180 180 181 181 expdiff = a.parts.exp - b.parts.exp; 182 if ((expdiff < 0 182 if ((expdiff < 0) || 183 183 ((expdiff == 0) && (a.parts.fraction < b.parts.fraction))) { 184 184 if (is_float64_nan(b)) { … … 265 265 done: 266 266 /* TODO: find first nonzero digit and shift result and detect possibly underflow */ 267 while ((exp1 > 0) && (!(frac1 & (FLOAT64_HIDDEN_BIT_MASK << 6 267 while ((exp1 > 0) && (!(frac1 & (FLOAT64_HIDDEN_BIT_MASK << 6)))) { 268 268 --exp1; 269 269 frac1 <<= 1; … … 305 305 306 306 expdiff = a.parts.exp - b.parts.exp; 307 if ((expdiff < 0 307 if ((expdiff < 0) || ((expdiff == 0) && 308 308 lt128(a.parts.frac_hi, a.parts.frac_lo, b.parts.frac_hi, b.parts.frac_lo))) { 309 309 if (is_float128_nan(b)) { … … 418 418 419 419 lshift128(FLOAT128_HIDDEN_BIT_MASK_HI, FLOAT128_HIDDEN_BIT_MASK_LO, 7, 420 &tmp_hi, &tmp_lo);420 &tmp_hi, &tmp_lo); 421 421 and128(frac1_hi, frac1_lo, tmp_hi, tmp_lo, &tmp_hi, &tmp_lo); 422 422 if (lt128(0x0ll, 0x0ll, tmp_hi, tmp_lo)) {
Note:
See TracChangeset
for help on using the changeset viewer.