From 4e4bb43899c4c97e14b59fbd7cd5cb44eea850a4 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 17 Aug 2012 18:52:33 -0700 Subject: target-s390: Convert ADD LOGICAL CARRY and SUBTRACT LOGICAL BORROW I'm resonably certain that the carry/borrow-out condition for both helpers was incorrect, failing to take into account the carry-in. Adding the new CC_OP codes also allows removing the awkward interface we used for the slb helpers. Signed-off-by: Richard Henderson --- target-s390x/int_helper.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'target-s390x/int_helper.c') diff --git a/target-s390x/int_helper.c b/target-s390x/int_helper.c index 4f18d29cd4..17c4771e41 100644 --- a/target-s390x/int_helper.c +++ b/target-s390x/int_helper.c @@ -107,49 +107,6 @@ int64_t HELPER(nabs_i64)(int64_t val) } } -/* add with carry 32-bit unsigned */ -uint32_t HELPER(addc_u32)(uint32_t cc, uint32_t v1, uint32_t v2) -{ - uint32_t res; - - res = v1 + v2; - if (cc & 2) { - res++; - } - - return res; -} - -/* subtract unsigned v2 from v1 with borrow */ -uint32_t HELPER(slb)(CPUS390XState *env, uint32_t cc, uint32_t r1, uint32_t v2) -{ - uint32_t v1 = env->regs[r1]; - uint32_t res = v1 + (~v2) + (cc >> 1); - - env->regs[r1] = (env->regs[r1] & 0xffffffff00000000ULL) | res; - if (cc & 2) { - /* borrow */ - return v1 ? 1 : 0; - } else { - return v1 ? 3 : 2; - } -} - -/* subtract unsigned v2 from v1 with borrow */ -uint32_t HELPER(slbg)(CPUS390XState *env, uint32_t cc, uint32_t r1, - uint64_t v1, uint64_t v2) -{ - uint64_t res = v1 + (~v2) + (cc >> 1); - - env->regs[r1] = res; - if (cc & 2) { - /* borrow */ - return v1 ? 1 : 0; - } else { - return v1 ? 3 : 2; - } -} - /* find leftmost one */ uint32_t HELPER(flogr)(CPUS390XState *env, uint32_t r1, uint64_t v2) { -- cgit v1.2.1