]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
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 64f593e13bb0320b4ef096ce22859ba9926c64da..231589fdc1185afab30ff2bca314b0ed98e03608 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 6b5026f331eb5a021155c3ed5775b376dae09e6d..dcc70c80455ae27fba9e0cb6df545fcacbad51ff 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 a86ccd50b10f54992af2682db70623ce675369bb..5874d6d35913f3ee5633b3ba64d6a01a1d40e2d7 100644 (file)
@@ -10,3 +10,4 @@
 .*:22: Error: .*
 .*:24: Error: .*
 .*:26: Error: .*
+.*:28: Error: .*
index 8abdfcbec82c8dd6b8f0e8d1e79852af8acb69c0..634b304d2148ae50cda76508a0854cf2aeaa66e0 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 985f713890799f468a4f8e1db8fc55d99db663bc..532c4d82b9d78276406e607dc8fb79a400e78ecf 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 efd2e0bde30b052107c0e14dbd5a8ccd0cd521e0..cb88602098f5c88938ba58e5f86e2e6a75660b22 100644 (file)
@@ -10,3 +10,4 @@
 .*:22: Warning: .*
 .*:24: Warning: .*
 .*:26: Warning: .*
+.*:28: Warning: .*
index c3505f9ac3df0b2c44263ce8148aaa1b5f70e417..a50272f3b2d9d03fb4936cfbcc42d447ef54b668 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 b2735e75e317dbb7fab0289eda2628452135182a..73dd40a08b2ea9bdd14d989a107134e468ec0d13 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 28fa82407c1c5469df5e6e6a63aadb8d98b3dea1..b65656d8193e5ea45f05fdcfbfb9d4be053d5853 100644 (file)
@@ -10,3 +10,4 @@
 .*:25: Error: .*
 .*:27: Error: .*
 .*:29: Error: .*
+.*:31: Error: .*
index a1062f77e14da481ca8d300ef21b5cd766f28705..3a14d1fa578e52874c568d74168510c07d3dcf10 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 3d7a249113bcfe1afaedc916651340128e6d1828..c89020976d3b4fe647765860df4b2c78853b4953 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 b17f423091f0a55371bce470b659dcbee3faac7a..103ed704a886f0c26c8522f4437147e80449a291 100644 (file)
@@ -10,3 +10,4 @@
 .*:25: Warning: .*
 .*:27: Warning: .*
 .*:29: Warning: .*
+.*:31: Warning: .*
index d51f67076b4805cc403d57204e800f5e4b60d1f0..dfe1297147046496adff4ec2282cc8139b06ad7a 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 9d5872c8420b0fb1351a3fd73d3f964dd2695c8a..2c51d78533783ae644f6f673375f6cba88b8e195 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}