Changeset ba5870d in mainline
- Timestamp:
- 2006-02-24T17:55:08Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f37d769
- Parents:
- 1d83419
- Location:
- softfloat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
softfloat/generic/conversion.c
r1d83419 rba5870d 442 442 float32 uint64_to_float32(__u64 i) 443 443 { 444 int counter; 445 __s32 exp; 446 float32 result; 447 448 result.parts.sign = 0; 449 result.parts.fraction = 0; 450 451 counter = countZeroes64(i); 452 453 exp = FLOAT32_BIAS + 64 - counter - 1; 454 455 if (counter == 64) { 456 result.binary = 0; 457 return result; 458 } 459 460 /* Shift all to the first 31 bits (31. will be hidden 1)*/ 461 if (counter > 33) { 462 i <<= counter - 1 - 32; 463 } else { 464 i >>= 1 + 32 - counter; 465 } 466 467 roundFloat32(&exp, &i); 468 469 result.parts.fraction = i >> 7; 470 result.parts.exp = exp; 471 return result; 444 472 } 445 473 -
softfloat/include/common.h
r1d83419 rba5870d 34 34 float64 finishFloat64(__s32 cexp, __u64 cfrac, char sign); 35 35 36 int countZeroes64(__u64 i); 36 37 int countZeroes32(__u32 i); 37 38 int countZeroes8(__u8 i);
Note:
See TracChangeset
for help on using the changeset viewer.