From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpmT5-0008O2-Fu for qemu-devel@nongnu.org; Tue, 05 May 2015 19:41:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpmT0-00075K-JW for qemu-devel@nongnu.org; Tue, 05 May 2015 19:41:39 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:36575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpmT0-00075E-EW for qemu-devel@nongnu.org; Tue, 05 May 2015 19:41:34 -0400 Received: by qku63 with SMTP id 63so117588468qku.3 for ; Tue, 05 May 2015 16:41:33 -0700 (PDT) Sender: Richard Henderson Message-ID: <5549552A.40600@twiddle.net> Date: Tue, 05 May 2015 16:41:30 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1429062341-59863-1-git-send-email-agraf@suse.de> In-Reply-To: <1429062341-59863-1-git-send-email-agraf@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] s390x: Fix stoc direction List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , qemu-devel@nongnu.org Cc: afaerber@suse.de On 04/14/2015 06:45 PM, Alexander Graf wrote: > 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 > --- > target-s390x/translate.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/target-s390x/translate.c b/target-s390x/translate.c > index 4f82edd..8ae4912 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); Doh. Reviewed-by: Richard Henderson r~