Signed-off-by: Nikunj A Dadhania <nik...@linux.vnet.ibm.com> --- target/ppc/int_helper.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index da4e1a6..b376860 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -320,22 +320,24 @@ target_ulong helper_divo(CPUPPCState *env, target_ulong arg1, target_ulong arg2) { uint64_t tmp = (uint64_t)arg1 << 32 | env->spr[SPR_MQ]; + int ov; if (((int32_t)tmp == INT32_MIN && (int32_t)arg2 == (int32_t)-1) || (int32_t)arg2 == 0) { - env->so = env->ov = 1; + ov = 1; env->spr[SPR_MQ] = 0; return INT32_MIN; } else { env->spr[SPR_MQ] = tmp % arg2; tmp /= (int32_t)arg2; if ((int32_t)tmp != tmp) { - env->so = env->ov = 1; + ov = 1; } else { - env->ov = 0; + ov = 0; } return tmp; } + helper_update_ov_legacy(env, ov); } target_ulong helper_divs(CPUPPCState *env, target_ulong arg1, @@ -356,11 +358,11 @@ target_ulong helper_divso(CPUPPCState *env, target_ulong arg1, { if (((int32_t)arg1 == INT32_MIN && (int32_t)arg2 == (int32_t)-1) || (int32_t)arg2 == 0) { - env->so = env->ov = 1; + helper_update_ov_legacy(env, 1); env->spr[SPR_MQ] = 0; return INT32_MIN; } else { - env->ov = 0; + helper_update_ov_legacy(env, 0); env->spr[SPR_MQ] = (int32_t)arg1 % (int32_t)arg2; return (int32_t)arg1 / (int32_t)arg2; } -- 2.7.4