qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value prom


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises
Date: Fri, 15 Jan 2016 12:26:28 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 01/15/2016 12:12 PM, Lluís Vilanova wrote:
> Richard Henderson writes:
> 
>> On 01/15/2016 07:35 AM, Lluís Vilanova wrote:
>>> +TCGv_i64 tcg_promise_i64(TCGv_promise_i64 *promise)
>>> +{
>>> +    int pi = tcg_ctx.gen_next_parm_idx;
>>> +    *promise = (TCGv_promise_i64)&tcg_ctx.gen_opparam_buf[pi];
>>> +    return tcg_const_i64(0xdeadcafe);
>>> +}
> 
>> This doesn't work for a 32-bit host.  The constant may be split across two
>> different parameter indices, and you don't know exactly where the second 
>> will be.
> 
>> Because of that, I think this is over-engineered, and really prefer the 
>> simpler
>> interface that Edgar posted last week.
> 
> In this case, 'tcg_set_promise_i64' sets the two arguments accordingly on 
> 32-bit
> targets. Both solutions depend on TCG internals (in this specific case the
> implementation of 'tcg_gen_movi_i64'), but now it's all implemented inside 
> TCG.
> 
> Alternatively, promises could use the longer route of recording the opcode 
> index
> (as Edgar did AFAIR), and retrieve the argument pointer from there. Still, for
> 32-bit targets we have to assume the two immediate moves are gonna generate 
> two
> consecutive opcodes.

Your solution also doesn't help Edgar, since he's interested in modifying an
argument to the insn_start opcode, not modifying a literal constant in a move.



r~



reply via email to

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