diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-13 20:45:31 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-13 20:45:31 +0000 |
commit | dc99a3f2e856e6d2c2142538b756eb72de0af51a (patch) | |
tree | 1196a9a1ad861a2ea4e7bd9b4b1d5014764c6e1e /target-sparc/op.c | |
parent | 02cb1585fdf732f2b776c079f736028520aab4f4 (diff) |
Convert condition code changing versions of add, sub, logic, and div to TCG
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4052 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sparc/op.c')
-rw-r--r-- | target-sparc/op.c | 433 |
1 files changed, 0 insertions, 433 deletions
diff --git a/target-sparc/op.c b/target-sparc/op.c index e57a60d357..0c3e0902e6 100644 --- a/target-sparc/op.c +++ b/target-sparc/op.c @@ -171,389 +171,6 @@ #define FLAG_SET(x) ((env->psr&x)?1:0) -void OPPROTO op_add_T1_T0_cc(void) -{ - target_ulong src1; - - src1 = T0; - T0 += T1; - env->psr = 0; -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if ((T0 & 0xffffffff) < (src1 & 0xffffffff)) - env->psr |= PSR_CARRY; - if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) & - ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) - env->psr |= PSR_OVF; - - env->xcc = 0; - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; - if (T0 < src1) - env->xcc |= PSR_CARRY; - if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1ULL << 63)) - env->xcc |= PSR_OVF; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (T0 < src1) - env->psr |= PSR_CARRY; - if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31)) - env->psr |= PSR_OVF; -#endif - FORCE_RET(); -} - -void OPPROTO op_addx_T1_T0_cc(void) -{ - target_ulong src1; - src1 = T0; - if (FLAG_SET(PSR_CARRY)) - { - T0 += T1 + 1; - env->psr = 0; -#ifdef TARGET_SPARC64 - if ((T0 & 0xffffffff) <= (src1 & 0xffffffff)) - env->psr |= PSR_CARRY; - env->xcc = 0; - if (T0 <= src1) - env->xcc |= PSR_CARRY; -#else - if (T0 <= src1) - env->psr |= PSR_CARRY; -#endif - } - else - { - T0 += T1; - env->psr = 0; -#ifdef TARGET_SPARC64 - if ((T0 & 0xffffffff) < (src1 & 0xffffffff)) - env->psr |= PSR_CARRY; - env->xcc = 0; - if (T0 < src1) - env->xcc |= PSR_CARRY; -#else - if (T0 < src1) - env->psr |= PSR_CARRY; -#endif - } -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) & - ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) - env->psr |= PSR_OVF; - - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; - if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1ULL << 63)) - env->xcc |= PSR_OVF; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31)) - env->psr |= PSR_OVF; -#endif - FORCE_RET(); -} - -void OPPROTO op_tadd_T1_T0_cc(void) -{ - target_ulong src1; - - src1 = T0; - T0 += T1; - env->psr = 0; -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if ((T0 & 0xffffffff) < (src1 & 0xffffffff)) - env->psr |= PSR_CARRY; - if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) & - ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) - env->psr |= PSR_OVF; - if ((src1 & 0x03) || (T1 & 0x03)) - env->psr |= PSR_OVF; - - env->xcc = 0; - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; - if (T0 < src1) - env->xcc |= PSR_CARRY; - if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1ULL << 63)) - env->xcc |= PSR_OVF; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (T0 < src1) - env->psr |= PSR_CARRY; - if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31)) - env->psr |= PSR_OVF; - if ((src1 & 0x03) || (T1 & 0x03)) - env->psr |= PSR_OVF; -#endif - FORCE_RET(); -} - -void OPPROTO op_tadd_T1_T0_ccTV(void) -{ - target_ulong src1; - - if ((T0 & 0x03) || (T1 & 0x03)) { - raise_exception(TT_TOVF); - FORCE_RET(); - return; - } - - src1 = T0; - T0 += T1; - -#ifdef TARGET_SPARC64 - if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff) ^ -1) & - ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) - raise_exception(TT_TOVF); -#else - if (((src1 ^ T1 ^ -1) & (src1 ^ T0)) & (1 << 31)) - raise_exception(TT_TOVF); -#endif - - env->psr = 0; -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if ((T0 & 0xffffffff) < (src1 & 0xffffffff)) - env->psr |= PSR_CARRY; - - env->xcc = 0; - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; - if (T0 < src1) - env->xcc |= PSR_CARRY; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (T0 < src1) - env->psr |= PSR_CARRY; -#endif - FORCE_RET(); -} - -void OPPROTO op_sub_T1_T0_cc(void) -{ - target_ulong src1; - - src1 = T0; - T0 -= T1; - env->psr = 0; -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if ((src1 & 0xffffffff) < (T1 & 0xffffffff)) - env->psr |= PSR_CARRY; - if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff)) & - ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) - env->psr |= PSR_OVF; - - env->xcc = 0; - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; - if (src1 < T1) - env->xcc |= PSR_CARRY; - if (((src1 ^ T1) & (src1 ^ T0)) & (1ULL << 63)) - env->xcc |= PSR_OVF; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (src1 < T1) - env->psr |= PSR_CARRY; - if (((src1 ^ T1) & (src1 ^ T0)) & (1 << 31)) - env->psr |= PSR_OVF; -#endif - FORCE_RET(); -} - -void OPPROTO op_subx_T1_T0_cc(void) -{ - target_ulong src1; - src1 = T0; - if (FLAG_SET(PSR_CARRY)) - { - T0 -= T1 + 1; - env->psr = 0; -#ifdef TARGET_SPARC64 - if ((src1 & 0xffffffff) <= (T1 & 0xffffffff)) - env->psr |= PSR_CARRY; - env->xcc = 0; - if (src1 <= T1) - env->xcc |= PSR_CARRY; -#else - if (src1 <= T1) - env->psr |= PSR_CARRY; -#endif - } - else - { - T0 -= T1; - env->psr = 0; -#ifdef TARGET_SPARC64 - if ((src1 & 0xffffffff) < (T1 & 0xffffffff)) - env->psr |= PSR_CARRY; - env->xcc = 0; - if (src1 < T1) - env->xcc |= PSR_CARRY; -#else - if (src1 < T1) - env->psr |= PSR_CARRY; -#endif - } -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff)) & - ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) - env->psr |= PSR_OVF; - - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; - if (((src1 ^ T1) & (src1 ^ T0)) & (1ULL << 63)) - env->xcc |= PSR_OVF; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (((src1 ^ T1) & (src1 ^ T0)) & (1 << 31)) - env->psr |= PSR_OVF; -#endif - FORCE_RET(); -} - -void OPPROTO op_tsub_T1_T0_cc(void) -{ - target_ulong src1; - - src1 = T0; - T0 -= T1; - env->psr = 0; -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if ((src1 & 0xffffffff) < (T1 & 0xffffffff)) - env->psr |= PSR_CARRY; - if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff)) & - ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) - env->psr |= PSR_OVF; - if ((src1 & 0x03) || (T1 & 0x03)) - env->psr |= PSR_OVF; - - env->xcc = 0; - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; - if (src1 < T1) - env->xcc |= PSR_CARRY; - if (((src1 ^ T1) & (src1 ^ T0)) & (1ULL << 63)) - env->xcc |= PSR_OVF; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (src1 < T1) - env->psr |= PSR_CARRY; - if (((src1 ^ T1) & (src1 ^ T0)) & (1 << 31)) - env->psr |= PSR_OVF; - if ((src1 & 0x03) || (T1 & 0x03)) - env->psr |= PSR_OVF; -#endif - FORCE_RET(); -} - -void OPPROTO op_tsub_T1_T0_ccTV(void) -{ - target_ulong src1; - - if ((T0 & 0x03) || (T1 & 0x03)) - raise_exception(TT_TOVF); - - src1 = T0; - T0 -= T1; - -#ifdef TARGET_SPARC64 - if ((((src1 & 0xffffffff) ^ (T1 & 0xffffffff)) & - ((src1 & 0xffffffff) ^ (T0 & 0xffffffff))) & (1 << 31)) - raise_exception(TT_TOVF); -#else - if (((src1 ^ T1) & (src1 ^ T0)) & (1 << 31)) - raise_exception(TT_TOVF); -#endif - - env->psr = 0; -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if ((src1 & 0xffffffff) < (T1 & 0xffffffff)) - env->psr |= PSR_CARRY; - - env->xcc = 0; - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; - if (src1 < T1) - env->xcc |= PSR_CARRY; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (src1 < T1) - env->psr |= PSR_CARRY; -#endif - FORCE_RET(); -} - void OPPROTO op_umul_T1_T0(void) { uint64_t res; @@ -652,33 +269,6 @@ void OPPROTO op_sdiv_T1_T0(void) FORCE_RET(); } -void OPPROTO op_div_cc(void) -{ - env->psr = 0; -#ifdef TARGET_SPARC64 - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (T1) - env->psr |= PSR_OVF; - - env->xcc = 0; - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - if (T1) - env->psr |= PSR_OVF; -#endif - FORCE_RET(); -} - #ifdef TARGET_SPARC64 void OPPROTO op_udivx_T1_T0(void) { @@ -702,29 +292,6 @@ void OPPROTO op_sdivx_T1_T0(void) } #endif -void OPPROTO op_logic_T0_cc(void) -{ - env->psr = 0; -#ifdef TARGET_SPARC64 - if (!(T0 & 0xffffffff)) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; - - env->xcc = 0; - if (!T0) - env->xcc |= PSR_ZERO; - if ((int64_t) T0 < 0) - env->xcc |= PSR_NEG; -#else - if (!T0) - env->psr |= PSR_ZERO; - if ((int32_t) T0 < 0) - env->psr |= PSR_NEG; -#endif - FORCE_RET(); -} - /* Load and store */ #define MEMSUFFIX _raw #include "op_mem.h" |