From patchwork Wed Apr 14 18:29:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 50199 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 7D687B7D2F for ; Thu, 15 Apr 2010 07:29:11 +1000 (EST) Received: from localhost ([127.0.0.1]:58757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2A8x-0000lw-K3 for incoming@patchwork.ozlabs.org; Wed, 14 Apr 2010 17:29:07 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O29Xg-00053i-01 for qemu-devel@nongnu.org; Wed, 14 Apr 2010 16:50:36 -0400 Received: from [140.186.70.92] (port=35722 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O29Xa-0004vD-8g for qemu-devel@nongnu.org; Wed, 14 Apr 2010 16:50:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O29XP-0001VV-Q8 for qemu-devel@nongnu.org; Wed, 14 Apr 2010 16:50:30 -0400 Received: from are.twiddle.net ([75.149.56.221]:41968) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O29XP-0001V9-Ju for qemu-devel@nongnu.org; Wed, 14 Apr 2010 16:50:19 -0400 Received: by are.twiddle.net (Postfix, from userid 5000) id 13A96EC6; Wed, 14 Apr 2010 13:50:19 -0700 (PDT) Message-Id: In-Reply-To: References: From: Richard Henderson Date: Wed, 14 Apr 2010 11:29:31 -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 18/21] tcg-i386: Tidy multiply. 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_IMUL_GvEv{,Ib,Iz}. Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index 484e789..b806d18 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -184,6 +184,9 @@ static inline int tcg_target_const_match(tcg_target_long val, #define OPC_MOVZWL (0xb7 | P_EXT) #define OPC_MOVSBL (0xbe | P_EXT) #define OPC_MOVSWL (0xbf | P_EXT) +#define OPC_IMUL_GvEv (0xaf | P_EXT) +#define OPC_IMUL_GvEvIb (0x6b) +#define OPC_IMUL_GvEvIz (0x69) #define OPC_POP_r32 (0x58) #define OPC_PUSH_r32 (0x50) #define OPC_PUSH_Iv (0x68) @@ -1181,14 +1184,14 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, int32_t val; val = args[2]; if (val == (int8_t)val) { - tcg_out_modrm(s, 0x6b, args[0], args[0]); + tcg_out_modrm(s, OPC_IMUL_GvEvIb, args[0], args[0]); tcg_out8(s, val); } else { - tcg_out_modrm(s, 0x69, args[0], args[0]); + tcg_out_modrm(s, OPC_IMUL_GvEvIz, args[0], args[0]); tcg_out32(s, val); } } else { - tcg_out_modrm(s, 0xaf | P_EXT, args[0], args[2]); + tcg_out_modrm(s, OPC_IMUL_GvEv, args[0], args[2]); } break; case INDEX_op_mulu2_i32: