qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/4] tcg/i386: Remove unused registers from tcg_


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 2/4] tcg/i386: Remove unused registers from tcg_target_call_iarg_regs
Date: Thu, 13 Sep 2012 15:31:21 +0100

On 13 September 2012 06:50, Stefan Weil <address@hidden> wrote:
> Am 12.09.2012 23:18, schrieb Peter Maydell:
>> This makes the array zero-length for 32 bit targets, but functions
>> like tcg_out_tlb_load() and tcg_out_qemu_ld() still unconditionally
>> access elements in it...

> Thanks for the hint. I'm afraid there are a lot more functions
> of that kind in i386/tcg-target.c.
>
> I could use conditional compilation for those accesses,
> but first I'd like to understand why this works at all.

The functions in question are generating code that needs to
use some temporary registers. (As RTH says, this lines up with
the L constraint marking those registers as not usable for the
relevant TCG operands.) To avoid unnecessary register
copies in the old pre-commit-6a18ae2d register-based calling
convention, they are forcing those temporary registers to be
the same as some of the registers that were used for function
arguments.

Now we no longer use a register-based calling convention it
doesn't matter which registers we use as long as the functions
and the constraint definitions match up. The only tricky bit
will be that the 64-bit-target cases do still care about
using the same registers as are used for function  inputs.

-- PMM



reply via email to

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