Received: from eggs.gnu.org ([208.118.235.92]:42514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URoMw-00067O-MT for qemu-devel@nongnu.org; Mon, 15 Apr 2013 14:43:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URoMt-0002WS-1y for qemu-devel@nongnu.org; Mon, 15 Apr 2013 14:43:10 -0400 Received: from mail-qe0-f43.google.com ([209.85.128.43]:40284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URoMs-0002WO-Tz for qemu-devel@nongnu.org; Mon, 15 Apr 2013 14:43:06 -0400 Received: by mail-qe0-f43.google.com with SMTP id f6so2907904qej.30 for ; Mon, 15 Apr 2013 11:43:06 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 15 Apr 2013 20:40:47 +0200 Message-Id: <1366051272-12979-9-git-send-email-rth@twiddle.net> In-Reply-To: <1366051272-12979-1-git-send-email-rth@twiddle.net> References: <1366051272-12979-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH v5 08/33] tcg-ppc64: Fix setcond_i32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: av1474@comtv.ru, aurelien@aurel32.net We weren't ignoring the high 32 bits during a NE comparison. Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- tcg/ppc64/tcg-target.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index b12cbec..822eb07 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -1129,6 +1129,12 @@ static void tcg_out_setcond (TCGContext *s, TCGType type, TCGCond cond, tcg_out32 (s, XOR | SAB (arg1, 0, arg2)); } + /* Make sure and discard the high 32-bits of the input. */ + if (type == TCG_TYPE_I32) { + tcg_out32(s, EXTSW | RA(TCG_REG_R0) | RS(arg)); + arg = TCG_REG_R0; + } + if (arg == arg1 && arg1 == arg0) { tcg_out32(s, ADDIC | TAI(0, arg, -1)); tcg_out32(s, SUBFE | TAB(arg0, 0, arg)); -- 1.8.1.4