Changeset faa45c17 in mainline for uspace/lib/softfloat/add.c
- Timestamp:
- 2012-10-04T22:14:00Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- be1dcc26
- Parents:
- 466e95f7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/softfloat/add.c
r466e95f7 rfaa45c17 90 90 /* both are denormalized */ 91 91 frac1 += frac2; 92 if (frac1 & FLOAT32_HIDDEN_BIT_MASK 92 if (frac1 & FLOAT32_HIDDEN_BIT_MASK) { 93 93 /* result is not denormalized */ 94 94 a.parts.exp = 1; … … 112 112 frac2 <<= 6; 113 113 114 if (expdiff < (FLOAT32_FRACTION_SIZE + 2) 114 if (expdiff < (FLOAT32_FRACTION_SIZE + 2)) { 115 115 frac2 >>= expdiff; 116 116 frac1 += frac2; … … 121 121 } 122 122 123 if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7) 123 if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) { 124 124 ++exp1; 125 125 frac1 >>= 1; … … 135 135 } 136 136 137 if ((exp1 == FLOAT32_MAX_EXPONENT 137 if ((exp1 == FLOAT32_MAX_EXPONENT) || (exp2 > exp1)) { 138 138 /* overflow - set infinity as result */ 139 139 a.parts.exp = FLOAT32_MAX_EXPONENT; … … 250 250 } 251 251 252 if ((exp1 == FLOAT64_MAX_EXPONENT 252 if ((exp1 == FLOAT64_MAX_EXPONENT) || (exp2 > exp1)) { 253 253 /* overflow - set infinity as result */ 254 254 a.parts.exp = FLOAT64_MAX_EXPONENT; … … 259 259 a.parts.exp = exp1; 260 260 /* Clear hidden bit and shift */ 261 a.parts.fraction = ((frac1 >> 6 261 a.parts.fraction = ((frac1 >> 6) & (~FLOAT64_HIDDEN_BIT_MASK)); 262 262 return a; 263 263 }
Note:
See TracChangeset
for help on using the changeset viewer.