qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Aurelien Jarno <aurelien@aurel32.net>
Cc: Blue Swirl <blauwirbel@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <rth@twiddle.net>,
	Alexander Graf <agraf@suse.de>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] tcg: Move tcg_target_get_call_iarg_regs_count to tcg.c
Date: Thu, 13 Sep 2012 07:31:53 +0200	[thread overview]
Message-ID: <50516FC9.3000102@weilnetz.de> (raw)
In-Reply-To: <20120912205949.GJ6024@ohm.aurel32.net>

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 <sw@weilnetz.de>
>> ---
>>   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

  reply	other threads:[~2012-09-13  5:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12 20:44 [Qemu-devel] [PATCH 0/4] Fix and clean tcg_target_get_call_iarg_regs_count Stefan Weil
2012-09-12 20:44 ` [Qemu-devel] [PATCH 1/4] w64: Fix TCG helper functions with 5 arguments Stefan Weil
2012-09-12 20:44 ` [Qemu-devel] [PATCH 2/4] tcg/i386: Remove unused registers from tcg_target_call_iarg_regs Stefan Weil
2012-09-12 21:18   ` Peter Maydell
2012-09-13  5:50     ` Stefan Weil
2012-09-13 14:19       ` Richard Henderson
2012-09-13 14:31       ` Peter Maydell
2012-09-12 20:44 ` [Qemu-devel] [PATCH 3/4] tcg: Move tcg_target_get_call_iarg_regs_count to tcg.c Stefan Weil
2012-09-12 20:59   ` Aurelien Jarno
2012-09-13  5:31     ` Stefan Weil [this message]
2012-09-12 20:44 ` [Qemu-devel] [PATCH 4/4] tcg: Remove unused parameter from tcg_target_get_call_iarg_regs_count Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50516FC9.3000102@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=blauwirbel@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).