x86: Check invalid XMM register in AVX512 gathers
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Oct 2017 18:16:41 +0000 (11:16 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Oct 2017 18:18:25 +0000 (11:18 -0700)
Extend invalid register check for AVX512 gathers to XMM register.

PR gas/22352
* config/tc-i386.c (check_VecOperands): Also check XMM register
for invalid register in AVX512 gathers.
* testsuite/gas/i386/vgather-check.s: Add tests for AVX512
gathers with XMM register.
* testsuite/gas/i386/x86-64-vgather-check.s: Likewise.
* testsuite/gas/i386/vgather-check-error.l: Updated.
* testsuite/gas/i386/vgather-check-none.d: Likewise.
* testsuite/gas/i386/vgather-check-warn.d: Likewise.
* testsuite/gas/i386/vgather-check-warn.e: Likewise.
* testsuite/gas/i386/vgather-check.d: Likewise.
* testsuite/gas/i386/x86-64-vgather-check-error.l: Likewise.
* testsuite/gas/i386/x86-64-vgather-check-none.d: Likewise.
* testsuite/gas/i386/x86-64-vgather-check-warn.d: Likewise.
* testsuite/gas/i386/x86-64-vgather-check-warn.e: Likewise.
* testsuite/gas/i386/x86-64-vgather-check.d: Likewise.

14 files changed:
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/vgather-check-error.l
gas/testsuite/gas/i386/vgather-check-none.d
gas/testsuite/gas/i386/vgather-check-warn.d
gas/testsuite/gas/i386/vgather-check-warn.e
gas/testsuite/gas/i386/vgather-check.d
gas/testsuite/gas/i386/vgather-check.s
gas/testsuite/gas/i386/x86-64-vgather-check-error.l
gas/testsuite/gas/i386/x86-64-vgather-check-none.d
gas/testsuite/gas/i386/x86-64-vgather-check-warn.d
gas/testsuite/gas/i386/x86-64-vgather-check-warn.e
gas/testsuite/gas/i386/x86-64-vgather-check.d
gas/testsuite/gas/i386/x86-64-vgather-check.s

index 64f593e..231589f 100644 (file)
@@ -1,3 +1,22 @@
+2017-10-26  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR gas/22352
+       * config/tc-i386.c (check_VecOperands): Also check XMM register
+       for invalid register in AVX512 gathers.
+       * testsuite/gas/i386/vgather-check.s: Add tests for AVX512
+       gathers with XMM register.
+       * testsuite/gas/i386/x86-64-vgather-check.s: Likewise.
+       * testsuite/gas/i386/vgather-check-error.l: Updated.
+       * testsuite/gas/i386/vgather-check-none.d: Likewise.
+       * testsuite/gas/i386/vgather-check-warn.d: Likewise.
+       * testsuite/gas/i386/vgather-check-warn.e: Likewise.
+       * testsuite/gas/i386/vgather-check.d: Likewise.
+       * testsuite/gas/i386/x86-64-vgather-check-error.l: Likewise.
+       * testsuite/gas/i386/x86-64-vgather-check-none.d: Likewise.
+       * testsuite/gas/i386/x86-64-vgather-check-warn.d: Likewise.
+       * testsuite/gas/i386/x86-64-vgather-check-warn.e: Likewise.
+       * testsuite/gas/i386/x86-64-vgather-check.d: Likewise.
+
 2017-10-26  Hans-Peter Nilsson  <hp@bitrange.com>
 
        * testsuite/gas/all/fill-1.s: Use L2 rather than .L2.
index 6b5026f..dcc70c8 100644 (file)
@@ -4658,7 +4658,8 @@ check_VecOperands (const insn_template *t)
        }
       else if (i.reg_operands == 1 && i.mask)
        {
-         if ((i.types[1].bitfield.regymm
+         if ((i.types[1].bitfield.regxmm
+              || i.types[1].bitfield.regymm
               || i.types[1].bitfield.regzmm)
              && (register_number (i.op[1].regs)
                  == register_number (i.index_reg)))
index a86ccd5..5874d6d 100644 (file)
@@ -10,3 +10,4 @@
 .*:22: Error: .*
 .*:24: Error: .*
 .*:26: Error: .*
+.*:28: Error: .*
index 8abdfcb..634b304 100644 (file)
@@ -29,4 +29,6 @@ Disassembly of section .text:
 [      ]+[a-f0-9]+:[   ]+62 f2 7d 49 91 b4 f5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%zmm6,8\),%ymm6\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 f2 fd 49 91 b4 fd 7b 00 00 00[     ]+vpgatherqq 0x7b\(%ebp,%zmm7,8\),%zmm6\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 f2 fd 49 91 b4 f5 7b 00 00 00[     ]+vpgatherqq 0x7b\(%ebp,%zmm6,8\),%zmm6\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 f2 7d 29 91 b4 fd 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%ymm7,8\),%xmm6\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 f2 7d 29 91 b4 f5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%ymm6,8\),%xmm6\{%k1\}
 #pass
index 985f713..532c4d8 100644 (file)
@@ -30,4 +30,6 @@ Disassembly of section .text:
 [      ]+[a-f0-9]+:[   ]+62 f2 7d 49 91 b4 f5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%zmm6,8\),%ymm6\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 f2 fd 49 91 b4 fd 7b 00 00 00[     ]+vpgatherqq 0x7b\(%ebp,%zmm7,8\),%zmm6\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 f2 fd 49 91 b4 f5 7b 00 00 00[     ]+vpgatherqq 0x7b\(%ebp,%zmm6,8\),%zmm6\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 f2 7d 29 91 b4 fd 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%ymm7,8\),%xmm6\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 f2 7d 29 91 b4 f5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%ymm6,8\),%xmm6\{%k1\}
 #pass
index efd2e0b..cb88602 100644 (file)
@@ -10,3 +10,4 @@
 .*:22: Warning: .*
 .*:24: Warning: .*
 .*:26: Warning: .*
+.*:28: Warning: .*
index c3505f9..a50272f 100644 (file)
@@ -29,4 +29,6 @@ Disassembly of section .text:
 [      ]+[a-f0-9]+:[   ]+62 f2 7d 49 91 b4 f5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%zmm6,8\),%ymm6\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 f2 fd 49 91 b4 fd 7b 00 00 00[     ]+vpgatherqq 0x7b\(%ebp,%zmm7,8\),%zmm6\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 f2 fd 49 91 b4 f5 7b 00 00 00[     ]+vpgatherqq 0x7b\(%ebp,%zmm6,8\),%zmm6\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 f2 7d 29 91 b4 fd 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%ymm7,8\),%xmm6\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 f2 7d 29 91 b4 f5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%ebp,%ymm6,8\),%xmm6\{%k1\}
 #pass
index b2735e7..73dd40a 100644 (file)
@@ -24,3 +24,5 @@ avx512vgather:
        vpgatherqd      123(%ebp,%zmm6,8), %ymm6{%k1}
        vpgatherqq      123(%ebp,%zmm7,8), %zmm6{%k1}
        vpgatherqq      123(%ebp,%zmm6,8), %zmm6{%k1}
+       vpgatherqd      123(%ebp,%ymm7,8), %xmm6{%k1}
+       vpgatherqd      123(%ebp,%ymm6,8), %xmm6{%k1}
index a1062f7..3a14d1f 100644 (file)
@@ -32,4 +32,6 @@ Disassembly of section .text:
 [      ]+[a-f0-9]+:[   ]+62 e2 7d 41 91 84 c5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%zmm16,8\),%ymm16\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 e2 fd 41 91 84 cd 7b 00 00 00[     ]+vpgatherqq 0x7b\(%rbp,%zmm17,8\),%zmm16\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 e2 fd 41 91 84 c5 7b 00 00 00[     ]+vpgatherqq 0x7b\(%rbp,%zmm16,8\),%zmm16\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 e2 7d 21 91 84 cd 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%ymm17,8\),%xmm16\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 e2 7d 21 91 84 c5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%ymm16,8\),%xmm16\{%k1\}
 #pass
index 3d7a249..c890209 100644 (file)
@@ -33,4 +33,6 @@ Disassembly of section .text:
 [      ]+[a-f0-9]+:[   ]+62 e2 7d 41 91 84 c5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%zmm16,8\),%ymm16\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 e2 fd 41 91 84 cd 7b 00 00 00[     ]+vpgatherqq 0x7b\(%rbp,%zmm17,8\),%zmm16\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 e2 fd 41 91 84 c5 7b 00 00 00[     ]+vpgatherqq 0x7b\(%rbp,%zmm16,8\),%zmm16\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 e2 7d 21 91 84 cd 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%ymm17,8\),%xmm16\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 e2 7d 21 91 84 c5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%ymm16,8\),%xmm16\{%k1\}
 #pass
index d51f670..dfe1297 100644 (file)
@@ -32,4 +32,6 @@ Disassembly of section .text:
 [      ]+[a-f0-9]+:[   ]+62 e2 7d 41 91 84 c5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%zmm16,8\),%ymm16\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 e2 fd 41 91 84 cd 7b 00 00 00[     ]+vpgatherqq 0x7b\(%rbp,%zmm17,8\),%zmm16\{%k1\}
 [      ]+[a-f0-9]+:[   ]+62 e2 fd 41 91 84 c5 7b 00 00 00[     ]+vpgatherqq 0x7b\(%rbp,%zmm16,8\),%zmm16\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 e2 7d 21 91 84 cd 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%ymm17,8\),%xmm16\{%k1\}
+[      ]+[a-f0-9]+:[   ]+62 e2 7d 21 91 84 c5 7b 00 00 00[     ]+vpgatherqd 0x7b\(%rbp,%ymm16,8\),%xmm16\{%k1\}
 #pass
index 9d5872c..2c51d78 100644 (file)
@@ -27,3 +27,5 @@ avx512vgather:
        vpgatherqd      123(%rbp,%zmm16,8), %ymm16{%k1}
        vpgatherqq      123(%rbp,%zmm17,8), %zmm16{%k1}
        vpgatherqq      123(%rbp,%zmm16,8), %zmm16{%k1}
+       vpgatherqd      123(%rbp,%ymm17,8), %xmm16{%k1}
+       vpgatherqd      123(%rbp,%ymm16,8), %xmm16{%k1}