From 0cadcbbe6595e77ef50c5f50a2f064a37f3da698 Mon Sep 17 00:00:00 2001 From: aurel32 Date: Wed, 1 Oct 2008 21:45:37 +0000 Subject: target-ppc: fix computation of XER.{CA, OV} in addme, subfme (Jocelyn Mayer) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5380 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-ppc/op.c | 8 -------- target-ppc/op_helper.c | 12 ++---------- 2 files changed, 2 insertions(+), 18 deletions(-) (limited to 'target-ppc') diff --git a/target-ppc/op.c b/target-ppc/op.c index 4ab0f00..830e963 100644 --- a/target-ppc/op.c +++ b/target-ppc/op.c @@ -640,8 +640,6 @@ void OPPROTO op_add_me (void) T0 += xer_ca + (-1); if (likely((uint32_t)T1 != 0)) xer_ca = 1; - else - xer_ca = 0; RETURN(); } @@ -651,8 +649,6 @@ void OPPROTO op_add_me_64 (void) T0 += xer_ca + (-1); if (likely((uint64_t)T1 != 0)) xer_ca = 1; - else - xer_ca = 0; RETURN(); } #endif @@ -930,8 +926,6 @@ void OPPROTO op_subfme (void) T0 = ~T0 + xer_ca - 1; if (likely((uint32_t)T0 != UINT32_MAX)) xer_ca = 1; - else - xer_ca = 0; RETURN(); } @@ -941,8 +935,6 @@ void OPPROTO op_subfme_64 (void) T0 = ~T0 + xer_ca - 1; if (likely((uint64_t)T0 != UINT64_MAX)) xer_ca = 1; - else - xer_ca = 0; RETURN(); } #endif diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index d398640..4d8b464 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -151,10 +151,8 @@ void do_addmeo (void) T0 += xer_ca + (-1); xer_ov = ((uint32_t)T1 & ((uint32_t)T1 ^ (uint32_t)T0)) >> 31; xer_so |= xer_ov; - if (likely(T1 != 0)) + if (likely((uint32_t)T1 != 0)) xer_ca = 1; - else - xer_ca = 0; } #if defined(TARGET_PPC64) @@ -164,10 +162,8 @@ void do_addmeo_64 (void) T0 += xer_ca + (-1); xer_ov = ((uint64_t)T1 & ((uint64_t)T1 ^ (uint64_t)T0)) >> 63; xer_so |= xer_ov; - if (likely(T1 != 0)) + if (likely((uint64_t)T1 != 0)) xer_ca = 1; - else - xer_ca = 0; } #endif @@ -312,8 +308,6 @@ void do_subfmeo (void) xer_so |= xer_ov; if (likely((uint32_t)T1 != UINT32_MAX)) xer_ca = 1; - else - xer_ca = 0; } #if defined(TARGET_PPC64) @@ -325,8 +319,6 @@ void do_subfmeo_64 (void) xer_so |= xer_ov; if (likely((uint64_t)T1 != UINT64_MAX)) xer_ca = 1; - else - xer_ca = 0; } #endif -- cgit v1.1