From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC21u-0003or-6H for qemu-devel@nongnu.org; Thu, 13 Sep 2012 01:31:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TC21s-0005y2-Vo for qemu-devel@nongnu.org; Thu, 13 Sep 2012 01:31:58 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:60689) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TC21s-0005xw-PD for qemu-devel@nongnu.org; Thu, 13 Sep 2012 01:31:56 -0400 Message-ID: <50516FC9.3000102@weilnetz.de> Date: Thu, 13 Sep 2012 07:31:53 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1347482678-9458-1-git-send-email-sw@weilnetz.de> <1347482678-9458-4-git-send-email-sw@weilnetz.de> <20120912205949.GJ6024@ohm.aurel32.net> In-Reply-To: <20120912205949.GJ6024@ohm.aurel32.net> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/4] tcg: Move tcg_target_get_call_iarg_regs_count to tcg.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: Blue Swirl , Peter Maydell , Richard Henderson , Alexander Graf , qemu-devel@nongnu.org Am 12.09.2012 22:59, schrieb Aurelien Jarno: > On Wed, Sep 12, 2012 at 10:44:37PM +0200, Stefan Weil wrote: >> The TCG targets no longer need individual implementations. >> >> Signed-off-by: Stefan Weil >> --- >> tcg/arm/tcg-target.c | 6 ------ >> tcg/hppa/tcg-target.c | 6 ------ >> tcg/i386/tcg-target.c | 6 ------ >> tcg/ia64/tcg-target.c | 6 ------ >> tcg/mips/tcg-target.c | 6 ------ >> tcg/ppc/tcg-target.c | 6 ------ >> tcg/ppc64/tcg-target.c | 6 ------ >> tcg/s390/tcg-target.c | 5 ----- >> tcg/sparc/tcg-target.c | 6 ------ >> tcg/tcg.c | 7 ++++++- >> tcg/tci/tcg-target.c | 6 ------ >> 11 files changed, 6 insertions(+), 60 deletions(-) >> >> [...] >> diff --git a/tcg/tcg.c b/tcg/tcg.c >> index a4e7f42..53316f6 100644 >> --- a/tcg/tcg.c >> +++ b/tcg/tcg.c >> @@ -89,7 +89,6 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg, TCGReg arg1, >> tcg_target_long arg2); >> static int tcg_target_const_match(tcg_target_long val, >> const TCGArgConstraint *arg_ct); >> -static int tcg_target_get_call_iarg_regs_count(int flags); >> >> TCGOpDef tcg_op_defs[] = { >> #define DEF(s, oargs, iargs, cargs, flags) { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags }, >> @@ -182,6 +181,12 @@ int gen_new_label(void) >> >> #include "tcg-target.c" >> >> +/* Maximum number of register used for input function arguments. */ >> +static inline int tcg_target_get_call_iarg_regs_count(int flags) >> +{ >> + return ARRAY_SIZE(tcg_target_call_iarg_regs); >> +} >> + > Do we really need a function for that, given that it has only one > caller? > > For me ARRAY_SIZE(tcg_target_call_iarg_regs) is even more understandable > than tcg_target_get_call_iarg_regs_count(). > I agree. tcg_target_get_call_iarg_regs_count can be removed completely, but only if we find a solution for the problem which Peter Maydell found: some code accesses tcg_target_call_iarg_regs unconditionally even for x86 32 bit, so for the moment, we cannot reduce its size to 0. Stefan