aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2018-03-08 08:35:01 +0100
committerJan Beulich <jbeulich@suse.com>2018-03-08 08:35:01 +0100
commit6e3e5c9e4181562682ffb60c562c4bce263b71a0 (patch)
treef6cfa446030bac695dd1475f334f983a202fe24c
parent38e314eb064ae94318deaa9544c2da3f46f5d319 (diff)
downloadgdb-6e3e5c9e4181562682ffb60c562c4bce263b71a0.zip
gdb-6e3e5c9e4181562682ffb60c562c4bce263b71a0.tar.gz
gdb-6e3e5c9e4181562682ffb60c562c4bce263b71a0.tar.bz2
x86: extend SSE check to PCLMULQDQ, AES, and GFNI insns
When aiming at not mixing SSE and AVX insns, these should be warned about the same way other non-AVX ones are treated.
-rw-r--r--gas/ChangeLog20
-rw-r--r--gas/config/tc-i386.c6
-rw-r--r--gas/testsuite/gas/i386/ilp32/x86-64-sse-check-none.d16
-rw-r--r--gas/testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d14
-rw-r--r--gas/testsuite/gas/i386/ilp32/x86-64-sse-check.d14
-rw-r--r--gas/testsuite/gas/i386/sse-check-error.l18
-rw-r--r--gas/testsuite/gas/i386/sse-check-none.d16
-rw-r--r--gas/testsuite/gas/i386/sse-check-none.s19
-rw-r--r--gas/testsuite/gas/i386/sse-check-warn.d14
-rw-r--r--gas/testsuite/gas/i386/sse-check-warn.e3
-rw-r--r--gas/testsuite/gas/i386/sse-check.d3
-rw-r--r--gas/testsuite/gas/i386/sse-check.s9
-rw-r--r--gas/testsuite/gas/i386/x86-64-sse-check-error.l18
-rw-r--r--gas/testsuite/gas/i386/x86-64-sse-check-none.d16
-rw-r--r--gas/testsuite/gas/i386/x86-64-sse-check-warn.d14
-rw-r--r--gas/testsuite/gas/i386/x86-64-sse-check.d14
16 files changed, 88 insertions, 126 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index f1c18aa..78fafb6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,25 @@
2018-03-08 Jan Beulich <jbeulich@suse.com>
+ * config/tc-i386.c (md_assemble): Extend SSE check conditional.
+ * testsuite/gas/i386/ilp32/x86-64-sse-check-none.d,
+ testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d,
+ testsuite/gas/i386/ilp32/x86-64-sse-check.d,
+ testsuite/gas/i386/sse-check-none.d,
+ testsuite/gas/i386/sse-check-warn.d,
+ testsuite/gas/i386/x86-64-sse-check.d,
+ testsuite/gas/i386/x86-64-sse-check-none.d,
+ testsuite/gas/i386/x86-64-sse-check-warn.d: Refer to sse-check.d.
+ * testsuite/gas/i386/sse-check.s: Add AES, GFNI, and PCLMUL
+ tests.
+ * testsuite/gas/i386/sse-check-none.s: Replace code by inclusion
+ of sse-check.s.
+ * testsuite/gas/i386/sse-check.d: Adjust expectations.
+ * testsuite/gas/i386/sse-check-error.l,
+ testsuite/gas/i386/x86-64-sse-check-error.l: Likewise.
+ * testsuite/gas/i386/sse-check-warn.e: Likewise.
+
+2018-03-08 Jan Beulich <jbeulich@suse.com>
+
* config/tc-i386.c (operand_size_match): Drop / replace uses of
.floatd.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 16f1174..4cf7b9d 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -4008,12 +4008,16 @@ md_assemble (char *line)
if (sse_check != check_none
&& !i.tm.opcode_modifier.noavx
+ && !i.tm.cpu_flags.bitfield.cpuavx
&& (i.tm.cpu_flags.bitfield.cpusse
|| i.tm.cpu_flags.bitfield.cpusse2
|| i.tm.cpu_flags.bitfield.cpusse3
|| i.tm.cpu_flags.bitfield.cpussse3
|| i.tm.cpu_flags.bitfield.cpusse4_1
- || i.tm.cpu_flags.bitfield.cpusse4_2))
+ || i.tm.cpu_flags.bitfield.cpusse4_2
+ || i.tm.cpu_flags.bitfield.cpupclmul
+ || i.tm.cpu_flags.bitfield.cpuaes
+ || i.tm.cpu_flags.bitfield.cpugfni))
{
(sse_check == check_warning
? as_warn
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-sse-check-none.d b/gas/testsuite/gas/i386/ilp32/x86-64-sse-check-none.d
index 7bef233..1d4f1db 100644
--- a/gas/testsuite/gas/i386/ilp32/x86-64-sse-check-none.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-sse-check-none.d
@@ -1,17 +1,5 @@
#source: ../sse-check-none.s
-#as: -msse-check=error
+#as: -msse-check=error -I${srcdir}/$subdir/..
#objdump: -dw
#name: x86-64 (ILP32) SSE check (.sse_check none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <_start>:
-[ ]*[a-f0-9]+: 0f 58 ca addps %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 58 ca addpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f d0 ca addsubpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
-[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
-#pass
+#dump: ../sse-check.d
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d b/gas/testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d
index f315180..b591488 100644
--- a/gas/testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d
@@ -3,16 +3,4 @@
#as: -msse-check=warning
#objdump: -dw
#name: x86-64 (ILP32) SSE check (warning)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <_start>:
-[ ]*[a-f0-9]+: 0f 58 ca addps %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 58 ca addpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f d0 ca addsubpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
-[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
-#pass
+#dump: ../sse-check.d
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-sse-check.d b/gas/testsuite/gas/i386/ilp32/x86-64-sse-check.d
index a2f2889..f034f00 100644
--- a/gas/testsuite/gas/i386/ilp32/x86-64-sse-check.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-sse-check.d
@@ -2,16 +2,4 @@
#as: -msse-check=none
#objdump: -dw
#name: x86-64 (ILP32) SSE check (none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <_start>:
-[ ]*[a-f0-9]+: 0f 58 ca addps %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 58 ca addpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f d0 ca addsubpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
-[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
-#pass
+#dump: ../sse-check.d
diff --git a/gas/testsuite/gas/i386/sse-check-error.l b/gas/testsuite/gas/i386/sse-check-error.l
index 5df6d67..3f78120 100644
--- a/gas/testsuite/gas/i386/sse-check-error.l
+++ b/gas/testsuite/gas/i386/sse-check-error.l
@@ -5,6 +5,9 @@
.*:16: Error: .*
.*:19: Error: .*
.*:20: Error: .*
+.*:23: Error: .*
+.*:26: Error: .*
+.*:29: Error: .*
GAS LISTING .*
@@ -38,3 +41,18 @@ GAS LISTING .*
[ ]*20[ ]+\?\?\?\? 660F3837 pcmpgtq %xmm1,%xmm0
.* Error: SSE instruction `pcmpgtq' is used
[ ]*20[ ]+C1
+[ ]*21[ ]+
+[ ]*22[ ]+\# PCMUL instruction
+[ ]*23[ ]+\?\?\?\? 660F3A44 pclmulqdq \$-1,%xmm1,%xmm2
+.* Error: SSE instruction `pclmulqdq' is used
+[ ]*23[ ]+D1FF
+[ ]*24[ ]+
+[ ]*25[ ]+\# AES instructions
+[ ]*26[ ]+\?\?\?\? 660F38DE aesdec %xmm1,%xmm2
+.* Error: SSE instruction `aesdec' is used
+[ ]*26[ ]+D1
+[ ]*27[ ]+
+[ ]*28[ ]+\# GFNI instructions
+[ ]*29[ ]+\?\?\?\? 660F38CF gf2p8mulb %xmm1,%xmm2
+.* Error: SSE instruction `gf2p8mulb' is used
+[ ]*29[ ]+D1
diff --git a/gas/testsuite/gas/i386/sse-check-none.d b/gas/testsuite/gas/i386/sse-check-none.d
index 87189f6..1965070 100644
--- a/gas/testsuite/gas/i386/sse-check-none.d
+++ b/gas/testsuite/gas/i386/sse-check-none.d
@@ -1,16 +1,4 @@
-#as: -msse-check=error
+#as: -msse-check=error -I${srcdir}/$subdir
#objdump: -dw
#name: i386 SSE check (.sse_check none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <_start>:
-[ ]*[a-f0-9]+: 0f 58 ca addps %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 58 ca addpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f d0 ca addsubpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
-[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
-#pass
+#dump: sse-check.d
diff --git a/gas/testsuite/gas/i386/sse-check-none.s b/gas/testsuite/gas/i386/sse-check-none.s
index 336dd9f..0af4972 100644
--- a/gas/testsuite/gas/i386/sse-check-none.s
+++ b/gas/testsuite/gas/i386/sse-check-none.s
@@ -1,21 +1,4 @@
# Check SSE instructions
.sse_check none
- .text
-_start:
-
-# SSE instruction
- addps %xmm2,%xmm1
-
-# SSE2 instruction
- addpd %xmm2,%xmm1
-
-# SSE3 instruction
- addsubpd %xmm2,%xmm1
-
-# SSSE3 instruction
- phaddw %xmm2,%xmm1
-
-# SSE4 instructions
- blendvpd %xmm0,%xmm1,%xmm0
- pcmpgtq %xmm1,%xmm0
+ .include "sse-check.s"
diff --git a/gas/testsuite/gas/i386/sse-check-warn.d b/gas/testsuite/gas/i386/sse-check-warn.d
index 0b96b15..694310e 100644
--- a/gas/testsuite/gas/i386/sse-check-warn.d
+++ b/gas/testsuite/gas/i386/sse-check-warn.d
@@ -3,16 +3,4 @@
#stderr: sse-check-warn.e
#objdump: -dw
#name: i386 SSE check (warning)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <_start>:
-[ ]*[a-f0-9]+: 0f 58 ca addps %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 58 ca addpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f d0 ca addsubpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
-[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
-#pass
+#dump: sse-check.d
diff --git a/gas/testsuite/gas/i386/sse-check-warn.e b/gas/testsuite/gas/i386/sse-check-warn.e
index 26b2001..6498bc8 100644
--- a/gas/testsuite/gas/i386/sse-check-warn.e
+++ b/gas/testsuite/gas/i386/sse-check-warn.e
@@ -5,3 +5,6 @@
.*:16: Warning: SSE instruction `phaddw' is used
.*:19: Warning: SSE instruction `blendvpd' is used
.*:20: Warning: SSE instruction `pcmpgtq' is used
+.*:23: Warning: SSE instruction `pclmulqdq' is used
+.*:26: Warning: SSE instruction `aesdec' is used
+.*:29: Warning: SSE instruction `gf2p8mulb' is used
diff --git a/gas/testsuite/gas/i386/sse-check.d b/gas/testsuite/gas/i386/sse-check.d
index 9329638..67656ae 100644
--- a/gas/testsuite/gas/i386/sse-check.d
+++ b/gas/testsuite/gas/i386/sse-check.d
@@ -13,4 +13,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
+[ ]*[a-f0-9]+: 66 0f 3a 44 d1 ff pclmulqdq \$0xff,%xmm1,%xmm2
+[ ]*[a-f0-9]+: 66 0f 38 de d1 aesdec %xmm1,%xmm2
+[ ]*[a-f0-9]+: 66 0f 38 cf d1 gf2p8mulb %xmm1,%xmm2
#pass
diff --git a/gas/testsuite/gas/i386/sse-check.s b/gas/testsuite/gas/i386/sse-check.s
index 7e5d208..3ec1e56 100644
--- a/gas/testsuite/gas/i386/sse-check.s
+++ b/gas/testsuite/gas/i386/sse-check.s
@@ -18,3 +18,12 @@ _start:
# SSE4 instructions
blendvpd %xmm0,%xmm1,%xmm0
pcmpgtq %xmm1,%xmm0
+
+# PCMUL instruction
+ pclmulqdq $-1,%xmm1,%xmm2
+
+# AES instructions
+ aesdec %xmm1,%xmm2
+
+# GFNI instructions
+ gf2p8mulb %xmm1,%xmm2
diff --git a/gas/testsuite/gas/i386/x86-64-sse-check-error.l b/gas/testsuite/gas/i386/x86-64-sse-check-error.l
index 5df6d67..3f78120 100644
--- a/gas/testsuite/gas/i386/x86-64-sse-check-error.l
+++ b/gas/testsuite/gas/i386/x86-64-sse-check-error.l
@@ -5,6 +5,9 @@
.*:16: Error: .*
.*:19: Error: .*
.*:20: Error: .*
+.*:23: Error: .*
+.*:26: Error: .*
+.*:29: Error: .*
GAS LISTING .*
@@ -38,3 +41,18 @@ GAS LISTING .*
[ ]*20[ ]+\?\?\?\? 660F3837 pcmpgtq %xmm1,%xmm0
.* Error: SSE instruction `pcmpgtq' is used
[ ]*20[ ]+C1
+[ ]*21[ ]+
+[ ]*22[ ]+\# PCMUL instruction
+[ ]*23[ ]+\?\?\?\? 660F3A44 pclmulqdq \$-1,%xmm1,%xmm2
+.* Error: SSE instruction `pclmulqdq' is used
+[ ]*23[ ]+D1FF
+[ ]*24[ ]+
+[ ]*25[ ]+\# AES instructions
+[ ]*26[ ]+\?\?\?\? 660F38DE aesdec %xmm1,%xmm2
+.* Error: SSE instruction `aesdec' is used
+[ ]*26[ ]+D1
+[ ]*27[ ]+
+[ ]*28[ ]+\# GFNI instructions
+[ ]*29[ ]+\?\?\?\? 660F38CF gf2p8mulb %xmm1,%xmm2
+.* Error: SSE instruction `gf2p8mulb' is used
+[ ]*29[ ]+D1
diff --git a/gas/testsuite/gas/i386/x86-64-sse-check-none.d b/gas/testsuite/gas/i386/x86-64-sse-check-none.d
index ef38d8a..f198573 100644
--- a/gas/testsuite/gas/i386/x86-64-sse-check-none.d
+++ b/gas/testsuite/gas/i386/x86-64-sse-check-none.d
@@ -1,17 +1,5 @@
#source: sse-check-none.s
-#as: -msse-check=error
+#as: -msse-check=error -I${srcdir}/$subdir
#objdump: -dw
#name: x86-64 SSE check (.sse_check none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <_start>:
-[ ]*[a-f0-9]+: 0f 58 ca addps %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 58 ca addpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f d0 ca addsubpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
-[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
-#pass
+#dump: sse-check.d
diff --git a/gas/testsuite/gas/i386/x86-64-sse-check-warn.d b/gas/testsuite/gas/i386/x86-64-sse-check-warn.d
index 691185c..8719815 100644
--- a/gas/testsuite/gas/i386/x86-64-sse-check-warn.d
+++ b/gas/testsuite/gas/i386/x86-64-sse-check-warn.d
@@ -3,16 +3,4 @@
#stderr: sse-check-warn.e
#objdump: -dw
#name: x86-64 SSE check (warning)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <_start>:
-[ ]*[a-f0-9]+: 0f 58 ca addps %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 58 ca addpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f d0 ca addsubpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
-[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
-#pass
+#dump: sse-check.d
diff --git a/gas/testsuite/gas/i386/x86-64-sse-check.d b/gas/testsuite/gas/i386/x86-64-sse-check.d
index 9ca0c79..a3dd059 100644
--- a/gas/testsuite/gas/i386/x86-64-sse-check.d
+++ b/gas/testsuite/gas/i386/x86-64-sse-check.d
@@ -2,16 +2,4 @@
#as: -msse-check=none
#objdump: -dw
#name: x86-64 SSE check (none)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <_start>:
-[ ]*[a-f0-9]+: 0f 58 ca addps %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 58 ca addpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f d0 ca addsubpd %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 01 ca phaddw %xmm2,%xmm1
-[ ]*[a-f0-9]+: 66 0f 38 15 c1 blendvpd %xmm0,%xmm1,%xmm0
-[ ]*[a-f0-9]+: 66 0f 38 37 c1 pcmpgtq %xmm1,%xmm0
-#pass
+#dump: sse-check.d