x86: Support Intel AVX VNNI
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 14 Oct 2020 12:02:13 +0000 (05:02 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 14 Oct 2020 12:02:31 +0000 (05:02 -0700)
commit58bf9b6a7ff56d53f851f78e02c255440de9258a
tree06c1757cf3fb5b11be78e993f1bf75af4814d19d
parentc1fa250ae1604d3337cf63279503a737c9377574
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.
16 files changed:
gas/ChangeLog
gas/NEWS
gas/config/tc-i386.c
gas/doc/c-i386.texi
gas/testsuite/gas/i386/avx-vnni.d [new file with mode: 0644]
gas/testsuite/gas/i386/avx-vnni.s [new file with mode: 0644]
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/x86-64-avx-vnni.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-avx-vnni.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/i386-dis.c
opcodes/i386-gen.c
opcodes/i386-init.h
opcodes/i386-opc.h
opcodes/i386-opc.tbl
opcodes/i386-tbl.h