Changeset d3ca210 in mainline
- Timestamp:
- 2006-02-13T20:09:55Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1f95f2
- Parents:
- e979fea
- Location:
- softfloat/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
softfloat/generic/add.c
re979fea rd3ca210 103 103 frac2 >>= expdiff; 104 104 frac1 += frac2; 105 }; 105 } else { 106 a.parts.exp = exp1; 107 a.parts.fraction = (frac1 >> 6) & (~(FLOAT32_HIDDEN_BIT_MASK)); 108 return a; 109 } 106 110 107 111 if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7) ) { … … 143 147 __u64 frac1, frac2; 144 148 145 expdiff = a.parts.exp- b.parts.exp;149 expdiff = ((int )a.parts.exp) - b.parts.exp; 146 150 if (expdiff < 0) { 147 151 if (isFloat64NaN(b)) { … … 212 216 frac2 >>= expdiff; 213 217 frac1 += frac2; 214 }; 218 } else { 219 a.parts.exp = exp1; 220 a.parts.fraction = (frac1 >> 6) & (~(FLOAT64_HIDDEN_BIT_MASK)); 221 return a; 222 } 215 223 216 224 if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7) ) { … … 228 236 }; 229 237 230 if (( a.parts.exp == FLOAT64_MAX_EXPONENT ) || (a.parts.exp <exp1)) {238 if ((exp1 == FLOAT64_MAX_EXPONENT ) || (exp2 > exp1)) { 231 239 /* overflow - set infinity as result */ 232 240 a.parts.exp = FLOAT64_MAX_EXPONENT; … … 238 246 /*Clear hidden bit and shift */ 239 247 a.parts.fraction = ( (frac1 >> 6 ) & (~FLOAT64_HIDDEN_BIT_MASK)); 248 240 249 return a; 241 250 } -
softfloat/generic/common.c
re979fea rd3ca210 48 48 }; 49 49 50 cfrac >>= 1; 50 cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); 51 52 if ((cexp < 0) || ( cexp == 0 && (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))))) { 53 /* FIXME: underflow */ 54 result.parts.exp = 0; 55 if ((cexp + FLOAT64_FRACTION_SIZE) < 0) { 56 result.parts.fraction = 0; 57 return result; 58 } 59 //cfrac >>= 1; 60 while (cexp < 0) { 61 cexp++; 62 cfrac >>= 1; 63 } 64 65 result.parts.fraction = ((cfrac >>(64 - FLOAT64_FRACTION_SIZE - 2) ) & (~FLOAT64_HIDDEN_BIT_MASK)); 66 67 return result; 68 } 69 51 70 ++cexp; 52 cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3));53 71 54 72 if (cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1 ))) { 55 73 ++cexp; 56 74 cfrac >>= 1; 57 75 } 58 76 59 77 /* check overflow */ … … 65 83 } 66 84 67 if (cexp < 0) { 68 /* FIXME: underflow */ 69 result.parts.exp = 0; 70 if ((cexp + FLOAT64_FRACTION_SIZE) < 0) { 71 result.parts.fraction = 0; 72 return result; 73 } 74 cfrac >>= 1; 75 while (cexp < 0) { 76 cexp ++; 77 cfrac >>= 1; 78 } 79 return result; 80 81 } else { 82 cexp ++; /*normalized*/ 83 result.parts.exp = (__u32)cexp; 84 } 85 result.parts.exp = (__u32)cexp; 85 86 86 87 result.parts.fraction = ((cfrac >>(64 - FLOAT64_FRACTION_SIZE - 2 ) ) & (~FLOAT64_HIDDEN_BIT_MASK)); … … 88 89 return result; 89 90 } 91
Note:
See TracChangeset
for help on using the changeset viewer.