From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WftBF-0004rt-Cm for qemu-devel@nongnu.org; Thu, 01 May 2014 11:45:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WftB9-0006sY-EK for qemu-devel@nongnu.org; Thu, 01 May 2014 11:45:49 -0400 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:60837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WftB9-0006sS-9j for qemu-devel@nongnu.org; Thu, 01 May 2014 11:45:43 -0400 Received: by mail-qg0-f50.google.com with SMTP id 63so3399221qgz.23 for ; Thu, 01 May 2014 08:45:42 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Thu, 1 May 2014 08:44:35 -0700 Message-Id: <1398959087-23590-15-git-send-email-rth@twiddle.net> In-Reply-To: <1398959087-23590-1-git-send-email-rth@twiddle.net> References: <1398959087-23590-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 14/26] tcg-ppc64: Fix sub2 implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: av1474@comtv.ru All sorts of confusion on argument ordering. Signed-off-by: Richard Henderson --- tcg/ppc64/tcg-target.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index 8d932eb..22cfa1e 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -2009,18 +2009,18 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, case INDEX_op_sub2_i64: a0 = args[0], a1 = args[1]; - if (a0 == args[5] || (!const_args[4] && a0 == args[4])) { + if (a0 == args[5] || (!const_args[3] && a0 == args[3])) { a0 = TCG_REG_R0; } if (const_args[2]) { - tcg_out32(s, SUBFIC | TAI(a0, args[3], args[2])); + tcg_out32(s, SUBFIC | TAI(a0, args[4], args[2])); } else { - tcg_out32(s, SUBFC | TAB(a0, args[3], args[2])); + tcg_out32(s, SUBFC | TAB(a0, args[4], args[2])); } - if (const_args[4]) { - tcg_out32(s, (args[4] ? SUBFME : SUBFZE) | RT(a1) | RA(args[5])); + if (const_args[3]) { + tcg_out32(s, (args[3] ? SUBFME : SUBFZE) | RT(a1) | RA(args[5])); } else { - tcg_out32(s, SUBFE | TAB(a1, args[5], args[4])); + tcg_out32(s, SUBFE | TAB(a1, args[5], args[3])); } if (a0 != args[0]) { tcg_out_mov(s, TCG_TYPE_REG, args[0], a0); @@ -2146,7 +2146,7 @@ static const TCGTargetOpDef ppc_op_defs[] = { { INDEX_op_deposit_i64, { "r", "0", "rZ" } }, { INDEX_op_add2_i64, { "r", "r", "r", "r", "rI", "rZM" } }, - { INDEX_op_sub2_i64, { "r", "r", "rI", "r", "rZM", "r" } }, + { INDEX_op_sub2_i64, { "r", "r", "rI", "rZM", "r", "r" } }, { INDEX_op_mulsh_i64, { "r", "r", "r" } }, { INDEX_op_muluh_i64, { "r", "r", "r" } }, -- 1.9.0