From bb3911a609084dc1c0c72fc25884ef712066bec9 Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 30 Oct 2005 17:28:50 +0000 Subject: Sparc64 add/sub flag bugs fixed (Blue Swirl) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1579 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-sparc/op.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target-sparc/op.c b/target-sparc/op.c index f8b491a7fa..67de62f4cf 100644 --- a/target-sparc/op.c +++ b/target-sparc/op.c @@ -379,7 +379,7 @@ void OPPROTO op_add_T1_T0_cc(void) env->psr |= PSR_ZERO; if ((int32_t) T0 < 0) env->psr |= PSR_NEG; - if ((src1 & 0xffffffff) < (T1 & 0xffffffff)) + if ((T0 & 0xffffffff) < (src1 & 0xffffffff)) env->psr |= PSR_CARRY; if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) & ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) @@ -424,7 +424,7 @@ void OPPROTO op_addx_T1_T0_cc(void) env->psr |= PSR_ZERO; if ((int32_t) T0 < 0) env->psr |= PSR_NEG; - if ((src1 & 0xffffffff) < (T1 & 0xffffffff)) + if ((T0 & 0xffffffff) < (src1 & 0xffffffff)) env->psr |= PSR_CARRY; if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) & ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) @@ -480,7 +480,7 @@ void OPPROTO op_sub_T1_T0_cc(void) env->xcc |= PSR_ZERO; if ((int64_t) T0 < 0) env->xcc |= PSR_NEG; - if (T0 < src1) + if (src1 < T1) env->xcc |= PSR_CARRY; if (((src1 ^ T1) & (src1 ^ T0)) & (1ULL << 63)) env->xcc |= PSR_OVF; @@ -525,7 +525,7 @@ void OPPROTO op_subx_T1_T0_cc(void) env->xcc |= PSR_ZERO; if ((int64_t) T0 < 0) env->xcc |= PSR_NEG; - if (T0 < src1) + if (src1 < T1) env->xcc |= PSR_CARRY; if (((src1 ^ T1) & (src1 ^ T0)) & (1ULL << 63)) env->xcc |= PSR_OVF; -- cgit v1.2.3