diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-10-14 05:02:13 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-10-14 05:02:31 -0700 |
commit | 58bf9b6a7ff56d53f851f78e02c255440de9258a (patch) | |
tree | 06c1757cf3fb5b11be78e993f1bf75af4814d19d /gas/config | |
parent | c1fa250ae1604d3337cf63279503a737c9377574 (diff) | |
download | gdb-58bf9b6a7ff56d53f851f78e02c255440de9258a.zip gdb-58bf9b6a7ff56d53f851f78e02c255440de9258a.tar.gz gdb-58bf9b6a7ff56d53f851f78e02c255440de9258a.tar.bz2 |
x86: Support Intel AVX VNNI
Intel AVX VNNI instructions are marked with CpuVEX_PREFIX. Without the
pseudo {vex} prefix, mnemonics of Intel VNNI instructions are encoded
with the EVEX prefix. The pseudo {vex} prefix can be used to encode
mnemonics of Intel VNNI instructions with the VEX prefix.
gas/
* NEWS: Add Intel AVX VNNI.
* config/tc-i386.c (cpu_arch): Add .avx_vnni and noavx_vnni.
(cpu_flags_match): Support CpuVEX_PREFIX.
* doc/c-i386.texi: Document .avx_vnni, noavx_vnni and how to
encode Intel VNNI instructions with VEX prefix.
* testsuite/gas/i386/avx-vnni.d: New file.
* testsuite/gas/i386/avx-vnni.s: Likewise.
* testsuite/gas/i386/x86-64-avx-vnni.d: Likewise.
* testsuite/gas/i386/x86-64-avx-vnni.s: Likewise.
* testsuite/gas/i386/i386.exp: Run AVX VNNI tests.
opcodes/
* i386-dis.c (PREFIX_VEX_0F3850): New.
(PREFIX_VEX_0F3851): Likewise.
(PREFIX_VEX_0F3852): Likewise.
(PREFIX_VEX_0F3853): Likewise.
(VEX_W_0F3850_P_2): Likewise.
(VEX_W_0F3851_P_2): Likewise.
(VEX_W_0F3852_P_2): Likewise.
(VEX_W_0F3853_P_2): Likewise.
(prefix_table): Add PREFIX_VEX_0F3850, PREFIX_VEX_0F3851,
PREFIX_VEX_0F3852 and PREFIX_VEX_0F3853.
(vex_table): Add VEX_W_0F3850_P_2, VEX_W_0F3851_P_2,
VEX_W_0F3852_P_2 and VEX_W_0F3853_P_2.
(putop): Add support for "XV" to print "{vex3}" pseudo prefix.
* i386-gen.c (cpu_flag_init): Clear the CpuAVX_VNNI bit in
CPU_UNKNOWN_FLAGS. Add CPU_AVX_VNNI_FLAGS and
CPU_ANY_AVX_VNNI_FLAGS.
(cpu_flags): Add CpuAVX_VNNI and CpuVEX_PREFIX.
* i386-opc.h (CpuAVX_VNNI): New.
(CpuVEX_PREFIX): Likewise.
(i386_cpu_flags): Add cpuavx_vnni and cpuvex_prefix.
* i386-opc.tbl: Add Intel AVX VNNI instructions.
* i386-init.h: Regenerated.
* i386-tbl.h: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-i386.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 6df250a..a081064a 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1180,6 +1180,8 @@ static const arch_entry cpu_arch[] = CPU_AVX512_VNNI_FLAGS, 0 }, { STRING_COMMA_LEN (".avx512_bitalg"), PROCESSOR_UNKNOWN, CPU_AVX512_BITALG_FLAGS, 0 }, + { STRING_COMMA_LEN (".avx_vnni"), PROCESSOR_UNKNOWN, + CPU_AVX_VNNI_FLAGS, 0 }, { STRING_COMMA_LEN (".clzero"), PROCESSOR_UNKNOWN, CPU_CLZERO_FLAGS, 0 }, { STRING_COMMA_LEN (".mwaitx"), PROCESSOR_UNKNOWN, @@ -1280,6 +1282,7 @@ static const noarch_entry cpu_noarch[] = { STRING_COMMA_LEN ("noavx512_vbmi2"), CPU_ANY_AVX512_VBMI2_FLAGS }, { STRING_COMMA_LEN ("noavx512_vnni"), CPU_ANY_AVX512_VNNI_FLAGS }, { STRING_COMMA_LEN ("noavx512_bitalg"), CPU_ANY_AVX512_BITALG_FLAGS }, + { STRING_COMMA_LEN ("noavx_vnni"), CPU_ANY_AVX_VNNI_FLAGS }, { STRING_COMMA_LEN ("noibt"), CPU_ANY_IBT_FLAGS }, { STRING_COMMA_LEN ("noshstk"), CPU_ANY_SHSTK_FLAGS }, { STRING_COMMA_LEN ("noamx_int8"), CPU_ANY_AMX_INT8_FLAGS }, @@ -1970,7 +1973,14 @@ cpu_flags_match (const insn_template *t) cpu = cpu_flags_and (x, cpu); if (!cpu_flags_all_zero (&cpu)) { - if (x.bitfield.cpuavx) + if (x.bitfield.cpuvex_prefix) + { + /* We need to check a few extra flags with VEX_PREFIX. */ + if (i.vec_encoding == vex_encoding_vex + || i.vec_encoding == vex_encoding_vex3) + match |= CPU_FLAGS_ARCH_MATCH; + } + else if (x.bitfield.cpuavx) { /* We need to check a few extra flags with AVX. */ if (cpu.bitfield.cpuavx |