x86: Check invalid XMM register in AVX512 gathers

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.
This commit is contained in:
H.J. Lu 2017-10-26 11:16:41 -07:00
parent 506981afaf
commit 514f60231c
14 changed files with 41 additions and 1 deletions

View 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.

View 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)))

View File

@ -10,3 +10,4 @@
.*:22: Error: .*
.*:24: Error: .*
.*:26: Error: .*
.*:28: Error: .*

View 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

View 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

View File

@ -10,3 +10,4 @@
.*:22: Warning: .*
.*:24: Warning: .*
.*:26: Warning: .*
.*:28: Warning: .*

View 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

View 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}

View File

@ -10,3 +10,4 @@
.*:25: Error: .*
.*:27: Error: .*
.*:29: Error: .*
.*:31: Error: .*

View 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

View 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

View File

@ -10,3 +10,4 @@
.*:25: Warning: .*
.*:27: Warning: .*
.*:29: Warning: .*
.*:31: Warning: .*

View 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

View 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}