aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-05-25 14:59:05 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-05-25 15:04:47 -0700
commit73b090a922a5f43931f0ec10b1b1b9507c819ebf (patch)
tree5bba976cde7426337f2a2a5c04958618cd0713fb /gas
parentde341542a60f7d3a80cc339db7d341b615cfa52f (diff)
downloadgdb-73b090a922a5f43931f0ec10b1b1b9507c819ebf.zip
gdb-73b090a922a5f43931f0ec10b1b1b9507c819ebf.tar.gz
gdb-73b090a922a5f43931f0ec10b1b1b9507c819ebf.tar.bz2
Require another match for AVX512VL
The AVX512VL bit alone isn't sufficient to select a 128-bit or 256-bit AVX512 instruction. We must match another AVX512 bit. PR gas/20140 * config/tc-i386.c (cpu_flags_match): Require another match for AVX512VL. * testsuite/gas/i386/i386.exp: Run avx512vl-1, avx512vl-2, x86-64-avx512vl-1 and x86-64-avx512vl-2. * testsuite/gas/i386/avx512vl-1.l: New file. * testsuite/gas/i386/avx512vl-1.s: Likewise. * testsuite/gas/i386/avx512vl-2.l: Likewise. * testsuite/gas/i386/avx512vl-2.s: Likewise. * testsuite/gas/i386/x86-64-avx512vl-1.l: Likewise. * testsuite/gas/i386/x86-64-avx512vl-1.s: Likewise. * testsuite/gas/i386/x86-64-avx512vl-2.l: Likewise. * testsuite/gas/i386/x86-64-avx512vl-2.s: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog16
-rw-r--r--gas/config/tc-i386.c15
-rw-r--r--gas/testsuite/gas/i386/avx512vl-1.l39
-rw-r--r--gas/testsuite/gas/i386/avx512vl-1.s24
-rw-r--r--gas/testsuite/gas/i386/avx512vl-2.l27
-rw-r--r--gas/testsuite/gas/i386/avx512vl-2.s15
-rw-r--r--gas/testsuite/gas/i386/i386.exp4
-rw-r--r--gas/testsuite/gas/i386/x86-64-avx512vl-1.l39
-rw-r--r--gas/testsuite/gas/i386/x86-64-avx512vl-1.s24
-rw-r--r--gas/testsuite/gas/i386/x86-64-avx512vl-2.l27
-rw-r--r--gas/testsuite/gas/i386/x86-64-avx512vl-2.s15
11 files changed, 245 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2d23b43..da0cdc0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,21 @@
2016-05-25 H.J. Lu <hongjiu.lu@intel.com>
+ PR gas/20140
+ * config/tc-i386.c (cpu_flags_match): Require another match
+ for AVX512VL.
+ * testsuite/gas/i386/i386.exp: Run avx512vl-1, avx512vl-2,
+ x86-64-avx512vl-1 and x86-64-avx512vl-2.
+ * testsuite/gas/i386/avx512vl-1.l: New file.
+ * testsuite/gas/i386/avx512vl-1.s: Likewise.
+ * testsuite/gas/i386/avx512vl-2.l: Likewise.
+ * testsuite/gas/i386/avx512vl-2.s: Likewise.
+ * testsuite/gas/i386/x86-64-avx512vl-1.l: Likewise.
+ * testsuite/gas/i386/x86-64-avx512vl-1.s: Likewise.
+ * testsuite/gas/i386/x86-64-avx512vl-2.l: Likewise.
+ * testsuite/gas/i386/x86-64-avx512vl-2.s: Likewise.
+
+2016-05-25 H.J. Lu <hongjiu.lu@intel.com>
+
PR gas/20141
* testsuite/gas/i386/i386.exp: Run x86-64-pr20141.
* testsuite/gas/i386/x86-64-pr20141.d: New file.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 13041ea..af94f72 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1564,6 +1564,21 @@ cpu_flags_match (const insn_template *t)
else
match |= CPU_FLAGS_ARCH_MATCH;
}
+ else if (x.bitfield.cpuavx512vl)
+ {
+ /* Match AVX512VL. */
+ if (cpu.bitfield.cpuavx512vl)
+ {
+ /* Need another match. */
+ cpu.bitfield.cpuavx512vl = 0;
+ if (!cpu_flags_all_zero (&cpu))
+ match |= CPU_FLAGS_32BIT_MATCH;
+ else
+ match |= CPU_FLAGS_ARCH_MATCH;
+ }
+ else
+ match |= CPU_FLAGS_ARCH_MATCH;
+ }
else
match |= CPU_FLAGS_32BIT_MATCH;
}
diff --git a/gas/testsuite/gas/i386/avx512vl-1.l b/gas/testsuite/gas/i386/avx512vl-1.l
new file mode 100644
index 0000000..183c21d
--- /dev/null
+++ b/gas/testsuite/gas/i386/avx512vl-1.l
@@ -0,0 +1,39 @@
+.*: Assembler messages:
+.*:7: Error: .*bad register name.*
+.*:8: Error: .*corei7\.avx.*
+.*:9: Error: .*corei7\.avx.*
+.*:10: Error: .*corei7\.avx.*
+.*:15: Error: .*unsupported.*
+.*:16: Error: .*unsupported.*
+GAS LISTING .*
+#...
+[ ]*1[ ]+\.text
+[ ]*2[ ]+\.arch corei7
+[ ]*3[ ]+_start:
+[ ]*4[ ]+\.arch \.avx
+[ ]*5[ ]+\?\?\?\? C5F9E711 vmovntdq %xmm2, \(%ecx\)
+[ ]*6[ ]+\?\?\?\? C5FDE711 vmovntdq %ymm2, \(%ecx\)
+[ ]*7[ ]+vmovntdq %zmm2, \(%ecx\)
+[ ]*8[ ]+vpternlogq \$0xab, %xmm6, %xmm2, %xmm0
+[ ]*9[ ]+vpternlogq \$0xab, %ymm6, %ymm2, %ymm0
+[ ]*10[ ]+vpternlogq \$0xab, %zmm6, %zmm2, %zmm0
+[ ]*11[ ]+\.arch \.avx512f
+[ ]*12[ ]+\?\?\?\? C5F9E701 vmovntdq %xmm0, \(%ecx\)
+[ ]*13[ ]+\?\?\?\? C5FDE701 vmovntdq %ymm0, \(%ecx\)
+[ ]*14[ ]+\?\?\?\? 62F17D48 vmovntdq %zmm0, \(%ecx\)
+[ ]*14[ ]+E701
+[ ]*15[ ]+vpternlogq \$0xab, %xmm6, %xmm2, %xmm0
+[ ]*16[ ]+vpternlogq \$0xab, %ymm6, %ymm2, %ymm0
+[ ]*17[ ]+\?\?\?\? 62F3ED48 vpternlogq \$0xab, %zmm6, %zmm2, %zmm0
+[ ]*17[ ]+25C6AB
+[ ]*18[ ]+\.arch \.avx512vl
+[ ]*19[ ]+\?\?\?\? C5F9E701 vmovntdq %xmm0, \(%ecx\)
+[ ]*20[ ]+\?\?\?\? C5FDE701 vmovntdq %ymm0, \(%ecx\)
+[ ]*21[ ]+\?\?\?\? 62F17D48 vmovntdq %zmm0, \(%ecx\)
+[ ]*21[ ]+E701
+[ ]*22[ ]+\?\?\?\? 62F3ED08 vpternlogq \$0xab, %xmm6, %xmm2, %xmm0
+[ ]*22[ ]+25C6AB
+[ ]*23[ ]+\?\?\?\? 62F3ED28 vpternlogq \$0xab, %ymm6, %ymm2, %ymm0
+[ ]*23[ ]+25C6AB
+[ ]*24[ ]+\?\?\?\? 62F3ED48 vpternlogq \$0xab, %zmm6, %zmm2, %zmm0
+[ ]*24[ ]+25C6AB
diff --git a/gas/testsuite/gas/i386/avx512vl-1.s b/gas/testsuite/gas/i386/avx512vl-1.s
new file mode 100644
index 0000000..62bae08
--- /dev/null
+++ b/gas/testsuite/gas/i386/avx512vl-1.s
@@ -0,0 +1,24 @@
+ .text
+ .arch corei7
+_start:
+ .arch .avx
+ vmovntdq %xmm2, (%ecx)
+ vmovntdq %ymm2, (%ecx)
+ vmovntdq %zmm2, (%ecx)
+ vpternlogq $0xab, %xmm6, %xmm2, %xmm0
+ vpternlogq $0xab, %ymm6, %ymm2, %ymm0
+ vpternlogq $0xab, %zmm6, %zmm2, %zmm0
+ .arch .avx512f
+ vmovntdq %xmm0, (%ecx)
+ vmovntdq %ymm0, (%ecx)
+ vmovntdq %zmm0, (%ecx)
+ vpternlogq $0xab, %xmm6, %xmm2, %xmm0
+ vpternlogq $0xab, %ymm6, %ymm2, %ymm0
+ vpternlogq $0xab, %zmm6, %zmm2, %zmm0
+ .arch .avx512vl
+ vmovntdq %xmm0, (%ecx)
+ vmovntdq %ymm0, (%ecx)
+ vmovntdq %zmm0, (%ecx)
+ vpternlogq $0xab, %xmm6, %xmm2, %xmm0
+ vpternlogq $0xab, %ymm6, %ymm2, %ymm0
+ vpternlogq $0xab, %zmm6, %zmm2, %zmm0
diff --git a/gas/testsuite/gas/i386/avx512vl-2.l b/gas/testsuite/gas/i386/avx512vl-2.l
new file mode 100644
index 0000000..2f1f7b3
--- /dev/null
+++ b/gas/testsuite/gas/i386/avx512vl-2.l
@@ -0,0 +1,27 @@
+.*: Assembler messages:
+.*:5: Error: .*corei7.*
+.*:6: Error: .*corei7.*
+.*:7: Error: .*corei7.*
+.*:9: Error: .*corei7\.avx\.avx512vl.*
+.*:10: Error: .*corei7\.avx\.avx512vl.*
+.*:11: Error: .*corei7\.avx\.avx512vl.*
+GAS LISTING .*
+#...
+[ ]*1[ ]+\.text
+[ ]*2[ ]+\.arch corei7
+[ ]*3[ ]+_start:
+[ ]*4[ ]+\.arch \.avx
+[ ]*5[ ]+vpconflictd %xmm0, %xmm5
+[ ]*6[ ]+vpconflictd %ymm0, %ymm5
+[ ]*7[ ]+vpconflictd %ymm0, %zmm5
+[ ]*8[ ]+\.arch \.avx512vl
+[ ]*9[ ]+vpconflictd %xmm0, %xmm5
+[ ]*10[ ]+vpconflictd %ymm0, %ymm5
+[ ]*11[ ]+vpconflictd %zmm0, %zmm5
+[ ]*12[ ]+\.arch \.avx512cd
+[ ]*13[ ]+\?\?\?\? 62F27D08 vpconflictd %xmm0, %xmm5
+[ ]*13[ ]+C4E8
+[ ]*14[ ]+\?\?\?\? 62F27D28 vpconflictd %ymm0, %ymm5
+[ ]*14[ ]+C4E8
+[ ]*15[ ]+\?\?\?\? 62F27D48 vpconflictd %zmm0, %zmm5
+[ ]*15[ ]+C4E8
diff --git a/gas/testsuite/gas/i386/avx512vl-2.s b/gas/testsuite/gas/i386/avx512vl-2.s
new file mode 100644
index 0000000..6a24a1f
--- /dev/null
+++ b/gas/testsuite/gas/i386/avx512vl-2.s
@@ -0,0 +1,15 @@
+ .text
+ .arch corei7
+_start:
+ .arch .avx
+ vpconflictd %xmm0, %xmm5
+ vpconflictd %ymm0, %ymm5
+ vpconflictd %ymm0, %zmm5
+ .arch .avx512vl
+ vpconflictd %xmm0, %xmm5
+ vpconflictd %ymm0, %ymm5
+ vpconflictd %zmm0, %zmm5
+ .arch .avx512cd
+ vpconflictd %xmm0, %xmm5
+ vpconflictd %ymm0, %ymm5
+ vpconflictd %zmm0, %zmm5
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 1aca467..624674d 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -356,6 +356,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "ospke"
run_dump_test "rdpid"
run_dump_test "rdpid-intel"
+ run_list_test "avx512vl-1" "-al"
+ run_list_test "avx512vl-2" "-al"
# These tests require support for 8 and 16 bit relocs,
# so we only run them for ELF and COFF targets.
@@ -754,6 +756,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-fence-as-lock-add-yes"
run_dump_test "x86-64-fence-as-lock-add-no"
run_dump_test "x86-64-pr20141"
+ run_list_test "x86-64-avx512vl-1" "-al"
+ run_list_test "x86-64-avx512vl-2" "-al"
if { ![istarget "*-*-aix*"]
&& ![istarget "*-*-beos*"]
diff --git a/gas/testsuite/gas/i386/x86-64-avx512vl-1.l b/gas/testsuite/gas/i386/x86-64-avx512vl-1.l
new file mode 100644
index 0000000..c5982e7
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-avx512vl-1.l
@@ -0,0 +1,39 @@
+.*: Assembler messages:
+.*:7: Error: .*bad register name.*
+.*:8: Error: .*corei7\.avx.*
+.*:9: Error: .*corei7\.avx.*
+.*:10: Error: .*corei7\.avx.*
+.*:15: Error: .*unsupported.*
+.*:16: Error: .*unsupported.*
+GAS LISTING .*
+#...
+[ ]*1[ ]+\.text
+[ ]*2[ ]+\.arch corei7
+[ ]*3[ ]+_start:
+[ ]*4[ ]+\.arch \.avx
+[ ]*5[ ]+\?\?\?\? C5F9E711 vmovntdq %xmm2, \(%rcx\)
+[ ]*6[ ]+\?\?\?\? C5FDE711 vmovntdq %ymm2, \(%rcx\)
+[ ]*7[ ]+vmovntdq %zmm2, \(%rcx\)
+[ ]*8[ ]+vpternlogq \$0xab, %xmm16, %xmm2, %xmm0
+[ ]*9[ ]+vpternlogq \$0xab, %ymm16, %ymm2, %ymm0
+[ ]*10[ ]+vpternlogq \$0xab, %zmm16, %zmm2, %zmm0
+[ ]*11[ ]+\.arch \.avx512f
+[ ]*12[ ]+\?\?\?\? C5F9E701 vmovntdq %xmm0, \(%rcx\)
+[ ]*13[ ]+\?\?\?\? C5FDE701 vmovntdq %ymm0, \(%rcx\)
+[ ]*14[ ]+\?\?\?\? 62F17D48 vmovntdq %zmm0, \(%rcx\)
+[ ]*14[ ]+E701
+[ ]*15[ ]+vpternlogq \$0xab, %xmm16, %xmm2, %xmm0
+[ ]*16[ ]+vpternlogq \$0xab, %ymm16, %ymm2, %ymm0
+[ ]*17[ ]+\?\?\?\? 62B3ED48 vpternlogq \$0xab, %zmm16, %zmm2, %zmm0
+[ ]*17[ ]+25C0AB
+[ ]*18[ ]+\.arch \.avx512vl
+[ ]*19[ ]+\?\?\?\? C5F9E701 vmovntdq %xmm0, \(%rcx\)
+[ ]*20[ ]+\?\?\?\? C5FDE701 vmovntdq %ymm0, \(%rcx\)
+[ ]*21[ ]+\?\?\?\? 62F17D48 vmovntdq %zmm0, \(%rcx\)
+[ ]*21[ ]+E701
+[ ]*22[ ]+\?\?\?\? 62B3ED08 vpternlogq \$0xab, %xmm16, %xmm2, %xmm0
+[ ]*22[ ]+25C0AB
+[ ]*23[ ]+\?\?\?\? 62B3ED28 vpternlogq \$0xab, %ymm16, %ymm2, %ymm0
+[ ]*23[ ]+25C0AB
+[ ]*24[ ]+\?\?\?\? 62B3ED48 vpternlogq \$0xab, %zmm16, %zmm2, %zmm0
+[ ]*24[ ]+25C0AB
diff --git a/gas/testsuite/gas/i386/x86-64-avx512vl-1.s b/gas/testsuite/gas/i386/x86-64-avx512vl-1.s
new file mode 100644
index 0000000..8a5f2f9
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-avx512vl-1.s
@@ -0,0 +1,24 @@
+ .text
+ .arch corei7
+_start:
+ .arch .avx
+ vmovntdq %xmm2, (%rcx)
+ vmovntdq %ymm2, (%rcx)
+ vmovntdq %zmm2, (%rcx)
+ vpternlogq $0xab, %xmm16, %xmm2, %xmm0
+ vpternlogq $0xab, %ymm16, %ymm2, %ymm0
+ vpternlogq $0xab, %zmm16, %zmm2, %zmm0
+ .arch .avx512f
+ vmovntdq %xmm0, (%rcx)
+ vmovntdq %ymm0, (%rcx)
+ vmovntdq %zmm0, (%rcx)
+ vpternlogq $0xab, %xmm16, %xmm2, %xmm0
+ vpternlogq $0xab, %ymm16, %ymm2, %ymm0
+ vpternlogq $0xab, %zmm16, %zmm2, %zmm0
+ .arch .avx512vl
+ vmovntdq %xmm0, (%rcx)
+ vmovntdq %ymm0, (%rcx)
+ vmovntdq %zmm0, (%rcx)
+ vpternlogq $0xab, %xmm16, %xmm2, %xmm0
+ vpternlogq $0xab, %ymm16, %ymm2, %ymm0
+ vpternlogq $0xab, %zmm16, %zmm2, %zmm0
diff --git a/gas/testsuite/gas/i386/x86-64-avx512vl-2.l b/gas/testsuite/gas/i386/x86-64-avx512vl-2.l
new file mode 100644
index 0000000..10833f6
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-avx512vl-2.l
@@ -0,0 +1,27 @@
+.*: Assembler messages:
+.*:5: Error: .*corei7.*
+.*:6: Error: .*corei7.*
+.*:7: Error: .*corei7.*
+.*:9: Error: .*corei7\.avx\.avx512vl.*
+.*:10: Error: .*corei7\.avx\.avx512vl.*
+.*:11: Error: .*corei7\.avx\.avx512vl.*
+GAS LISTING .*
+#...
+[ ]*1[ ]+\.text
+[ ]*2[ ]+\.arch corei7
+[ ]*3[ ]+_start:
+[ ]*4[ ]+\.arch \.avx
+[ ]*5[ ]+vpconflictd %xmm0, %xmm25
+[ ]*6[ ]+vpconflictd %ymm0, %ymm25
+[ ]*7[ ]+vpconflictd %ymm0, %zmm25
+[ ]*8[ ]+\.arch \.avx512vl
+[ ]*9[ ]+vpconflictd %xmm0, %xmm25
+[ ]*10[ ]+vpconflictd %ymm0, %ymm25
+[ ]*11[ ]+vpconflictd %zmm0, %zmm25
+[ ]*12[ ]+\.arch \.avx512cd
+[ ]*13[ ]+\?\?\?\? 62627D08 vpconflictd %xmm0, %xmm25
+[ ]*13[ ]+C4C8
+[ ]*14[ ]+\?\?\?\? 62627D28 vpconflictd %ymm0, %ymm25
+[ ]*14[ ]+C4C8
+[ ]*15[ ]+\?\?\?\? 62627D48 vpconflictd %zmm0, %zmm25
+[ ]*15[ ]+C4C8
diff --git a/gas/testsuite/gas/i386/x86-64-avx512vl-2.s b/gas/testsuite/gas/i386/x86-64-avx512vl-2.s
new file mode 100644
index 0000000..2b64c70
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-avx512vl-2.s
@@ -0,0 +1,15 @@
+ .text
+ .arch corei7
+_start:
+ .arch .avx
+ vpconflictd %xmm0, %xmm25
+ vpconflictd %ymm0, %ymm25
+ vpconflictd %ymm0, %zmm25
+ .arch .avx512vl
+ vpconflictd %xmm0, %xmm25
+ vpconflictd %ymm0, %ymm25
+ vpconflictd %zmm0, %zmm25
+ .arch .avx512cd
+ vpconflictd %xmm0, %xmm25
+ vpconflictd %ymm0, %ymm25
+ vpconflictd %zmm0, %zmm25