From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
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 [thread overview]
Message-ID: <21d81fa8-8bcf-f492-ce4f-52bf9cfed88e@linaro.org> (raw)
In-Reply-To: <CAFEAcA-R0XrQrLRAt5XQtOki0jk1qFnPuBQsf7a5xh2MX37usA@mail.gmail.com>
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~
next prev parent reply other threads:[~2018-01-22 20:02 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 16:14 [Qemu-devel] [PATCH v10.5 00/20] tcg: generic vector operations Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 01/20] tcg: Allow multiple word entries into the constant pool Richard Henderson
2018-01-22 18:35 ` Peter Maydell
2018-01-22 19:15 ` Alex Bennée
2018-01-22 19:56 ` Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 02/20] tcg: Add types and basic operations for host vectors Richard Henderson
2018-01-22 18:53 ` Peter Maydell
2018-01-22 20:02 ` Richard Henderson [this message]
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 03/20] tcg: Standardize integral arguments to expanders Richard Henderson
2018-01-22 19:17 ` Peter Maydell
2018-01-22 20:04 ` Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 04/20] tcg: Add generic vector expanders Richard Henderson
2018-01-26 12:17 ` Alex Bennée
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 05/20] tcg: Add generic vector ops for constant shifts Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 06/20] tcg: Add generic vector ops for comparisons Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 07/20] tcg: Add generic vector ops for multiplication Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 08/20] tcg: Add generic helpers for saturating arithmetic Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 09/20] tcg: Add generic vector helpers with a scalar operand Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 10/20] tcg/optimize: Handle vector opcodes during optimize Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 11/20] target/arm: Align vector registers Richard Henderson
2018-01-26 9:52 ` Alex Bennée
2018-01-26 16:43 ` Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 12/20] target/arm: Use vector infrastructure for aa64 add/sub/logic Richard Henderson
2018-01-25 16:44 ` Peter Maydell
2018-01-25 17:06 ` Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 13/20] target/arm: Use vector infrastructure for aa64 mov/not/neg Richard Henderson
2018-01-25 16:46 ` Peter Maydell
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 14/20] target/arm: Use vector infrastructure for aa64 dup/movi Richard Henderson
2018-01-25 16:50 ` Peter Maydell
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 15/20] target/arm: Use vector infrastructure for aa64 constant shifts Richard Henderson
2018-01-25 17:03 ` Peter Maydell
2018-01-25 17:14 ` Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 16/20] target/arm: Use vector infrastructure for aa64 compares Richard Henderson
2018-01-25 17:16 ` Peter Maydell
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 17/20] target/arm: Use vector infrastructure for aa64 multiplies Richard Henderson
2018-01-25 17:23 ` Peter Maydell
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 18/20] target/arm: Use vector infrastructure for aa64 orr/bic immediate Richard Henderson
2018-01-25 17:24 ` Peter Maydell
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 19/20] tcg/i386: Add vector operations Richard Henderson
2018-01-17 16:14 ` [Qemu-devel] [PATCH v10.5 20/20] tcg/aarch64: " Richard Henderson
2018-01-17 17:14 ` [Qemu-devel] [PATCH v10.5 00/20] tcg: generic " no-reply
2018-01-25 17:28 ` Peter Maydell
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=21d81fa8-8bcf-f492-ce4f-52bf9cfed88e@linaro.org \
--to=richard.henderson@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).