Changeset 1b20da0 in mainline for uspace/lib/softfloat/common.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/common.c
rdf6ded8 r1b20da0 59 59 * Take fraction shifted by 10 bits to the left, round it, normalize it 60 60 * and detect exceptions 61 * 61 * 62 62 * @param cexp Exponent with bias. 63 63 * @param cfrac Fraction shifted 10 bits to the left with added hidden bit. … … 93 93 } 94 94 95 cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); 95 cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); 96 96 97 97 if (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))) { … … 99 99 ((cfrac >> (64 - FLOAT64_FRACTION_SIZE - 2)) & (~FLOAT64_HIDDEN_BIT_MASK)); 100 100 return result; 101 } 101 } 102 102 } else { 103 cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); 103 cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); 104 104 } 105 105 … … 121 121 result.parts.exp = (uint32_t) cexp; 122 122 123 result.parts.fraction = 123 result.parts.fraction = 124 124 ((cfrac >> (64 - FLOAT64_FRACTION_SIZE - 2)) & (~FLOAT64_HIDDEN_BIT_MASK)); 125 125 126 return result; 126 return result; 127 127 } 128 128 129 129 /** 130 130 * Take fraction, round it, normalize it and detect exceptions 131 * 131 * 132 132 * @param cexp Exponent with bias. 133 133 * @param cfrac_hi High part of the fraction shifted 14 bits to the left … … 139 139 * @return Finished quadruple-precision float. 140 140 */ 141 float128 finish_float128(int32_t cexp, uint64_t cfrac_hi, uint64_t cfrac_lo, 141 float128 finish_float128(int32_t cexp, uint64_t cfrac_hi, uint64_t cfrac_lo, 142 142 char sign, uint64_t shift_out) 143 143 { … … 228 228 result.parts.frac_lo = tmp_lo; 229 229 230 return result; 230 return result; 231 231 } 232 232 … … 242 242 } 243 243 244 /** 244 /** 245 245 * Counts leading zeroes in 32bit unsigned integer. 246 246 * … … 290 290 (*fraction) += (0x1 << (32 - FLOAT32_FRACTION_SIZE - 3)); 291 291 292 if ((*fraction) & 292 if ((*fraction) & 293 293 (FLOAT32_HIDDEN_BIT_MASK << (32 - FLOAT32_FRACTION_SIZE - 1))) { 294 294 /* rounding overflow */ … … 324 324 325 325 /* See if there was a carry to bit 63. */ 326 if ((*fraction) & 326 if ((*fraction) & 327 327 (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1))) { 328 328 /* rounding overflow */ … … 589 589 /** 590 590 * Multiplication of two 64-bit unsigned integers. 591 * 591 * 592 592 * @param a First input operand. 593 593 * @param b Second input operand. … … 622 622 /** 623 623 * Multiplication of two 128-bit unsigned integers. 624 * 624 * 625 625 * @param a_hi High part of the first input operand. 626 626 * @param a_lo Low part of the first input operand. … … 656 656 * Estimate the quotient of 128-bit unsigned divident and 64-bit unsigned 657 657 * divisor. 658 * 658 * 659 659 * @param a_hi High part of the divident. 660 660 * @param a_lo Low part of the divident.
Note:
See TracChangeset
for help on using the changeset viewer.