Skip to contentSkip to conversation

[6036] target-ppc: fix frsp instruction

Qemu-devel Aurelien Jarno 1 participant 1 message Dec 15, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 6036

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6036
Author:   aurel32
Date:     2008-12-15 01:00:17 +0000 (Mon, 15 Dec 2008)

Log Message:
-----------
target-ppc: fix frsp instruction

Modified Paths:
--------------
trunk/target-ppc/op_helper.c

Modified: trunk/target-ppc/op_helper.c
===================================================================

target-ppc/op_helper.c +5 -2
@@ -1478,6 +1478,7 @@
 uint64_t helper_frsp (uint64_t arg)
 {
     CPU_DoubleU farg;
+    float32 f32;
     farg.ll = arg;
 
 #if USE_PRECISE_EMULATION
@@ -1485,10 +1486,12 @@
         /* 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;
 }