From patchwork Wed Apr 14 18:32:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 50195 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DF79BB7D2F for ; Thu, 15 Apr 2010 07:22:29 +1000 (EST) Received: from localhost ([127.0.0.1]:58031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2A2T-0006mQ-Vd for incoming@patchwork.ozlabs.org; Wed, 14 Apr 2010 17:22:26 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O29Xe-00051V-La for qemu-devel@nongnu.org; Wed, 14 Apr 2010 16:50:34 -0400 Received: from [140.186.70.92] (port=35667 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O29XW-0004r9-Fc for qemu-devel@nongnu.org; Wed, 14 Apr 2010 16:50:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O29XR-0001W5-0t for qemu-devel@nongnu.org; Wed, 14 Apr 2010 16:50:26 -0400 Received: from are.twiddle.net ([75.149.56.221]:41969) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O29XQ-0001Vo-LA for qemu-devel@nongnu.org; Wed, 14 Apr 2010 16:50:20 -0400 Received: by are.twiddle.net (Postfix, from userid 5000) id 1FA5CA61; Wed, 14 Apr 2010 13:50:20 -0700 (PDT) Message-Id: In-Reply-To: References: From: Richard Henderson Date: Wed, 14 Apr 2010 11:32:24 -0700 To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 19/21] tcg-i386: Tidy xchg. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Define and use OPC_XCHG_ax_r32. Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index b806d18..d8367b0 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -197,6 +197,7 @@ static inline int tcg_target_const_match(tcg_target_long val, #define OPC_SHIFT_Ib (0xc1) #define OPC_SHIFT_cl (0xd3) #define OPC_TESTL (0x85) +#define OPC_XCHG_ax_r32 (0x90) #define OPC_GRP3_Ev (0xf7) #define OPC_GRP5 (0xff) @@ -796,7 +797,8 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, break; case 3: if (data_reg == TCG_REG_EDX) { - tcg_out_opc(s, 0x90 + TCG_REG_EDX); /* xchg %edx, %eax */ + /* xchg %edx, %eax */ + tcg_out_opc(s, OPC_XCHG_ax_r32 + TCG_REG_EDX); tcg_out_mov(s, data_reg2, TCG_REG_EAX); } else { tcg_out_mov(s, data_reg, TCG_REG_EAX);