From 7c58044c0ab79f11604f71aa04b4691baacef886 Mon Sep 17 00:00:00 2001 From: j_mayer Date: Sat, 27 Oct 2007 17:54:30 +0000 Subject: Fix PowerPC FPSCR update and floating-point exception generation in most useful cases. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3458 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-ppc/helper.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'target-ppc/helper.c') diff --git a/target-ppc/helper.c b/target-ppc/helper.c index 9bdd8835e9..869d5b7677 100644 --- a/target-ppc/helper.c +++ b/target-ppc/helper.c @@ -2130,6 +2130,8 @@ static always_inline void powerpc_excp (CPUState *env, fprintf(logfile, "Ignore floating point exception\n"); } #endif + env->exception_index = POWERPC_EXCP_NONE; + env->error_code = 0; return; } new_msr &= ~((target_ulong)1 << MSR_RI); @@ -2138,12 +2140,6 @@ static always_inline void powerpc_excp (CPUState *env, new_msr |= (target_ulong)1 << MSR_HV; #endif msr |= 0x00100000; - /* Set FX */ - env->fpscr[7] |= 0x8; - /* Finally, update FEX */ - if ((((env->fpscr[7] & 0x3) << 3) | (env->fpscr[6] >> 1)) & - ((env->fpscr[1] << 1) | (env->fpscr[0] >> 3))) - env->fpscr[7] |= 0x4; if (msr_fe0 != msr_fe1) { msr |= 0x00010000; goto store_current; @@ -2199,8 +2195,11 @@ static always_inline void powerpc_excp (CPUState *env, /* XXX: To be removed */ if (env->gpr[3] == 0x113724fa && env->gpr[4] == 0x77810f9b && env->osi_call) { - if (env->osi_call(env) != 0) + if (env->osi_call(env) != 0) { + env->exception_index = POWERPC_EXCP_NONE; + env->error_code = 0; return; + } } if (loglevel & CPU_LOG_INT) { dump_syscall(env); -- cgit v1.2.3