diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2015-05-18 15:39:58 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2015-06-05 01:37:57 +0200 |
commit | 2aaa1940684a3bf2b381fd2a8ff26c287a05109d (patch) | |
tree | ad7327d81507bfc874f51890710f33dc812cb593 /target-s390x | |
parent | ee0d0be16819896cc6c8018cbe171a632b61489c (diff) |
target-s390x: fix CC computation for LOAD POSITIVE instructions
LOAD POSITIVE instructions (LPR, LPGR and LPGFR) set the following
condition code:
0: Result zero; no overflow
1: --
2: Result greater than zero; no overflow
3: Overflow
The current code wrongly returns 1 instead of 2 in case of a result
greater than 0. This patches fixes that. This fixes the marshalling of
the value '0L' in Python.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-s390x')
-rw-r--r-- | target-s390x/cc_helper.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target-s390x/cc_helper.c b/target-s390x/cc_helper.c index 00bc883a8a..bfce3f1e60 100644 --- a/target-s390x/cc_helper.c +++ b/target-s390x/cc_helper.c @@ -195,7 +195,7 @@ static uint32_t cc_calc_abs_64(int64_t dst) if ((uint64_t)dst == 0x8000000000000000ULL) { return 3; } else if (dst) { - return 1; + return 2; } else { return 0; } @@ -296,7 +296,7 @@ static uint32_t cc_calc_abs_32(int32_t dst) if ((uint32_t)dst == 0x80000000UL) { return 3; } else if (dst) { - return 1; + return 2; } else { return 0; } |