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~