qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/3] target-s390x: fix CC computation for LOAD POSITIVE instructions
@ 2015-05-18 13:39 Aurelien Jarno
  2015-05-18 13:39 ` [Qemu-devel] [PATCH 2/3] target-s390x: optimize (negative-) abs computation Aurelien Jarno
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Aurelien Jarno @ 2015-05-18 13:39 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Aurelien Jarno, Richard Henderson

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.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-s390x/cc_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-s390x/cc_helper.c b/target-s390x/cc_helper.c
index 00bc883..bfce3f1 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;
     }
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-18 17:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-18 13:39 [Qemu-devel] [PATCH 1/3] target-s390x: fix CC computation for LOAD POSITIVE instructions Aurelien Jarno
2015-05-18 13:39 ` [Qemu-devel] [PATCH 2/3] target-s390x: optimize (negative-) abs computation Aurelien Jarno
2015-05-18 15:42   ` Richard Henderson
2015-05-18 13:40 ` [Qemu-devel] [PATCH 3/3] target-s390x: remove unused helpers Aurelien Jarno
2015-05-18 15:42   ` Richard Henderson
2015-05-18 15:42 ` [Qemu-devel] [PATCH 1/3] target-s390x: fix CC computation for LOAD POSITIVE instructions Richard Henderson
2015-05-18 17:04 ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).