diff options
author | Cui,Lili <lili.cui@intel.com> | 2020-10-15 10:45:08 +0800 |
---|---|---|
committer | Cui,Lili <lili.cui@intel.com> | 2020-10-16 11:37:09 +0800 |
commit | 57392598795ca9a9bae18858bf66b5a62ba1b71f (patch) | |
tree | 7a4925aee977039e6e849a11b5a6f22a45cdd329 /gas | |
parent | 51a8a7c2e3cc0730831963651a55d23d1fae624d (diff) | |
download | binutils-57392598795ca9a9bae18858bf66b5a62ba1b71f.zip binutils-57392598795ca9a9bae18858bf66b5a62ba1b71f.tar.gz binutils-57392598795ca9a9bae18858bf66b5a62ba1b71f.tar.bz2 |
Enhancement for avx-vnni patch
1. Rename CpuVEX_PREFIX to PseudoVexPrefix and
move it from cpu_flags to opcode_modifiers.
2. Delete {vex2} invalid test.
3. Use VexW0 and VexVVVV in the AVX-VNNI instructions.
gas/
* config/tc-i386.c: Move Pseudo Prefix check to match_template.
* testsuite/gas/i386/avx-vnni-inval.l: New file.
* testsuite/gas/i386/avx-vnni-inval.s: Likewise.
* testsuite/gas/i386/avx-vnni.d: Delete invalid {vex2} test.
* testsuite/gas/i386/avx-vnni.s: Likewise.
* testsuite/gas/i386/i386.exp: Add AVX VNNI invalid tests.
* testsuite/gas/i386/x86-64-avx-vnni-inval.l: New file.
* testsuite/gas/i386/x86-64-avx-vnni-inval.s: Likewise.
* testsuite/gas/i386/x86-64-avx-vnni.d: Delete invalid {vex2} test.
* testsuite/gas/i386/x86-64-avx-vnni.s: Likewise.
opcodes/
* i386-opc.tbl: Rename CpuVEX_PREFIX to PseudoVexPrefix
and move it from cpu_flags to opcode_modifiers.
Use VexW0 and VexVVVV in the AVX-VNNI instructions.
* i386-gen.c: Likewise.
* i386-opc.h: Likewise.
* i386-opc.h: Likewise.
* i386-init.h: Regenerated.
* i386-tbl.h: Likewise.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 13 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/avx-vnni-inval.l | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/avx-vnni-inval.s | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/avx-vnni.d | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/avx-vnni.s | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-avx-vnni-inval.l | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-avx-vnni-inval.s | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-avx-vnni.d | 8 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/x86-64-avx-vnni.s | 2 |
11 files changed, 41 insertions, 28 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 0b7e431..c5235ba 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,16 @@ +2020-10-16 Lili Cui <lili.cui@intel.com> + + * config/tc-i386.c: Move Pseudo Prefix check to match_template. + * testsuite/gas/i386/avx-vnni-inval.l: New file. + * testsuite/gas/i386/avx-vnni-inval.s: Likewise. + * testsuite/gas/i386/avx-vnni.d: Delete invalid {vex2} test. + * testsuite/gas/i386/avx-vnni.s: Likewise. + * testsuite/gas/i386/i386.exp: Add AVX VNNI invalid tests. + * testsuite/gas/i386/x86-64-avx-vnni-inval.l: New file. + * testsuite/gas/i386/x86-64-avx-vnni-inval.s: Likewise. + * testsuite/gas/i386/x86-64-avx-vnni.d: Delete invalid {vex2} test. + * testsuite/gas/i386/x86-64-avx-vnni.s: Likewise. + 2020-10-14 H.J. Lu <hongjiu.lu@intel.com> Lili Cui <lili.cui@intel.com> diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index a081064a..487454f 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1973,14 +1973,7 @@ cpu_flags_match (const insn_template *t) cpu = cpu_flags_and (x, cpu); if (!cpu_flags_all_zero (&cpu)) { - 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) + if (x.bitfield.cpuavx) { /* We need to check a few extra flags with AVX. */ if (cpu.bitfield.cpuavx @@ -6265,6 +6258,13 @@ match_template (char mnem_suffix) if (cpu_flags_match (t) != CPU_FLAGS_PERFECT_MATCH) continue; + /* Check Pseudo Prefix. */ + i.error = unsupported; + if (t->opcode_modifier.pseudovexprefix + && !(i.vec_encoding == vex_encoding_vex + || i.vec_encoding == vex_encoding_vex3)) + continue; + /* Check AT&T mnemonic. */ i.error = unsupported_with_intel_mnemonic; if (intel_mnemonic && t->opcode_modifier.attmnemonic) diff --git a/gas/testsuite/gas/i386/avx-vnni-inval.l b/gas/testsuite/gas/i386/avx-vnni-inval.l new file mode 100644 index 0000000..c55f100 --- /dev/null +++ b/gas/testsuite/gas/i386/avx-vnni-inval.l @@ -0,0 +1,2 @@ +.* Assembler messages: +.*:6: Error: unsupported instruction `vpdpbusd' diff --git a/gas/testsuite/gas/i386/avx-vnni-inval.s b/gas/testsuite/gas/i386/avx-vnni-inval.s new file mode 100644 index 0000000..c06babf --- /dev/null +++ b/gas/testsuite/gas/i386/avx-vnni-inval.s @@ -0,0 +1,6 @@ +# Check illegal in AVXVNNI instructions + + .text + .arch .noavx512_vnni +_start: + vpdpbusd %xmm2,%xmm4,%xmm2 diff --git a/gas/testsuite/gas/i386/avx-vnni.d b/gas/testsuite/gas/i386/avx-vnni.d index 6d6e779..6e31528 100644 --- a/gas/testsuite/gas/i386/avx-vnni.d +++ b/gas/testsuite/gas/i386/avx-vnni.d @@ -11,32 +11,24 @@ Disassembly of section .text: +[a-f0-9]+: 62 f2 5d 08 50 d2 vpdpbusd %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 50 d2 \{vex3\} vpdpbusd %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 50 d2 \{vex3\} vpdpbusd %xmm2,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 50 d2 \{vex3\} vpdpbusd %xmm2,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 50 11 \{vex3\} vpdpbusd \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 50 11 \{vex3\} vpdpbusd \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 50 11 \{vex3\} vpdpbusd \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: 62 f2 5d 08 52 d2 vpdpwssd %xmm2,%xmm4,%xmm2 +[a-f0-9]+: 62 f2 5d 08 52 d2 vpdpwssd %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 52 d2 \{vex3\} vpdpwssd %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 52 d2 \{vex3\} vpdpwssd %xmm2,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 52 d2 \{vex3\} vpdpwssd %xmm2,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 52 11 \{vex3\} vpdpwssd \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 52 11 \{vex3\} vpdpwssd \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 52 11 \{vex3\} vpdpwssd \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: 62 f2 5d 08 51 d2 vpdpbusds %xmm2,%xmm4,%xmm2 +[a-f0-9]+: 62 f2 5d 08 51 d2 vpdpbusds %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 51 d2 \{vex3\} vpdpbusds %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 51 d2 \{vex3\} vpdpbusds %xmm2,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 51 d2 \{vex3\} vpdpbusds %xmm2,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 51 11 \{vex3\} vpdpbusds \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 51 11 \{vex3\} vpdpbusds \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 51 11 \{vex3\} vpdpbusds \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: 62 f2 5d 08 53 d2 vpdpwssds %xmm2,%xmm4,%xmm2 +[a-f0-9]+: 62 f2 5d 08 53 d2 vpdpwssds %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 53 d2 \{vex3\} vpdpwssds %xmm2,%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 53 d2 \{vex3\} vpdpwssds %xmm2,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 53 d2 \{vex3\} vpdpwssds %xmm2,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 53 11 \{vex3\} vpdpwssds \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 53 11 \{vex3\} vpdpwssds \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 53 11 \{vex3\} vpdpwssds \(%ecx\),%xmm4,%xmm2 +[a-f0-9]+: 62 f2 5d 08 50 d2 vpdpbusd %xmm2,%xmm4,%xmm2 diff --git a/gas/testsuite/gas/i386/avx-vnni.s b/gas/testsuite/gas/i386/avx-vnni.s index 4ddc733..b37bc85 100644 --- a/gas/testsuite/gas/i386/avx-vnni.s +++ b/gas/testsuite/gas/i386/avx-vnni.s @@ -4,10 +4,8 @@ \mnemonic %xmm2, %xmm4, %xmm2 {evex} \mnemonic %xmm2, %xmm4, %xmm2 {vex} \mnemonic %xmm2, %xmm4, %xmm2 - {vex2} \mnemonic %xmm2, %xmm4, %xmm2 {vex3} \mnemonic %xmm2, %xmm4, %xmm2 {vex} \mnemonic (%ecx), %xmm4, %xmm2 - {vex2} \mnemonic (%ecx), %xmm4, %xmm2 {vex3} \mnemonic (%ecx), %xmm4, %xmm2 .endm diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index f572767..068813d 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -459,6 +459,7 @@ if [gas_32_check] then { run_dump_test "avx512_bf16_vl" run_list_test "avx512_bf16_vl-inval" run_dump_test "avx-vnni" + run_list_test "avx-vnni-inval" run_list_test "sg" run_dump_test "clzero" run_dump_test "disassem" @@ -1077,6 +1078,7 @@ if [gas_64_check] then { run_dump_test "x86-64-avx512_bf16_vl" run_list_test "x86-64-avx512_bf16_vl-inval" run_dump_test "x86-64-avx-vnni" + run_list_test "x86-64-avx-vnni-inval" run_dump_test "x86-64-clzero" run_dump_test "x86-64-mwaitx-bdver4" run_list_test "x86-64-mwaitx-reg" diff --git a/gas/testsuite/gas/i386/x86-64-avx-vnni-inval.l b/gas/testsuite/gas/i386/x86-64-avx-vnni-inval.l new file mode 100644 index 0000000..a276b37 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-avx-vnni-inval.l @@ -0,0 +1,3 @@ +.* Assembler messages: +.*:6: Error: unsupported instruction `vpdpbusds' +.*:7: Error: unsupported instruction `vpdpbusds' diff --git a/gas/testsuite/gas/i386/x86-64-avx-vnni-inval.s b/gas/testsuite/gas/i386/x86-64-avx-vnni-inval.s new file mode 100644 index 0000000..f621ef4 --- /dev/null +++ b/gas/testsuite/gas/i386/x86-64-avx-vnni-inval.s @@ -0,0 +1,7 @@ +# Check illegal in AVXVNNI instructions + + .text + .arch .noavx512_vnni +_start: + vpdpbusds %xmm2, %xmm4, %xmm2 + vpdpbusds %xmm22, %xmm4, %xmm2 diff --git a/gas/testsuite/gas/i386/x86-64-avx-vnni.d b/gas/testsuite/gas/i386/x86-64-avx-vnni.d index ebb0ebf..c447473 100644 --- a/gas/testsuite/gas/i386/x86-64-avx-vnni.d +++ b/gas/testsuite/gas/i386/x86-64-avx-vnni.d @@ -11,8 +11,6 @@ Disassembly of section .text: +[a-f0-9]+: 62 d2 5d 08 50 d4 vpdpbusd %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 c2 59 50 d4 \{vex3\} vpdpbusd %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 c2 59 50 d4 \{vex3\} vpdpbusd %xmm12,%xmm4,%xmm2 - +[a-f0-9]+: c4 c2 59 50 d4 \{vex3\} vpdpbusd %xmm12,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 50 11 \{vex3\} vpdpbusd \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 50 11 \{vex3\} vpdpbusd \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 50 11 \{vex3\} vpdpbusd \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: 62 b2 5d 08 50 d6 vpdpbusd %xmm22,%xmm4,%xmm2 @@ -20,8 +18,6 @@ Disassembly of section .text: +[a-f0-9]+: 62 d2 5d 08 52 d4 vpdpwssd %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 c2 59 52 d4 \{vex3\} vpdpwssd %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 c2 59 52 d4 \{vex3\} vpdpwssd %xmm12,%xmm4,%xmm2 - +[a-f0-9]+: c4 c2 59 52 d4 \{vex3\} vpdpwssd %xmm12,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 52 11 \{vex3\} vpdpwssd \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 52 11 \{vex3\} vpdpwssd \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 52 11 \{vex3\} vpdpwssd \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: 62 b2 5d 08 52 d6 vpdpwssd %xmm22,%xmm4,%xmm2 @@ -29,8 +25,6 @@ Disassembly of section .text: +[a-f0-9]+: 62 d2 5d 08 51 d4 vpdpbusds %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 c2 59 51 d4 \{vex3\} vpdpbusds %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 c2 59 51 d4 \{vex3\} vpdpbusds %xmm12,%xmm4,%xmm2 - +[a-f0-9]+: c4 c2 59 51 d4 \{vex3\} vpdpbusds %xmm12,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 51 11 \{vex3\} vpdpbusds \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 51 11 \{vex3\} vpdpbusds \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 51 11 \{vex3\} vpdpbusds \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: 62 b2 5d 08 51 d6 vpdpbusds %xmm22,%xmm4,%xmm2 @@ -38,8 +32,6 @@ Disassembly of section .text: +[a-f0-9]+: 62 d2 5d 08 53 d4 vpdpwssds %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 c2 59 53 d4 \{vex3\} vpdpwssds %xmm12,%xmm4,%xmm2 +[a-f0-9]+: c4 c2 59 53 d4 \{vex3\} vpdpwssds %xmm12,%xmm4,%xmm2 - +[a-f0-9]+: c4 c2 59 53 d4 \{vex3\} vpdpwssds %xmm12,%xmm4,%xmm2 - +[a-f0-9]+: c4 e2 59 53 11 \{vex3\} vpdpwssds \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 53 11 \{vex3\} vpdpwssds \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: c4 e2 59 53 11 \{vex3\} vpdpwssds \(%rcx\),%xmm4,%xmm2 +[a-f0-9]+: 62 b2 5d 08 53 d6 vpdpwssds %xmm22,%xmm4,%xmm2 diff --git a/gas/testsuite/gas/i386/x86-64-avx-vnni.s b/gas/testsuite/gas/i386/x86-64-avx-vnni.s index 7f47bf6..95b6dc2 100644 --- a/gas/testsuite/gas/i386/x86-64-avx-vnni.s +++ b/gas/testsuite/gas/i386/x86-64-avx-vnni.s @@ -4,10 +4,8 @@ \mnemonic %xmm12, %xmm4, %xmm2 {evex} \mnemonic %xmm12, %xmm4, %xmm2 {vex} \mnemonic %xmm12, %xmm4, %xmm2 - {vex2} \mnemonic %xmm12, %xmm4, %xmm2 {vex3} \mnemonic %xmm12, %xmm4, %xmm2 {vex} \mnemonic (%rcx), %xmm4, %xmm2 - {vex2} \mnemonic (%rcx), %xmm4, %xmm2 {vex3} \mnemonic (%rcx), %xmm4, %xmm2 \mnemonic %xmm22, %xmm4, %xmm2 .endm |