From: Alexander Graf Date: Wed, 15 Apr 2015 01:45:41 +0000 (+0200) Subject: s390x: Fix stoc direction X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~197^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c095ed731ce4fecf166e4ac02ddc606b408f5e1f;p=sdk%2Femulator%2Fqemu.git s390x: Fix stoc direction 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 Reviewed-by: Richard Henderson --- 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);