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~