From patchwork Fri May 21 15:30:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 53176 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 918FEB7D19 for ; Sat, 22 May 2010 01:46:29 +1000 (EST) Received: from localhost ([127.0.0.1]:56414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFUQc-0003Co-Ma for incoming@patchwork.ozlabs.org; Fri, 21 May 2010 11:46:26 -0400 Received: from [140.186.70.92] (port=53193 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFUBg-0000yU-Ad for qemu-devel@nongnu.org; Fri, 21 May 2010 11:31:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFUBd-0003Nh-1i for qemu-devel@nongnu.org; Fri, 21 May 2010 11:31:00 -0400 Received: from are.twiddle.net ([75.149.56.221]:52885) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFUBb-0003NM-DI for qemu-devel@nongnu.org; Fri, 21 May 2010 11:30:56 -0400 Received: from anchor.twiddle.home (anchor.twiddle.home [172.31.0.4]) by are.twiddle.net (Postfix) with ESMTPS id D49ABE43; Fri, 21 May 2010 08:30:54 -0700 (PDT) Received: from anchor.twiddle.home (anchor.twiddle.home [127.0.0.1]) by anchor.twiddle.home (8.14.4/8.14.4) with ESMTP id o4LFUsVm018078; Fri, 21 May 2010 08:30:54 -0700 Received: (from rth@localhost) by anchor.twiddle.home (8.14.4/8.14.4/Submit) id o4LFUrok018077; Fri, 21 May 2010 08:30:53 -0700 From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 21 May 2010 08:30:32 -0700 Message-Id: <9e280bc14cf233e9d7ed374cebe9e34f46144450.1274455112.git.rth@twiddle.net> X-Mailer: git-send-email 1.7.0.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 12/15] 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 8eb88da..09a56e8 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -192,6 +192,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) @@ -770,7 +771,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);