summaryrefslogtreecommitdiff
path: root/target-ppc
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-15 01:00:17 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-12-15 01:00:17 +0000
commit6ad193ed43e07f0d3a1182fc86ba9fda55976d87 (patch)
tree04087f9ab8168453300b3e575768aa273c8a1be9 /target-ppc
parent27ee5df007d34f78fef5fbc64fd6e147684a25cc (diff)
downloadqemu-6ad193ed43e07f0d3a1182fc86ba9fda55976d87.tar.gz
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
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/op_helper.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 2d665e8d22..7cd589a1ed 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -1478,6 +1478,7 @@ uint64_t helper_fnmsub (uint64_t arg1, uint64_t arg2, uint64_t arg3)
uint64_t helper_frsp (uint64_t arg)
{
CPU_DoubleU farg;
+ float32 f32;
farg.ll = arg;
#if USE_PRECISE_EMULATION
@@ -1485,10 +1486,12 @@ uint64_t helper_frsp (uint64_t arg)
/* sNaN square root */
farg.ll = fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
} else {
- farg.d = float64_to_float32(farg.d, &env->fp_status);
+ f32 = float64_to_float32(farg.d, &env->fp_status);
+ farg.d = float32_to_float64(f32, &env->fp_status);
}
#else
- farg.d = float64_to_float32(farg.d, &env->fp_status);
+ f32 = float64_to_float32(farg.d, &env->fp_status);
+ farg.d = float32_to_float64(f32, &env->fp_status);
#endif
return farg.ll;
}