[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: |
Lluís Vilanova |
Subject: |
Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises |
Date: |
Fri, 15 Jan 2016 21:12:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
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.
Thanks,
Lluis
[Qemu-devel] [PATCH v1 2/2] gen-icount: Use constant value promises, Lluís Vilanova, 2016/01/15