[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 4/8] target/ppc: add vmulld instruction
From: |
Richard Henderson |
Subject: |
Re: [PATCH v3 4/8] target/ppc: add vmulld instruction |
Date: |
Thu, 25 Jun 2020 20:52:13 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
On 6/25/20 2:13 PM, Lijun Pan wrote:
>>> case INDEX_op_mul_vec:
>>> - tcg_debug_assert(vece == MO_32 && have_isa_2_07);
>>> - insn = VMULUWM;
>>> + tcg_debug_assert((vece == MO_32 && have_isa_2_07) ||
>>> + (vece == MO_64 && have_isa_3_10));
>>> + insn = mul_op[vece];
>>
>> I think it would be ok to just index mul_op here, since the real isa check is
>> to be done elsewhere.
>
> Just keep "insn = mul_op[vece];"
> and remove" tcg_debug_assert((vece == MO_32 && have_isa_2_07) ||
> (vece == MO_64 && have_isa_3_10));“?
Yes.
> @@ -3016,6 +3016,8 @@int tcg_can_emit_vec_op(TCGOpcode opc, TCGType type,
> unsigned vece)
> return -1;
> case MO_32:
> return have_isa_2_07 ? 1 : -1;
> + case MO_64:
> + return have_isa_3_10 ? 1 : -1;
> }
Actually, just "return have_isa_3_10".
Returning 1 means that the opcode is supported directly. Returning -1 means
that the opcode can be expanded by tcg_expand_vec_op. Returning 0 means that
the tcg backend does not support the opcode at all.
> something like below?
> @@ -3712,6 +3712,11 @@static void tcg_target_init(TCGContext *s)
> have_isa = tcg_isa_3_00;
> }
> #endif
> +#ifdef PPC_FEATURE2_ARCH_3_10
> + if (hwcap2 & PPC_FEATURE2_ARCH_3_10) {
> + have_isa = tcg_isa_3_10;
> + }
> +#endif
Certainly this.
> @@ -554,6 +554,7 @@typedef struct {
> #define PPC_FEATURE2_HTM_NOSC 0x01000000
> #define PPC_FEATURE2_ARCH_3_00 0x00800000
> #define PPC_FEATURE2_HAS_IEEE128 0x00400000
> +#define PPC_FEATURE2_ARCH_3_10 0x00200000
Of this I'm not sure. I didn't even realize these defines were here in
include/elf.h. For other tcg backends we get the defines from <sys/auxv.h>.
If we do want to update include/elf.h, it should be a separate patch. CC'ing
Laurent for this.
r~
[PATCH v3 2/8] target/ppc: add byte-reverse br[dwh] instructions, Lijun Pan, 2020/06/25
[PATCH v3 5/8] target/ppc: add vmulh{su}w instructions, Lijun Pan, 2020/06/25
[PATCH v3 6/8] fix the prototype of muls64/mulu64, Lijun Pan, 2020/06/25
[PATCH v3 3/8] target/ppc: convert vmuluwm to tcg_gen_gvec_mul, Lijun Pan, 2020/06/25
[PATCH v3 8/8] target/ppc: add vdiv{su}{wd} vmod{su}{wd} instructions, Lijun Pan, 2020/06/25