From patchwork Thu Sep 13 17:37:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 183687 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 39B562C0089 for ; Fri, 14 Sep 2012 03:38:17 +1000 (EST) Received: from localhost ([::1]:45092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCDMl-0007MP-0c for incoming@patchwork.ozlabs.org; Thu, 13 Sep 2012 13:38:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCDMU-00071h-HV for qemu-devel@nongnu.org; Thu, 13 Sep 2012 13:38:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCDMO-0008Qt-Ns for qemu-devel@nongnu.org; Thu, 13 Sep 2012 13:37:58 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:36240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCDMO-0008Qb-Hj for qemu-devel@nongnu.org; Thu, 13 Sep 2012 13:37:52 -0400 Received: from localhost (v220110690675601.yourvserver.net.local [127.0.0.1]) by v220110690675601.yourvserver.net (Postfix) with ESMTP id E06EF7280034; Thu, 13 Sep 2012 19:37:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at weilnetz.de Received: from v220110690675601.yourvserver.net ([127.0.0.1]) by localhost (v220110690675601.yourvserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TTunk3wkDKF3; Thu, 13 Sep 2012 19:37:51 +0200 (CEST) Received: by v220110690675601.yourvserver.net (Postfix, from userid 1000) id 887E87280035; Thu, 13 Sep 2012 19:37:51 +0200 (CEST) From: Stefan Weil To: Blue Swirl Date: Thu, 13 Sep 2012 19:37:45 +0200 Message-Id: <1347557866-7256-4-git-send-email-sw@weilnetz.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1347557866-7256-1-git-send-email-sw@weilnetz.de> References: <1347557866-7256-1-git-send-email-sw@weilnetz.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 78.47.199.172 Cc: Peter Maydell , Stefan Weil , Alexander Graf , qemu-devel@nongnu.org, Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH 3/4] tcg/i386: Remove unused registers from tcg_target_call_iarg_regs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 32 bit x86 hosts don't need registers for helper function arguments because they use the default stack based calling convention. Removing the registers allows simpler code for function tcg_target_get_call_iarg_regs_count. Signed-off-by: Stefan Weil Reviewed-by: Aurelien Jarno --- tcg/i386/tcg-target.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index ef63967..375d87d 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -75,9 +75,7 @@ static const int tcg_target_call_iarg_regs[] = { TCG_REG_R8, TCG_REG_R9, #else - TCG_REG_EAX, - TCG_REG_EDX, - TCG_REG_ECX + /* 32 bit mode uses stack based calling convention (GCC default). */ #endif }; @@ -127,11 +125,7 @@ static void patch_reloc(uint8_t *code_ptr, int type, /* maximum number of register used for input function arguments */ static inline int tcg_target_get_call_iarg_regs_count(int flags) { - if (TCG_TARGET_REG_BITS == 64) { - return ARRAY_SIZE(tcg_target_call_iarg_regs); - } - - return 0; + return ARRAY_SIZE(tcg_target_call_iarg_regs); } /* parse target specific constraints */