From: aurel32 Date: Mon, 15 Dec 2008 01:00:17 +0000 (+0000) Subject: target-ppc: fix frsp instruction X-Git-Tag: stefano.display-merge-end~405 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=6ad193ed43e07f0d3a1182fc86ba9fda55976d87;p=qemu-xen-4.3-testing.git target-ppc: fix frsp instruction Signed-off-by: Aurelien Jarno git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6036 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 2d665e8d2..7cd589a1e 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; }