qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/9] tcg: Add INDEX_op_extract2_{i32,i64}


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 2/9] tcg: Add INDEX_op_extract2_{i32,i64}
Date: Fri, 12 Apr 2019 22:31:15 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/3/19 1:56 AM, Peter Maydell wrote:
> On Wed, 3 Apr 2019 at 18:37, Richard Henderson
>> * extract2_i32/i64 dest, t1, t2, pos
>>
>> For N = {32,64}, extract an N-bit quantity from the concatenation
>> of t2:t1, beginning at pos.  The tcg_gen_extract2_* expander allows
>> values 0 <= pos <= N, but will expand 0 and N with mov, so only
>> 1 <= pos <= N-1 will be seen by the host tcg_out_op.
> 
> If I'm reading that correctly, it seems to be combining in one sentence
> the behaviour of the TCG API exposed to the front-end (pos can be
> between 0 and N inclusive) with a detail of the API that a backend
> needs to care about (that it can assume it never sees 0 or N).

You're not wrong.  ;-P

> I think we should be more careful to keep those separate, because
> a reader of this document is almost always going to care only about
> one or the other, never both at the same time. Perhaps things that
> apply only to the backend end of the interface should go in section 4
> of tcg/README?

Sadly, there's a lot of mix up on that count.

Indeed, the very next paragraph,

> * extrl_i64_i32 t0, t1
> 
> For 64-bit hosts only, extract the low 32-bits of input T1 and place it
> into 32-bit output T0.  Depending on the host, this may be a simple move,
> or may require additional canonicalization.

is entirely about the "section 4" opcode.  The "section 2" function,
tcg_gen_extrl_i64_i32, is expanded correctly for 32-bit hosts as a
simple move from the i32 "sub-temp" of the i64 temp.

Clearly the whole thing should be reorganized, but I'm not sure how best that
should be done.

> At any rate I think they should at least be in different sentences :-)

Now that I can do.  ;-)


r~



reply via email to

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