qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] w64: Fix calls of TCG helper functions with 5 a


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH] w64: Fix calls of TCG helper functions with 5 arguments
Date: Fri, 14 Sep 2012 17:44:35 +0000

On Wed, Sep 12, 2012 at 7:39 PM, Stefan Weil <address@hidden> wrote:
> Am 12.09.2012 21:14, schrieb Aurelien Jarno:
>
>> On Wed, Sep 12, 2012 at 07:12:47PM +0100, Peter Maydell wrote:
>>>
>>> On 12 September 2012 19:03, Stefan Weil<address@hidden>  wrote:
>>>>
>>>> diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c
>>>> index da17bba..43b5572 100644
>>>> --- a/tcg/i386/tcg-target.c
>>>> +++ b/tcg/i386/tcg-target.c
>>>> @@ -118,7 +118,7 @@ static void patch_reloc(uint8_t *code_ptr, int type,
>>>>   static inline int tcg_target_get_call_iarg_regs_count(int flags)
>>>>   {
>>>>       if (TCG_TARGET_REG_BITS == 64) {
>>>> -        return 6;
>>>> +        return ARRAY_SIZE(tcg_target_call_iarg_regs);
>>>>       }
>>>>
>>>>       return 0;
>>>
>>>
>>> Hmm. Why can't we just return the array size in all cases?
>>> Is there something special about 32 bit x86? I checked, and
>>> all our other TCG targets return the same value as the size of
>>> the iarg_regs array (either using ARRAY_SIZE or by just returning
>>> the right number)...
>>>
>>
>> On 32-bit x86, all arguments are now being passed on the stack, that's
>> why the function returns 0. On the other hand when the change has been
>> done, the registers haven't been removed from tcg_target_call_iarg_regs.
>>
>> I think this patch is fine enough for 1.2, but a better patch is needed
>> for master.
>
>
> I noticed that Blue switched from register arguments to
> arguments on the stack, but don't know the reason for that
> change.

When doing the AREG0 conversion, it was already difficult to get one
way of passing arguments to work, never mind supporting both register
arguments in addition to stack.

>
> Maybe 32 bit x86 can also use a mixture of register / stack
> arguments. This needs more testing and is the main reason
> why I did not change tcg_target_call_iarg_regs for 32 bit
> and return ARRAY_SIZE for both 32 and 64 bit.

After AREG0 conversion has been finished, it should be possible to
restore register argument passing, if this gives better performance.
All files in QEMU should be compiled with the same flags then, there
should be no need to introduce any REGPARM attributes anymore.

>
> I'd prefer to get the patch in master soon because it is
> a minimalistic change which fixes the now unusable
> 64 bit mode on Windows. An additional patch can still
> be applied on top.
>
> Of course any better patch which also fixes 64 bit Windows
> and which comes soon would also be very acceptable.
>
> Regards
>
> Stefan
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]