Commit 6ad193ed43e07f0d3a1182fc86ba9fda55976d87
1 parent
27ee5df0
target-ppc: fix frsp instruction
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6036 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
5 additions
and
2 deletions
target-ppc/op_helper.c
... | ... | @@ -1478,6 +1478,7 @@ uint64_t helper_fnmsub (uint64_t arg1, uint64_t arg2, uint64_t arg3) |
1478 | 1478 | uint64_t helper_frsp (uint64_t arg) |
1479 | 1479 | { |
1480 | 1480 | CPU_DoubleU farg; |
1481 | + float32 f32; | |
1481 | 1482 | farg.ll = arg; |
1482 | 1483 | |
1483 | 1484 | #if USE_PRECISE_EMULATION |
... | ... | @@ -1485,10 +1486,12 @@ uint64_t helper_frsp (uint64_t arg) |
1485 | 1486 | /* sNaN square root */ |
1486 | 1487 | farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN); |
1487 | 1488 | } else { |
1488 | - farg.d = float64_to_float32(farg.d, &env->fp_status); | |
1489 | + f32 = float64_to_float32(farg.d, &env->fp_status); | |
1490 | + farg.d = float32_to_float64(f32, &env->fp_status); | |
1489 | 1491 | } |
1490 | 1492 | #else |
1491 | - farg.d = float64_to_float32(farg.d, &env->fp_status); | |
1493 | + f32 = float64_to_float32(farg.d, &env->fp_status); | |
1494 | + farg.d = float32_to_float64(f32, &env->fp_status); | |
1492 | 1495 | #endif |
1493 | 1496 | return farg.ll; |
1494 | 1497 | } | ... | ... |