qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 1/3] s390x: Fix stoc direction


From: Alexander Graf
Subject: [Qemu-devel] [PULL 1/3] s390x: Fix stoc direction
Date: Wed, 13 May 2015 14:50:17 +0200

The store conditional instruction wants to store when the condition
is fulfilled, so we should branch out when it's not true.

The code today branches out when the condition is true, clearly
reversing the logic. Fix it up by negating the condition.

Signed-off-by: Alexander Graf <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
---
 target-s390x/translate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index 8784112..fa3e334 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -3082,6 +3082,10 @@ static ExitStatus op_soc(DisasContext *s, DisasOps *o)
 
     disas_jcc(s, &c, get_field(s->fields, m3));
 
+    /* We want to store when the condition is fulfilled, so branch
+       out when it's not */
+    c.cond = tcg_invert_cond(c.cond);
+
     lab = gen_new_label();
     if (c.is_64) {
         tcg_gen_brcond_i64(c.cond, c.u.s64.a, c.u.s64.b, lab);
-- 
1.7.12.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]