Commit bd59780c46430dbb31e4232aa5191f0739ed70a7
1 parent
ed8276ac
Fix floating point to integer conversion, by Aurelien Jarno.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2413 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
4 additions
and
4 deletions
target-sparc/op.c
| @@ -1472,23 +1472,23 @@ void OPPROTO op_fstod(void) | @@ -1472,23 +1472,23 @@ void OPPROTO op_fstod(void) | ||
| 1472 | /* Float to integer conversion. */ | 1472 | /* Float to integer conversion. */ |
| 1473 | void OPPROTO op_fstoi(void) | 1473 | void OPPROTO op_fstoi(void) |
| 1474 | { | 1474 | { |
| 1475 | - *((int32_t *)&FT0) = float32_to_int32(FT1, &env->fp_status); | 1475 | + *((int32_t *)&FT0) = float32_to_int32_round_to_zero(FT1, &env->fp_status); |
| 1476 | } | 1476 | } |
| 1477 | 1477 | ||
| 1478 | void OPPROTO op_fdtoi(void) | 1478 | void OPPROTO op_fdtoi(void) |
| 1479 | { | 1479 | { |
| 1480 | - *((int32_t *)&FT0) = float64_to_int32(DT1, &env->fp_status); | 1480 | + *((int32_t *)&FT0) = float64_to_int32_round_to_zero(DT1, &env->fp_status); |
| 1481 | } | 1481 | } |
| 1482 | 1482 | ||
| 1483 | #ifdef TARGET_SPARC64 | 1483 | #ifdef TARGET_SPARC64 |
| 1484 | void OPPROTO op_fstox(void) | 1484 | void OPPROTO op_fstox(void) |
| 1485 | { | 1485 | { |
| 1486 | - *((int64_t *)&DT0) = float32_to_int64(FT1, &env->fp_status); | 1486 | + *((int64_t *)&DT0) = float32_to_int64_round_to_zero(FT1, &env->fp_status); |
| 1487 | } | 1487 | } |
| 1488 | 1488 | ||
| 1489 | void OPPROTO op_fdtox(void) | 1489 | void OPPROTO op_fdtox(void) |
| 1490 | { | 1490 | { |
| 1491 | - *((int64_t *)&DT0) = float64_to_int64(DT1, &env->fp_status); | 1491 | + *((int64_t *)&DT0) = float64_to_int64_round_to_zero(DT1, &env->fp_status); |
| 1492 | } | 1492 | } |
| 1493 | 1493 | ||
| 1494 | void OPPROTO op_fmovs_cc(void) | 1494 | void OPPROTO op_fmovs_cc(void) |