This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] PR gas/16488: Add test for incorrect memory operand for gather/scatter instructions.
- From: "Michael V. Zolotukhin" <michael dot v dot zolotukhin at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, Jan Beulich <JBeulich at suse dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 31 Jan 2014 14:09:41 +0400
- Subject: [PATCH] PR gas/16488: Add test for incorrect memory operand for gather/scatter instructions.
- Authentication-results: sourceware.org; auth=none
Hi,
This patch adds test for incorrect memory operand for gather/scatter
instructions, thusly fixing PR16488. Ok for trunk?
gas/testsuite/ChangeLog:
2014-01-31 Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
PR gas/16488
* gas/i386/inval-avx512f.s: Add test for incorrect memory operand for
gather/scatter instructions.
* gas/i386/x86-64-inval-avx512f.s: Likewise.
* gas/i386/inval-avx512f.l: Adjust correspondingly.
* gas/i386/x86-64-inval-avx512f.l: Likewise.
Thanks,
Michael
diff --git a/gas/testsuite/gas/i386/inval-avx512f.l b/gas/testsuite/gas/i386/inval-avx512f.l
index 6c525f0..1f8c414 100644
--- a/gas/testsuite/gas/i386/inval-avx512f.l
+++ b/gas/testsuite/gas/i386/inval-avx512f.l
@@ -10,27 +10,30 @@
.*:14: Error: .*
.*:15: Error: .*
.*:17: Error: .*
-.*:20: Error: .*
-.*:21: Error: .*
+.*:18: Error: .*
+.*:19: Error: .*
.*:22: Error: .*
.*:23: Error: .*
-.*:23: Error: .*
-.*:24: Error: .*
.*:24: Error: .*
.*:25: Error: .*
.*:25: Error: .*
+.*:26: Error: .*
+.*:26: Error: .*
+.*:27: Error: .*
.*:27: Error: .*
-.*:28: Error: .*
+.*:29: Error: .*
.*:30: Error: .*
-.*:31: Error: .*
+.*:32: Error: .*
.*:33: Error: .*
.*:35: Error: .*
.*:36: Error: .*
-.*:37: Error: .*
.*:38: Error: .*
.*:39: Error: .*
.*:40: Error: .*
.*:41: Error: .*
+.*:42: Error: .*
+.*:43: Error: .*
+.*:44: Error: .*
GAS LISTING .*
@@ -51,27 +54,30 @@ GAS LISTING .*
[ ]*15[ ]+vcvtps2pd \(%eax\)\{z\}, %zmm1
[ ]*16[ ]+
[ ]*17[ ]+vgatherqpd \(%rdi,%zmm2,8\),%zmm6
-[ ]*18[ ]+
-[ ]*19[ ]+\.intel_syntax noprefix
-[ ]*20[ ]+mov eax\{k1\}, \{sae\}
-[ ]*21[ ]+mov eax, \{sae\}
-[ ]*22[ ]+mov eax\{k2\}, ebx
-[ ]*23[ ]+vaddps zmm2\{z\}\{k1\}\{z\}, zmm1, zmm3
-[ ]*24[ ]+vaddps zmm2\{z\}, zmm1\{k3\}, zmm3
-[ ]*25[ ]+vaddps zmm2\{k2\}, zmm1\{k1\}, zmm3
-[ ]*26[ ]+
-[ ]*27[ ]+vcvtps2pd zmm1\{1to8\}, \[eax\]
-[ ]*28[ ]+vcvtps2pd zmm1, \[eax\]\{1to16\}
-[ ]*29[ ]+
-[ ]*30[ ]+vcvtps2pd zmm1, \[eax\]\{k1\}
-[ ]*31[ ]+vcvtps2pd zmm1, \[eax\]\{z\}
-[ ]*32[ ]+
-[ ]*33[ ]+vgatherqpd zmm6, ZMMWORD PTR \[rdi\+zmm2\*8\]
+[ ]*18[ ]+vgatherqpd \(%edi\),%zmm6\{%k1\}
+[ ]*19[ ]+vgatherqpd \(%zmm2\),%zmm6\{%k1\}
+[ ]*20[ ]+
+[ ]*21[ ]+\.intel_syntax noprefix
+[ ]*22[ ]+mov eax\{k1\}, \{sae\}
+[ ]*23[ ]+mov eax, \{sae\}
+[ ]*24[ ]+mov eax\{k2\}, ebx
+[ ]*25[ ]+vaddps zmm2\{z\}\{k1\}\{z\}, zmm1, zmm3
+[ ]*26[ ]+vaddps zmm2\{z\}, zmm1\{k3\}, zmm3
+[ ]*27[ ]+vaddps zmm2\{k2\}, zmm1\{k1\}, zmm3
+[ ]*28[ ]+
+[ ]*29[ ]+vcvtps2pd zmm1\{1to8\}, \[eax\]
+[ ]*30[ ]+vcvtps2pd zmm1, \[eax\]\{1to16\}
+[ ]*31[ ]+
+[ ]*32[ ]+vcvtps2pd zmm1, \[eax\]\{k1\}
+[ ]*33[ ]+vcvtps2pd zmm1, \[eax\]\{z\}
[ ]*34[ ]+
-[ ]*35[ ]+vaddps zmm2, zmm1, QWORD PTR \[eax\]\{1to8\}
-[ ]*36[ ]+vaddps zmm2, zmm1, QWORD PTR \[eax\]\{1to16\}
-[ ]*37[ ]+vaddpd zmm2, zmm1, DWORD PTR \[eax\]\{1to8\}
-[ ]*38[ ]+vaddpd zmm2, zmm1, DWORD PTR \[eax\]\{1to16\}
-[ ]*39[ ]+vaddps zmm2, zmm1, ZMMWORD PTR \[eax\]\{1to16\}
-[ ]*40[ ]+vaddps zmm2, zmm1, DWORD PTR \[eax\]
-[ ]*41[ ]+vaddpd zmm2, zmm1, QWORD PTR \[eax\]
+[ ]*35[ ]+vgatherqpd zmm6, ZMMWORD PTR \[rdi\+zmm2\*8\]
+[ ]*36[ ]+vgatherqpd zmm6\{k1\}, ZMMWORD PTR \[edi\]
+[ ]*37[ ]+
+[ ]*38[ ]+vaddps zmm2, zmm1, QWORD PTR \[eax\]\{1to8\}
+[ ]*39[ ]+vaddps zmm2, zmm1, QWORD PTR \[eax\]\{1to16\}
+[ ]*40[ ]+vaddpd zmm2, zmm1, DWORD PTR \[eax\]\{1to8\}
+[ ]*41[ ]+vaddpd zmm2, zmm1, DWORD PTR \[eax\]\{1to16\}
+[ ]*42[ ]+vaddps zmm2, zmm1, ZMMWORD PTR \[eax\]\{1to16\}
+[ ]*43[ ]+vaddps zmm2, zmm1, DWORD PTR \[eax\]
+[ ]*44[ ]+vaddpd zmm2, zmm1, QWORD PTR \[eax\]
diff --git a/gas/testsuite/gas/i386/inval-avx512f.s b/gas/testsuite/gas/i386/inval-avx512f.s
index b1ddba4..7c9b1d6 100644
--- a/gas/testsuite/gas/i386/inval-avx512f.s
+++ b/gas/testsuite/gas/i386/inval-avx512f.s
@@ -15,6 +15,8 @@ _start:
vcvtps2pd (%eax){z}, %zmm1
vgatherqpd (%rdi,%zmm2,8),%zmm6
+ vgatherqpd (%edi),%zmm6{%k1}
+ vgatherqpd (%zmm2),%zmm6{%k1}
.intel_syntax noprefix
mov eax{k1}, {sae}
@@ -31,6 +33,7 @@ _start:
vcvtps2pd zmm1, [eax]{z}
vgatherqpd zmm6, ZMMWORD PTR [rdi+zmm2*8]
+ vgatherqpd zmm6{k1}, ZMMWORD PTR [edi]
vaddps zmm2, zmm1, QWORD PTR [eax]{1to8}
vaddps zmm2, zmm1, QWORD PTR [eax]{1to16}
diff --git a/gas/testsuite/gas/i386/x86-64-inval-avx512f.l b/gas/testsuite/gas/i386/x86-64-inval-avx512f.l
index 436acb0..7d14549 100644
--- a/gas/testsuite/gas/i386/x86-64-inval-avx512f.l
+++ b/gas/testsuite/gas/i386/x86-64-inval-avx512f.l
@@ -9,26 +9,29 @@
.*:12: Error: .*
.*:14: Error: .*
.*:15: Error: .*
+.*:17: Error: .*
.*:18: Error: .*
-.*:19: Error: .*
-.*:20: Error: .*
.*:21: Error: .*
-.*:21: Error: .*
-.*:22: Error: .*
.*:22: Error: .*
.*:23: Error: .*
-.*:23: Error: .*
+.*:24: Error: .*
+.*:24: Error: .*
.*:25: Error: .*
+.*:25: Error: .*
+.*:26: Error: .*
.*:26: Error: .*
.*:28: Error: .*
.*:29: Error: .*
.*:31: Error: .*
.*:32: Error: .*
-.*:33: Error: .*
.*:34: Error: .*
-.*:35: Error: .*
.*:36: Error: .*
.*:37: Error: .*
+.*:38: Error: .*
+.*:39: Error: .*
+.*:40: Error: .*
+.*:41: Error: .*
+.*:42: Error: .*
GAS LISTING .*
@@ -48,24 +51,29 @@ GAS LISTING .*
[ ]*14[ ]+vcvtps2pd \(%rax\)\{%k1\}, %zmm1
[ ]*15[ ]+vcvtps2pd \(%rax\)\{z\}, %zmm1
[ ]*16[ ]+
-[ ]*17[ ]+\.intel_syntax noprefix
-[ ]*18[ ]+mov rax\{k1\}, \{sae\}
-[ ]*19[ ]+mov rax, \{sae\}
-[ ]*20[ ]+mov rax\{k2\}, rbx
-[ ]*21[ ]+vaddps zmm2\{z\}\{k1\}\{z\}, zmm1, zmm3
-[ ]*22[ ]+vaddps zmm2\{z\}, zmm1\{k3\}, zmm3
-[ ]*23[ ]+vaddps zmm2\{k2\}, zmm1\{k1\}, zmm3
-[ ]*24[ ]+
-[ ]*25[ ]+vcvtps2pd zmm1\{1to8\}, \[rax\]
-[ ]*26[ ]+vcvtps2pd zmm1, \[rax\]\{1to16\}
+[ ]*17[ ]+vgatherqpd \(%rdi\),%zmm6\{%k1\}
+[ ]*18[ ]+vgatherqpd \(%zmm2\),%zmm6\{%k1\}
+[ ]*19[ ]+
+[ ]*20[ ]+\.intel_syntax noprefix
+[ ]*21[ ]+mov rax\{k1\}, \{sae\}
+[ ]*22[ ]+mov rax, \{sae\}
+[ ]*23[ ]+mov rax\{k2\}, rbx
+[ ]*24[ ]+vaddps zmm2\{z\}\{k1\}\{z\}, zmm1, zmm3
+[ ]*25[ ]+vaddps zmm2\{z\}, zmm1\{k3\}, zmm3
+[ ]*26[ ]+vaddps zmm2\{k2\}, zmm1\{k1\}, zmm3
[ ]*27[ ]+
-[ ]*28[ ]+vcvtps2pd zmm1, \[rax\]\{k1\}
-[ ]*29[ ]+vcvtps2pd zmm1, \[rax\]\{z\}
+[ ]*28[ ]+vcvtps2pd zmm1\{1to8\}, \[rax\]
+[ ]*29[ ]+vcvtps2pd zmm1, \[rax\]\{1to16\}
[ ]*30[ ]+
-[ ]*31[ ]+vaddps zmm2, zmm1, QWORD PTR \[rax\]\{1to8\}
-[ ]*32[ ]+vaddps zmm2, zmm1, QWORD PTR \[rax\]\{1to16\}
-[ ]*33[ ]+vaddpd zmm2, zmm1, DWORD PTR \[rax\]\{1to8\}
-[ ]*34[ ]+vaddpd zmm2, zmm1, DWORD PTR \[rax\]\{1to16\}
-[ ]*35[ ]+vaddps zmm2, zmm1, ZMMWORD PTR \[rax\]\{1to16\}
-[ ]*36[ ]+vaddps zmm2, zmm1, DWORD PTR \[rax\]
-[ ]*37[ ]+vaddpd zmm2, zmm1, QWORD PTR \[rax\]
+[ ]*31[ ]+vcvtps2pd zmm1, \[rax\]\{k1\}
+[ ]*32[ ]+vcvtps2pd zmm1, \[rax\]\{z\}
+[ ]*33[ ]+
+[ ]*34[ ]+vgatherqpd zmm6\{k1\}, ZMMWORD PTR \[rdi\]
+[ ]*35[ ]+
+[ ]*36[ ]+vaddps zmm2, zmm1, QWORD PTR \[rax\]\{1to8\}
+[ ]*37[ ]+vaddps zmm2, zmm1, QWORD PTR \[rax\]\{1to16\}
+[ ]*38[ ]+vaddpd zmm2, zmm1, DWORD PTR \[rax\]\{1to8\}
+[ ]*39[ ]+vaddpd zmm2, zmm1, DWORD PTR \[rax\]\{1to16\}
+[ ]*40[ ]+vaddps zmm2, zmm1, ZMMWORD PTR \[rax\]\{1to16\}
+[ ]*41[ ]+vaddps zmm2, zmm1, DWORD PTR \[rax\]
+[ ]*42[ ]+vaddpd zmm2, zmm1, QWORD PTR \[rax\]
diff --git a/gas/testsuite/gas/i386/x86-64-inval-avx512f.s b/gas/testsuite/gas/i386/x86-64-inval-avx512f.s
index 5ac7349..9e8823e 100644
--- a/gas/testsuite/gas/i386/x86-64-inval-avx512f.s
+++ b/gas/testsuite/gas/i386/x86-64-inval-avx512f.s
@@ -14,6 +14,9 @@ _start:
vcvtps2pd (%rax){%k1}, %zmm1
vcvtps2pd (%rax){z}, %zmm1
+ vgatherqpd (%rdi),%zmm6{%k1}
+ vgatherqpd (%zmm2),%zmm6{%k1}
+
.intel_syntax noprefix
mov rax{k1}, {sae}
mov rax, {sae}
@@ -28,6 +31,8 @@ _start:
vcvtps2pd zmm1, [rax]{k1}
vcvtps2pd zmm1, [rax]{z}
+ vgatherqpd zmm6{k1}, ZMMWORD PTR [rdi]
+
vaddps zmm2, zmm1, QWORD PTR [rax]{1to8}
vaddps zmm2, zmm1, QWORD PTR [rax]{1to16}
vaddpd zmm2, zmm1, DWORD PTR [rax]{1to8}