This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Bug: gather/scatter accepts same registers in destination/src and index
- From: "Michael V. Zolotukhin" <michael dot v dot zolotukhin at gmail dot com>
- To: Jan Beulich <JBeulich at suse dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 21 Jan 2014 15:16:27 +0400
- Subject: Re: Bug: gather/scatter accepts same registers in destination/src and index
- Authentication-results: sourceware.org; auth=none
- References: <CANtU078XuYEQ8AnKR2BQoRSSByKLAf_TrzdpjEO=4h09U524gQ at mail dot gmail dot com> <52DE438B0200007800115421 at nat28 dot tlf dot novell dot com>
Hi,
The patch is below, is it ok for trunk? I chose name 'vgather-scatter-check'
for the tests, as I think 'vsg' is a bit ambiguous.
gas/Changelog:
2014-01-21 Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
* config/tc-i386.c (check_VecOperands): Add check for invalid
register set in AVX512 gathers/scatters.
gas/testsuite/Changelog:
2014-01-21 Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
* gas/i386/i386.exp: Rename vgather-check to vgather-scatter-check.
* gas/i386/vgather-check-error.l: Add tests and rename to ...
* gas/i386/vgather-scatter-check-error.l: This.
* gas/i386/vgather-check-error.s: Add tests and rename to ...
* gas/i386/vgather-scatter-check-error.s: This.
* gas/i386/vgather-check-none.d: Add tests and rename to ...
* gas/i386/vgather-scatter-check-none.d: This.
* gas/i386/vgather-check-none.s: Add tests and rename to ...
* gas/i386/vgather-scatter-check-none.s: This.
* gas/i386/vgather-check-warn.d: Add tests and rename to ...
* gas/i386/vgather-scatter-check-warn.d: This.
* gas/i386/vgather-check-warn.e: Add tests and rename to ...
* gas/i386/vgather-scatter-check-warn.e: This.
* gas/i386/vgather-check.d: Add tests and rename to ...
* gas/i386/vgather-scatter-check.d: This.
* gas/i386/vgather-check.s: Add tests and rename to ...
* gas/i386/vgather-scatter-check.s: This.
* gas/i386/x86-64-vgather-check-error.l: Add tests and rename to ...
* gas/i386/x86-64-vgather-scatter-check-error.l: This.
* gas/i386/x86-64-vgather-check-error.s: Add tests and rename to ...
* gas/i386/x86-64-vgather-scatter-check-error.s: This.
* gas/i386/x86-64-vgather-check-none.d: Add tests and rename to ...
* gas/i386/x86-64-vgather-scatter-check-none.d: This.
* gas/i386/x86-64-vgather-check-none.s: Add tests and rename to ...
* gas/i386/x86-64-vgather-scatter-check-none.s: This.
* gas/i386/x86-64-vgather-check-warn.d: Add tests and rename to ...
* gas/i386/x86-64-vgather-scatter-check-warn.d: This.
* gas/i386/x86-64-vgather-check-warn.e: Add tests and rename to ...
* gas/i386/x86-64-vgather-scatter-check-warn.e: This.
* gas/i386/x86-64-vgather-check.d: Add tests and rename to ...
* gas/i386/x86-64-vgather-scatter-check.d: This.
* gas/i386/x86-64-vgather-check.s: Add tests and rename to ...
* gas/i386/x86-64-vgather-scatter-check.s: This.
Thanks,
Michael
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 147acdf..281e3d9 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4374,11 +4374,9 @@ check_VecOperands (const insn_template *t)
if (i.reg_operands == 2 && !i.mask)
{
gas_assert (i.types[0].bitfield.regxmm
- || i.types[0].bitfield.regymm
- || i.types[0].bitfield.regzmm);
+ || i.types[0].bitfield.regymm);
gas_assert (i.types[2].bitfield.regxmm
- || i.types[2].bitfield.regymm
- || i.types[2].bitfield.regzmm);
+ || i.types[2].bitfield.regymm);
if (operand_check == check_none)
return 0;
if (register_number (i.op[0].regs)
@@ -4395,6 +4393,40 @@ check_VecOperands (const insn_template *t)
}
as_warn (_("mask, index, and destination registers should be distinct"));
}
+ else if (i.reg_operands == 1 && i.mask)
+ {
+ gas_assert (i.types[0].bitfield.regymm
+ || i.types[0].bitfield.regzmm
+ || i.types[1].bitfield.regymm
+ || i.types[1].bitfield.regzmm);
+ if (operand_check != check_none)
+ {
+ if ((i.types[0].bitfield.regymm
+ || i.types[0].bitfield.regzmm)
+ && (register_number (i.op[0].regs)
+ == register_number (i.index_reg)))
+ {
+ if (operand_check == check_error)
+ {
+ i.error = invalid_vector_register_set;
+ return 1;
+ }
+ as_warn (_("index and source registers should be distinct"));
+ }
+ else if ((i.types[1].bitfield.regymm
+ || i.types[1].bitfield.regzmm)
+ && (register_number (i.op[1].regs)
+ == register_number (i.index_reg)))
+ {
+ if (operand_check == check_error)
+ {
+ i.error = invalid_vector_register_set;
+ return 1;
+ }
+ as_warn (_("index and destination registers should be distinct"));
+ }
+ }
+ }
}
/* Check if broadcast is supported by the instruction and is applied
@@ -4940,7 +4972,7 @@ check_reverse:
err_msg = _("invalid VSIB address");
break;
case invalid_vector_register_set:
- err_msg = _("mask, index, and destination registers must be distinct");
+ err_msg = _("mask, index, and destination/source registers must be distinct");
break;
case unsupported_vector_index_register:
err_msg = _("unsupported vector index register");
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index b70f01c..292ae19 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -206,10 +206,10 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "sse-check-none"
run_dump_test "sse-check-warn"
run_list_test "sse-check-error" "-msse-check=error -I${srcdir}/$subdir -al"
- run_dump_test "vgather-check"
- run_dump_test "vgather-check-none"
- run_dump_test "vgather-check-warn"
- run_list_test "vgather-check-error" "-moperand-check=error -I${srcdir}/$subdir"
+ run_dump_test "vgather-scatter-check"
+ run_dump_test "vgather-scatter-check-none"
+ run_dump_test "vgather-scatter-check-warn"
+ run_list_test "vgather-scatter-check-error" "-moperand-check=error -I${srcdir}/$subdir"
run_dump_test "sse-noavx"
run_dump_test "movbe"
run_dump_test "movbe-intel"
@@ -501,10 +501,10 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-sse-check-none"
run_dump_test "x86-64-sse-check-warn"
run_list_test "x86-64-sse-check-error" "-msse-check=error -I${srcdir}/$subdir -al"
- run_dump_test "x86-64-vgather-check"
- run_dump_test "x86-64-vgather-check-none"
- run_dump_test "x86-64-vgather-check-warn"
- run_list_test "x86-64-vgather-check-error" "-moperand-check=error -I${srcdir}/$subdir"
+ run_dump_test "x86-64-vgather-scatter-check"
+ run_dump_test "x86-64-vgather-scatter-check-none"
+ run_dump_test "x86-64-vgather-scatter-check-warn"
+ run_list_test "x86-64-vgather-scatter-check-error" "-moperand-check=error -I${srcdir}/$subdir"
run_dump_test "x86-64-sse-noavx"
run_dump_test "x86-64-movbe"
run_dump_test "x86-64-movbe-intel"
diff --git a/gas/testsuite/gas/i386/vgather-check-error.l b/gas/testsuite/gas/i386/vgather-check-error.l
deleted file mode 100644
index 41273dc..0000000
--- a/gas/testsuite/gas/i386/vgather-check-error.l
+++ /dev/null
@@ -1,4 +0,0 @@
-.*: Assembler messages:
-.*:6: Error: .*
-.*:7: Error: .*
-.*:8: Error: .*
diff --git a/gas/testsuite/gas/i386/vgather-check-error.s b/gas/testsuite/gas/i386/vgather-check-error.s
deleted file mode 100644
index 9db69c6..0000000
--- a/gas/testsuite/gas/i386/vgather-check-error.s
+++ /dev/null
@@ -1 +0,0 @@
-.include "vgather-check.s"
diff --git a/gas/testsuite/gas/i386/vgather-check-none.d b/gas/testsuite/gas/i386/vgather-check-none.d
deleted file mode 100644
index b51cc94..0000000
--- a/gas/testsuite/gas/i386/vgather-check-none.d
+++ /dev/null
@@ -1,14 +0,0 @@
-#as: -moperand-check=error -I${srcdir}/$subdir
-#objdump: -dw
-#name: i386 vgather check (.operand_check none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <vgather>:
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%eax,%xmm1,1\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%eax,%xmm1,2\),%xmm2
-[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%eax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%eax,%xmm1,8\),%xmm1
-#pass
diff --git a/gas/testsuite/gas/i386/vgather-check-none.s b/gas/testsuite/gas/i386/vgather-check-none.s
deleted file mode 100644
index cf31039..0000000
--- a/gas/testsuite/gas/i386/vgather-check-none.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.operand_check none
-.include "vgather-check.s"
diff --git a/gas/testsuite/gas/i386/vgather-check-warn.d b/gas/testsuite/gas/i386/vgather-check-warn.d
deleted file mode 100644
index 22be247..0000000
--- a/gas/testsuite/gas/i386/vgather-check-warn.d
+++ /dev/null
@@ -1,15 +0,0 @@
-#source: vgather-check.s
-#stderr: vgather-check-warn.e
-#objdump: -dw
-#name: i386 vgather check (warning)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <vgather>:
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%eax,%xmm1,1\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%eax,%xmm1,2\),%xmm2
-[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%eax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%eax,%xmm1,8\),%xmm1
-#pass
diff --git a/gas/testsuite/gas/i386/vgather-check-warn.e b/gas/testsuite/gas/i386/vgather-check-warn.e
deleted file mode 100644
index 095840b..0000000
--- a/gas/testsuite/gas/i386/vgather-check-warn.e
+++ /dev/null
@@ -1,4 +0,0 @@
-.*: Assembler messages:
-.*:6: Warning: .*
-.*:7: Warning: .*
-.*:8: Warning: .*
diff --git a/gas/testsuite/gas/i386/vgather-check.d b/gas/testsuite/gas/i386/vgather-check.d
deleted file mode 100644
index 25042f4..0000000
--- a/gas/testsuite/gas/i386/vgather-check.d
+++ /dev/null
@@ -1,14 +0,0 @@
-#as: -moperand-check=none
-#objdump: -dw
-#name: i386 vgather check (-moperand-check=none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <vgather>:
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%eax,%xmm1,1\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%eax,%xmm1,2\),%xmm2
-[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%eax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%eax,%xmm1,8\),%xmm1
-#pass
diff --git a/gas/testsuite/gas/i386/vgather-check.s b/gas/testsuite/gas/i386/vgather-check.s
deleted file mode 100644
index c784029..0000000
--- a/gas/testsuite/gas/i386/vgather-check.s
+++ /dev/null
@@ -1,8 +0,0 @@
-# Check vgather instructions
-
- .text
-vgather:
- vgatherdps %xmm2,(%eax,%xmm1,1),%xmm0
- vgatherdps %xmm2,(%eax,%xmm1,2),%xmm2
- vgatherdps %xmm1,(%eax,%xmm1,4),%xmm0
- vgatherdps %xmm2,(%eax,%xmm1,8),%xmm1
diff --git a/gas/testsuite/gas/i386/vgather-scatter-check-error.l b/gas/testsuite/gas/i386/vgather-scatter-check-error.l
new file mode 100644
index 0000000..32e699a
--- /dev/null
+++ b/gas/testsuite/gas/i386/vgather-scatter-check-error.l
@@ -0,0 +1,20 @@
+.*: Assembler messages:
+.*:6: Error: .*
+.*:7: Error: .*
+.*:8: Error: .*
+.*:12: Error: .*
+.*:14: Error: .*
+.*:16: Error: .*
+.*:18: Error: .*
+.*:20: Error: .*
+.*:22: Error: .*
+.*:24: Error: .*
+.*:26: Error: .*
+.*:30: Error: .*
+.*:32: Error: .*
+.*:34: Error: .*
+.*:36: Error: .*
+.*:38: Error: .*
+.*:40: Error: .*
+.*:42: Error: .*
+.*:44: Error: .*
diff --git a/gas/testsuite/gas/i386/vgather-scatter-check-error.s b/gas/testsuite/gas/i386/vgather-scatter-check-error.s
new file mode 100644
index 0000000..cf5787f
--- /dev/null
+++ b/gas/testsuite/gas/i386/vgather-scatter-check-error.s
@@ -0,0 +1 @@
+.include "vgather-scatter-check.s"
diff --git a/gas/testsuite/gas/i386/vgather-scatter-check-none.d b/gas/testsuite/gas/i386/vgather-scatter-check-none.d
new file mode 100644
index 0000000..118cbc1
--- /dev/null
+++ b/gas/testsuite/gas/i386/vgather-scatter-check-none.d
@@ -0,0 +1,14 @@
+#as: -moperand-check=error -I${srcdir}/$subdir
+#objdump: -dw
+#name: i386 vgather/scatter check (.operand_check none)
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <vgather>:
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%eax,%xmm1,1\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%eax,%xmm1,2\),%xmm2
+[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%eax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%eax,%xmm1,8\),%xmm1
+#pass
diff --git a/gas/testsuite/gas/i386/vgather-scatter-check-none.s b/gas/testsuite/gas/i386/vgather-scatter-check-none.s
new file mode 100644
index 0000000..6b71e61
--- /dev/null
+++ b/gas/testsuite/gas/i386/vgather-scatter-check-none.s
@@ -0,0 +1,2 @@
+.operand_check none
+.include "vgather-scatter-check.s"
diff --git a/gas/testsuite/gas/i386/vgather-scatter-check-warn.d b/gas/testsuite/gas/i386/vgather-scatter-check-warn.d
new file mode 100644
index 0000000..1e7c5c3
--- /dev/null
+++ b/gas/testsuite/gas/i386/vgather-scatter-check-warn.d
@@ -0,0 +1,15 @@
+#source: vgather-scatter-check.s
+#stderr: vgather-scatter-check-warn.e
+#objdump: -dw
+#name: i386 vgather/scatter check (warning)
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <vgather>:
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%eax,%xmm1,1\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%eax,%xmm1,2\),%xmm2
+[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%eax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%eax,%xmm1,8\),%xmm1
+#pass
diff --git a/gas/testsuite/gas/i386/vgather-scatter-check-warn.e b/gas/testsuite/gas/i386/vgather-scatter-check-warn.e
new file mode 100644
index 0000000..2fca2ec
--- /dev/null
+++ b/gas/testsuite/gas/i386/vgather-scatter-check-warn.e
@@ -0,0 +1,20 @@
+.*: Assembler messages:
+.*:6: Warning: .*
+.*:7: Warning: .*
+.*:8: Warning: .*
+.*:12: Warning: .*
+.*:14: Warning: .*
+.*:16: Warning: .*
+.*:18: Warning: .*
+.*:20: Warning: .*
+.*:22: Warning: .*
+.*:24: Warning: .*
+.*:26: Warning: .*
+.*:30: Warning: .*
+.*:32: Warning: .*
+.*:34: Warning: .*
+.*:36: Warning: .*
+.*:38: Warning: .*
+.*:40: Warning: .*
+.*:42: Warning: .*
+.*:44: Warning: .*
diff --git a/gas/testsuite/gas/i386/vgather-scatter-check.d b/gas/testsuite/gas/i386/vgather-scatter-check.d
new file mode 100644
index 0000000..8bf487e
--- /dev/null
+++ b/gas/testsuite/gas/i386/vgather-scatter-check.d
@@ -0,0 +1,50 @@
+#as: -moperand-check=none
+#objdump: -dw
+#name: i386 vgather/scatter check (-moperand-check=none)
+
+.*: file format .*
+
+Disassembly of section .text:
+
+00000000 <vgather>:
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%eax,%xmm1,1\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%eax,%xmm1,2\),%xmm2
+[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%eax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%eax,%xmm1,8\),%xmm1
+
+00000018 <avx512vgather>:
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 92 b4 fd 7b 00 00 00[ ]+vgatherdpd 0x7b\(%ebp,%ymm7,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 92 b4 f5 7b 00 00 00[ ]+vgatherdpd 0x7b\(%ebp,%ymm6,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 92 b4 fd 7b 00 00 00[ ]+vgatherdps 0x7b\(%ebp,%zmm7,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 92 b4 f5 7b 00 00 00[ ]+vgatherdps 0x7b\(%ebp,%zmm6,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 93 b4 fd 7b 00 00 00[ ]+vgatherqpd 0x7b\(%ebp,%zmm7,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 93 b4 f5 7b 00 00 00[ ]+vgatherqpd 0x7b\(%ebp,%zmm6,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 93 b4 fd 7b 00 00 00[ ]+vgatherqps 0x7b\(%ebp,%zmm7,8\),%ymm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 93 b4 f5 7b 00 00 00[ ]+vgatherqps 0x7b\(%ebp,%zmm6,8\),%ymm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 90 b4 fd 7b 00 00 00[ ]+vpgatherdd 0x7b\(%ebp,%zmm7,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 90 b4 f5 7b 00 00 00[ ]+vpgatherdd 0x7b\(%ebp,%zmm6,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 90 b4 fd 7b 00 00 00[ ]+vpgatherdq 0x7b\(%ebp,%ymm7,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 90 b4 f5 7b 00 00 00[ ]+vpgatherdq 0x7b\(%ebp,%ymm6,8\),%zmm6\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 91 b4 fd 7b 00 00 00[ ]+vpgatherqd 0x7b\(%ebp,%zmm7,8\),%ymm6\{%k1\}
+[ ]+[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\}
+
+000000c8 <avx512vscatter>:
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 a0 b4 fd 7b 00 00 00[ ]+vpscatterdd %zmm6,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 a0 bc fd 7b 00 00 00[ ]+vpscatterdd %zmm7,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 a0 b4 fd 7b 00 00 00[ ]+vpscatterdq %zmm6,0x7b\(%ebp,%ymm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 a0 bc fd 7b 00 00 00[ ]+vpscatterdq %zmm7,0x7b\(%ebp,%ymm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 a1 b4 fd 7b 00 00 00[ ]+vpscatterqd %ymm6,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 a1 bc fd 7b 00 00 00[ ]+vpscatterqd %ymm7,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 a1 b4 fd 7b 00 00 00[ ]+vpscatterqq %zmm6,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 a1 bc fd 7b 00 00 00[ ]+vpscatterqq %zmm7,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 a2 b4 fd 7b 00 00 00[ ]+vscatterdpd %zmm6,0x7b\(%ebp,%ymm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 a2 bc fd 7b 00 00 00[ ]+vscatterdpd %zmm7,0x7b\(%ebp,%ymm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 a2 b4 fd 7b 00 00 00[ ]+vscatterdps %zmm6,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 a2 bc fd 7b 00 00 00[ ]+vscatterdps %zmm7,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 a3 b4 fd 7b 00 00 00[ ]+vscatterqpd %zmm6,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 fd 49 a3 bc fd 7b 00 00 00[ ]+vscatterqpd %zmm7,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 a3 b4 fd 7b 00 00 00[ ]+vscatterqps %ymm6,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+62 f2 7d 49 a3 bc fd 7b 00 00 00[ ]+vscatterqps %ymm7,0x7b\(%ebp,%zmm7,8\)\{%k1\}
+#pass
diff --git a/gas/testsuite/gas/i386/vgather-scatter-check.s b/gas/testsuite/gas/i386/vgather-scatter-check.s
new file mode 100644
index 0000000..3f8fb0b
--- /dev/null
+++ b/gas/testsuite/gas/i386/vgather-scatter-check.s
@@ -0,0 +1,44 @@
+# Check vgather/scatter instructions
+
+ .text
+vgather:
+ vgatherdps %xmm2,(%eax,%xmm1,1),%xmm0
+ vgatherdps %xmm2,(%eax,%xmm1,2),%xmm2
+ vgatherdps %xmm1,(%eax,%xmm1,4),%xmm0
+ vgatherdps %xmm2,(%eax,%xmm1,8),%xmm1
+
+avx512vgather:
+ vgatherdpd 123(%ebp,%ymm7,8), %zmm6{%k1}
+ vgatherdpd 123(%ebp,%ymm6,8), %zmm6{%k1}
+ vgatherdps 123(%ebp,%zmm7,8), %zmm6{%k1}
+ vgatherdps 123(%ebp,%zmm6,8), %zmm6{%k1}
+ vgatherqpd 123(%ebp,%zmm7,8), %zmm6{%k1}
+ vgatherqpd 123(%ebp,%zmm6,8), %zmm6{%k1}
+ vgatherqps 123(%ebp,%zmm7,8), %ymm6{%k1}
+ vgatherqps 123(%ebp,%zmm6,8), %ymm6{%k1}
+ vpgatherdd 123(%ebp,%zmm7,8), %zmm6{%k1}
+ vpgatherdd 123(%ebp,%zmm6,8), %zmm6{%k1}
+ vpgatherdq 123(%ebp,%ymm7,8), %zmm6{%k1}
+ vpgatherdq 123(%ebp,%ymm6,8), %zmm6{%k1}
+ vpgatherqd 123(%ebp,%zmm7,8), %ymm6{%k1}
+ vpgatherqd 123(%ebp,%zmm6,8), %ymm6{%k1}
+ vpgatherqq 123(%ebp,%zmm7,8), %zmm6{%k1}
+ vpgatherqq 123(%ebp,%zmm6,8), %zmm6{%k1}
+
+avx512vscatter:
+ vpscatterdd %zmm6, 123(%ebp,%zmm7,8){%k1}
+ vpscatterdd %zmm7, 123(%ebp,%zmm7,8){%k1}
+ vpscatterdq %zmm6, 123(%ebp,%ymm7,8){%k1}
+ vpscatterdq %zmm7, 123(%ebp,%ymm7,8){%k1}
+ vpscatterqd %ymm6, 123(%ebp,%zmm7,8){%k1}
+ vpscatterqd %ymm7, 123(%ebp,%zmm7,8){%k1}
+ vpscatterqq %zmm6, 123(%ebp,%zmm7,8){%k1}
+ vpscatterqq %zmm7, 123(%ebp,%zmm7,8){%k1}
+ vscatterdpd %zmm6, 123(%ebp,%ymm7,8){%k1}
+ vscatterdpd %zmm7, 123(%ebp,%ymm7,8){%k1}
+ vscatterdps %zmm6, 123(%ebp,%zmm7,8){%k1}
+ vscatterdps %zmm7, 123(%ebp,%zmm7,8){%k1}
+ vscatterqpd %zmm6, 123(%ebp,%zmm7,8){%k1}
+ vscatterqpd %zmm7, 123(%ebp,%zmm7,8){%k1}
+ vscatterqps %ymm6, 123(%ebp,%zmm7,8){%k1}
+ vscatterqps %ymm7, 123(%ebp,%zmm7,8){%k1}
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-check-error.l b/gas/testsuite/gas/i386/x86-64-vgather-check-error.l
deleted file mode 100644
index d5c7205..0000000
--- a/gas/testsuite/gas/i386/x86-64-vgather-check-error.l
+++ /dev/null
@@ -1,4 +0,0 @@
-.*: Assembler messages:
-.*:6: Error: .*
-.*:8: Error: .*
-.*:10: Error: .*
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-check-error.s b/gas/testsuite/gas/i386/x86-64-vgather-check-error.s
deleted file mode 100644
index f038be2..0000000
--- a/gas/testsuite/gas/i386/x86-64-vgather-check-error.s
+++ /dev/null
@@ -1 +0,0 @@
-.include "x86-64-vgather-check.s"
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-check-none.d b/gas/testsuite/gas/i386/x86-64-vgather-check-none.d
deleted file mode 100644
index e235e00..0000000
--- a/gas/testsuite/gas/i386/x86-64-vgather-check-none.d
+++ /dev/null
@@ -1,17 +0,0 @@
-#as: -moperand-check=error -I${srcdir}/$subdir
-#objdump: -dw
-#name: x86-64 vgather check (.operand_check none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <vgather>:
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%rax,%xmm1,1\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm2
-[ ]*[a-f0-9]+:[ ]+c4 62 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm10
-[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%rax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 31 92 04 88[ ]+vgatherdps %xmm9,\(%rax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm1
-[ ]*[a-f0-9]+:[ ]+c4 62 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm9
-#pass
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-check-none.s b/gas/testsuite/gas/i386/x86-64-vgather-check-none.s
deleted file mode 100644
index 42d0002..0000000
--- a/gas/testsuite/gas/i386/x86-64-vgather-check-none.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.operand_check none
-.include "x86-64-vgather-check.s"
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-check-warn.d b/gas/testsuite/gas/i386/x86-64-vgather-check-warn.d
deleted file mode 100644
index 33846d2..0000000
--- a/gas/testsuite/gas/i386/x86-64-vgather-check-warn.d
+++ /dev/null
@@ -1,18 +0,0 @@
-#source: x86-64-vgather-check.s
-#stderr: x86-64-vgather-check-warn.e
-#objdump: -dw
-#name: x86-64 vgather check (warning)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <vgather>:
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%rax,%xmm1,1\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm2
-[ ]*[a-f0-9]+:[ ]+c4 62 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm10
-[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%rax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 31 92 04 88[ ]+vgatherdps %xmm9,\(%rax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm1
-[ ]*[a-f0-9]+:[ ]+c4 62 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm9
-#pass
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-check-warn.e b/gas/testsuite/gas/i386/x86-64-vgather-check-warn.e
deleted file mode 100644
index 24e6a57..0000000
--- a/gas/testsuite/gas/i386/x86-64-vgather-check-warn.e
+++ /dev/null
@@ -1,4 +0,0 @@
-.*: Assembler messages:
-.*:6: Warning: .*
-.*:8: Warning: .*
-.*:10: Warning: .*
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-check.d b/gas/testsuite/gas/i386/x86-64-vgather-check.d
deleted file mode 100644
index bd8ce57..0000000
--- a/gas/testsuite/gas/i386/x86-64-vgather-check.d
+++ /dev/null
@@ -1,17 +0,0 @@
-#as: -moperand-check=none
-#objdump: -dw
-#name: x86-64 vgather check (-moperand-check=none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <vgather>:
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%rax,%xmm1,1\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm2
-[ ]*[a-f0-9]+:[ ]+c4 62 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm10
-[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%rax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 31 92 04 88[ ]+vgatherdps %xmm9,\(%rax,%xmm1,4\),%xmm0
-[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm1
-[ ]*[a-f0-9]+:[ ]+c4 62 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm9
-#pass
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-check.s b/gas/testsuite/gas/i386/x86-64-vgather-check.s
deleted file mode 100644
index 43b058b..0000000
--- a/gas/testsuite/gas/i386/x86-64-vgather-check.s
+++ /dev/null
@@ -1,11 +0,0 @@
-# Check vgather instructions
-
- .text
-vgather:
- vgatherdps %xmm2,(%rax,%xmm1,1),%xmm0
- vgatherdps %xmm2,(%rax,%xmm1,2),%xmm2
- vgatherdps %xmm2,(%rax,%xmm1,2),%xmm10
- vgatherdps %xmm1,(%rax,%xmm1,4),%xmm0
- vgatherdps %xmm9,(%rax,%xmm1,4),%xmm0
- vgatherdps %xmm2,(%rax,%xmm1,8),%xmm1
- vgatherdps %xmm2,(%rax,%xmm1,8),%xmm9
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-error.l b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-error.l
new file mode 100644
index 0000000..628675f
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-error.l
@@ -0,0 +1,20 @@
+.*: Assembler messages:
+.*:6: Error: .*
+.*:8: Error: .*
+.*:10: Error: .*
+.*:15: Error: .*
+.*:17: Error: .*
+.*:19: Error: .*
+.*:21: Error: .*
+.*:23: Error: .*
+.*:25: Error: .*
+.*:27: Error: .*
+.*:29: Error: .*
+.*:33: Error: .*
+.*:35: Error: .*
+.*:37: Error: .*
+.*:39: Error: .*
+.*:41: Error: .*
+.*:43: Error: .*
+.*:45: Error: .*
+.*:47: Error: .*
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-error.s b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-error.s
new file mode 100644
index 0000000..8cb6c10
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-error.s
@@ -0,0 +1 @@
+.include "x86-64-vgather-scatter-check.s"
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-none.d b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-none.d
new file mode 100644
index 0000000..f9da0c0
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-none.d
@@ -0,0 +1,17 @@
+#as: -moperand-check=error -I${srcdir}/$subdir
+#objdump: -dw
+#name: x86-64 vgather/scatter check (.operand_check none)
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <vgather>:
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%rax,%xmm1,1\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm2
+[ ]*[a-f0-9]+:[ ]+c4 62 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm10
+[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%rax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 31 92 04 88[ ]+vgatherdps %xmm9,\(%rax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm1
+[ ]*[a-f0-9]+:[ ]+c4 62 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm9
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-none.s b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-none.s
new file mode 100644
index 0000000..480bd55
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-none.s
@@ -0,0 +1,2 @@
+.operand_check none
+.include "x86-64-vgather-scatter-check.s"
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-warn.d b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-warn.d
new file mode 100644
index 0000000..8898d4c
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-warn.d
@@ -0,0 +1,18 @@
+#source: x86-64-vgather-scatter-check.s
+#stderr: x86-64-vgather-scatter-check-warn.e
+#objdump: -dw
+#name: x86-64 vgather/scatter check (warning)
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <vgather>:
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%rax,%xmm1,1\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm2
+[ ]*[a-f0-9]+:[ ]+c4 62 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm10
+[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%rax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 31 92 04 88[ ]+vgatherdps %xmm9,\(%rax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm1
+[ ]*[a-f0-9]+:[ ]+c4 62 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm9
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-warn.e b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-warn.e
new file mode 100644
index 0000000..793f4e9
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check-warn.e
@@ -0,0 +1,20 @@
+.*: Assembler messages:
+.*:6: Warning: .*
+.*:8: Warning: .*
+.*:10: Warning: .*
+.*:15: Warning: .*
+.*:17: Warning: .*
+.*:19: Warning: .*
+.*:21: Warning: .*
+.*:23: Warning: .*
+.*:25: Warning: .*
+.*:27: Warning: .*
+.*:29: Warning: .*
+.*:33: Warning: .*
+.*:35: Warning: .*
+.*:37: Warning: .*
+.*:39: Warning: .*
+.*:41: Warning: .*
+.*:43: Warning: .*
+.*:45: Warning: .*
+.*:47: Warning: .*
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-scatter-check.d b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check.d
new file mode 100644
index 0000000..5c81657
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check.d
@@ -0,0 +1,53 @@
+#as: -moperand-check=none
+#objdump: -dw
+#name: x86-64 vgather/scatter check (-moperand-check=none)
+
+.*: file format .*
+
+Disassembly of section .text:
+
+0+ <vgather>:
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 04 08[ ]+vgatherdps %xmm2,\(%rax,%xmm1,1\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm2
+[ ]*[a-f0-9]+:[ ]+c4 62 69 92 14 48[ ]+vgatherdps %xmm2,\(%rax,%xmm1,2\),%xmm10
+[ ]*[a-f0-9]+:[ ]+c4 e2 71 92 04 88[ ]+vgatherdps %xmm1,\(%rax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 31 92 04 88[ ]+vgatherdps %xmm9,\(%rax,%xmm1,4\),%xmm0
+[ ]*[a-f0-9]+:[ ]+c4 e2 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm1
+[ ]*[a-f0-9]+:[ ]+c4 62 69 92 0c c8[ ]+vgatherdps %xmm2,\(%rax,%xmm1,8\),%xmm9
+
+000000000000002a <avx512vgather>:
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 92 84 cd 7b 00 00 00[ ]+vgatherdpd 0x7b\(%ebp,%ymm17,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 92 84 c5 7b 00 00 00[ ]+vgatherdpd 0x7b\(%ebp,%ymm16,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 92 84 cd 7b 00 00 00[ ]+vgatherdps 0x7b\(%ebp,%zmm17,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 92 84 c5 7b 00 00 00[ ]+vgatherdps 0x7b\(%ebp,%zmm16,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 93 84 cd 7b 00 00 00[ ]+vgatherqpd 0x7b\(%ebp,%zmm17,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 93 84 c5 7b 00 00 00[ ]+vgatherqpd 0x7b\(%ebp,%zmm16,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 93 84 cd 7b 00 00 00[ ]+vgatherqps 0x7b\(%ebp,%zmm17,8\),%ymm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 93 84 c5 7b 00 00 00[ ]+vgatherqps 0x7b\(%ebp,%zmm16,8\),%ymm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 90 84 cd 7b 00 00 00[ ]+vpgatherdd 0x7b\(%ebp,%zmm17,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 90 84 c5 7b 00 00 00[ ]+vpgatherdd 0x7b\(%ebp,%zmm16,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 90 84 cd 7b 00 00 00[ ]+vpgatherdq 0x7b\(%ebp,%ymm17,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 90 84 c5 7b 00 00 00[ ]+vpgatherdq 0x7b\(%ebp,%ymm16,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 91 84 cd 7b 00 00 00[ ]+vpgatherqd 0x7b\(%ebp,%zmm17,8\),%ymm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 91 84 c5 7b 00 00 00[ ]+vpgatherqd 0x7b\(%ebp,%zmm16,8\),%ymm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 91 84 cd 7b 00 00 00[ ]+vpgatherqq 0x7b\(%ebp,%zmm17,8\),%zmm16\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 91 84 c5 7b 00 00 00[ ]+vpgatherqq 0x7b\(%ebp,%zmm16,8\),%zmm16\{%k1\}
+
+00000000000000ea <avx512vscatter>:
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 a0 84 cd 7b 00 00 00[ ]+vpscatterdd %zmm16,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 a0 8c cd 7b 00 00 00[ ]+vpscatterdd %zmm17,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 a0 84 cd 7b 00 00 00[ ]+vpscatterdq %zmm16,0x7b\(%ebp,%ymm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 a0 8c cd 7b 00 00 00[ ]+vpscatterdq %zmm17,0x7b\(%ebp,%ymm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 a1 84 cd 7b 00 00 00[ ]+vpscatterqd %ymm16,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 a1 8c cd 7b 00 00 00[ ]+vpscatterqd %ymm17,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 a1 84 cd 7b 00 00 00[ ]+vpscatterqq %zmm16,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 a1 8c cd 7b 00 00 00[ ]+vpscatterqq %zmm17,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 a2 84 cd 7b 00 00 00[ ]+vscatterdpd %zmm16,0x7b\(%ebp,%ymm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 a2 8c cd 7b 00 00 00[ ]+vscatterdpd %zmm17,0x7b\(%ebp,%ymm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 a2 84 cd 7b 00 00 00[ ]+vscatterdps %zmm16,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 a2 8c cd 7b 00 00 00[ ]+vscatterdps %zmm17,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 a3 84 cd 7b 00 00 00[ ]+vscatterqpd %zmm16,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 fd 41 a3 8c cd 7b 00 00 00[ ]+vscatterqpd %zmm17,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 a3 84 cd 7b 00 00 00[ ]+vscatterqps %ymm16,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+[ ]+[a-f0-9]+:[ ]+67 62 e2 7d 41 a3 8c cd 7b 00 00 00[ ]+vscatterqps %ymm17,0x7b\(%ebp,%zmm17,8\)\{%k1\}
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-vgather-scatter-check.s b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check.s
new file mode 100644
index 0000000..7e40211
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-vgather-scatter-check.s
@@ -0,0 +1,47 @@
+# Check vgather/scatter instructions
+
+ .text
+vgather:
+ vgatherdps %xmm2,(%rax,%xmm1,1),%xmm0
+ vgatherdps %xmm2,(%rax,%xmm1,2),%xmm2
+ vgatherdps %xmm2,(%rax,%xmm1,2),%xmm10
+ vgatherdps %xmm1,(%rax,%xmm1,4),%xmm0
+ vgatherdps %xmm9,(%rax,%xmm1,4),%xmm0
+ vgatherdps %xmm2,(%rax,%xmm1,8),%xmm1
+ vgatherdps %xmm2,(%rax,%xmm1,8),%xmm9
+
+avx512vgather:
+ vgatherdpd 123(%ebp,%ymm17,8), %zmm16{%k1}
+ vgatherdpd 123(%ebp,%ymm16,8), %zmm16{%k1}
+ vgatherdps 123(%ebp,%zmm17,8), %zmm16{%k1}
+ vgatherdps 123(%ebp,%zmm16,8), %zmm16{%k1}
+ vgatherqpd 123(%ebp,%zmm17,8), %zmm16{%k1}
+ vgatherqpd 123(%ebp,%zmm16,8), %zmm16{%k1}
+ vgatherqps 123(%ebp,%zmm17,8), %ymm16{%k1}
+ vgatherqps 123(%ebp,%zmm16,8), %ymm16{%k1}
+ vpgatherdd 123(%ebp,%zmm17,8), %zmm16{%k1}
+ vpgatherdd 123(%ebp,%zmm16,8), %zmm16{%k1}
+ vpgatherdq 123(%ebp,%ymm17,8), %zmm16{%k1}
+ vpgatherdq 123(%ebp,%ymm16,8), %zmm16{%k1}
+ vpgatherqd 123(%ebp,%zmm17,8), %ymm16{%k1}
+ vpgatherqd 123(%ebp,%zmm16,8), %ymm16{%k1}
+ vpgatherqq 123(%ebp,%zmm17,8), %zmm16{%k1}
+ vpgatherqq 123(%ebp,%zmm16,8), %zmm16{%k1}
+
+avx512vscatter:
+ vpscatterdd %zmm16, 123(%ebp,%zmm17,8){%k1}
+ vpscatterdd %zmm17, 123(%ebp,%zmm17,8){%k1}
+ vpscatterdq %zmm16, 123(%ebp,%ymm17,8){%k1}
+ vpscatterdq %zmm17, 123(%ebp,%ymm17,8){%k1}
+ vpscatterqd %ymm16, 123(%ebp,%zmm17,8){%k1}
+ vpscatterqd %ymm17, 123(%ebp,%zmm17,8){%k1}
+ vpscatterqq %zmm16, 123(%ebp,%zmm17,8){%k1}
+ vpscatterqq %zmm17, 123(%ebp,%zmm17,8){%k1}
+ vscatterdpd %zmm16, 123(%ebp,%ymm17,8){%k1}
+ vscatterdpd %zmm17, 123(%ebp,%ymm17,8){%k1}
+ vscatterdps %zmm16, 123(%ebp,%zmm17,8){%k1}
+ vscatterdps %zmm17, 123(%ebp,%zmm17,8){%k1}
+ vscatterqpd %zmm16, 123(%ebp,%zmm17,8){%k1}
+ vscatterqpd %zmm17, 123(%ebp,%zmm17,8){%k1}
+ vscatterqps %ymm16, 123(%ebp,%zmm17,8){%k1}
+ vscatterqps %ymm17, 123(%ebp,%zmm17,8){%k1}