qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v10.5 02/20] tcg: Add types and basic operations


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v10.5 02/20] tcg: Add types and basic operations for host vectors
Date: Mon, 22 Jan 2018 12:02:39 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 01/22/2018 10:53 AM, Peter Maydell wrote:
>> +void tcg_gen_movi_v128(TCGv_vec r, uint64_t a, uint64_t b)
>> +{
>> +    TCGTemp *rt = tcgv_vec_temp(r);
>> +    TCGArg ri = temp_arg(rt);
>> +
>> +    tcg_debug_assert(rt->base_type == TCG_TYPE_V128);
>> +    if (a == b) {
>> +        tcg_gen_dup64i_vec(r, a);
>> +    } else if (TCG_TARGET_REG_BITS == 64) {
>> +        vec_gen_3(INDEX_op_movi_vec, TCG_TYPE_V128, 0, ri, a, b);
>> +    } else {
>> +        TCGOp *op = tcg_emit_op(INDEX_op_movi_vec);
>> +        TCGOP_VECL(op) = TCG_TYPE_V128 - TCG_TYPE_V64;
>> +        op->args[0] = ri;
>> +        op->args[1] = a;
>> +        op->args[2] = a >> 32;
>> +        op->args[3] = b;
>> +        op->args[4] = b >> 32;
> 
> Is it intentional that this doesn't set TCGOP_VECE(op) ?
> The vec_gen_* functions all do.
> 
> This seems like it ought to be a vec_gen_5().

It's not intentional.  That said, I had put this in for use by backends in
expanding operations, but they aren't used so far.  I should just remove them
for now.

>> +********* Host vector operations
>> +
>> +All of the vector ops have two parameters, TCGOP_VECL & TCGOP_VECE.
>> +The former specifies the length of the vector in log2 64-bit units; the
>> +later specifies the length of the element (if applicable) in log2 8-bit 
>> units.
>> +E.g. VECL=1 -> 64 << 1 -> v128, and VECE=2 -> 1 << 2 -> i32.
> 
> ...but at the tcg_gen_and_vec() function level, the functions
> take a parameter for VECE but not one for VECL ? That's a bit
> confusing. (I think this is perhaps an example of the awkwardness of
> our documenting the TCG interface only at an abstract "ops" level
> and not documenting the concrete function APIs at all.)

For the functions, VECL is taken from the type of the TCGv_vec operands.

But, yes, README is for the ops only...



r~



reply via email to

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