From: Richard Henderson <rth@twiddle.net>
To: "Lluís Vilanova" <vilanova@ac.upc.edu>
Cc: "Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
qemu-devel@nongnu.org, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH v1 1/2] tcg: Add support for constant value promises
Date: Fri, 15 Jan 2016 12:26:28 -0800 [thread overview]
Message-ID: <569955F4.4000607@twiddle.net> (raw)
In-Reply-To: <87egdi1u1y.fsf@fimbulvetr.bsc.es>
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~
next prev parent reply other threads:[~2016-01-15 20:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 15:34 [Qemu-devel] [PATCH v1 0/2] tcg: Add support for constant value promises Lluís Vilanova
2016-01-15 15:35 ` [Qemu-devel] [PATCH v1 1/2] " Lluís Vilanova
2016-01-15 18:20 ` Richard Henderson
2016-01-15 20:12 ` Lluís Vilanova
2016-01-15 20:26 ` Richard Henderson [this message]
2016-01-16 20:57 ` Lluís Vilanova
2016-01-19 17:00 ` Edgar E. Iglesias
2016-01-19 21:17 ` Lluís Vilanova
2016-01-15 15:35 ` [Qemu-devel] [PATCH v1 2/2] gen-icount: Use " Lluís Vilanova
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=569955F4.4000607@twiddle.net \
--to=rth@twiddle.net \
--cc=edgar.iglesias@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=vilanova@ac.upc.edu \
/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).