x86: extend SSE check to PCLMULQDQ, AES, and GFNI insns
authorJan Beulich <jbeulich@novell.com>
Thu, 8 Mar 2018 07:35:01 +0000 (08:35 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 8 Mar 2018 07:35:01 +0000 (08:35 +0100)
When aiming at not mixing SSE and AVX insns, these should be warned
about the same way other non-AVX ones are treated.

16 files changed:
gas/ChangeLog
gas/config/tc-i386.c
gas/testsuite/gas/i386/ilp32/x86-64-sse-check-none.d
gas/testsuite/gas/i386/ilp32/x86-64-sse-check-warn.d
gas/testsuite/gas/i386/ilp32/x86-64-sse-check.d
gas/testsuite/gas/i386/sse-check-error.l
gas/testsuite/gas/i386/sse-check-none.d
gas/testsuite/gas/i386/sse-check-none.s
gas/testsuite/gas/i386/sse-check-warn.d
gas/testsuite/gas/i386/sse-check-warn.e
gas/testsuite/gas/i386/sse-check.d
gas/testsuite/gas/i386/sse-check.s
gas/testsuite/gas/i386/x86-64-sse-check-error.l
gas/testsuite/gas/i386/x86-64-sse-check-none.d
gas/testsuite/gas/i386/x86-64-sse-check-warn.d
gas/testsuite/gas/i386/x86-64-sse-check.d

index f1c18aa546b3072fecf3bd3748b171a313cafe66..78fafb6615514d7934efcdb363c22e4278127287 100644 (file)
@@ -1,3 +1,23 @@
+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
index 16f11742e0aca69a4809772c500ec8eb72cb37df..4cf7b9daf5355b571342caee0517b0ed92e3d3cb 100644 (file)
@@ -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
index 7bef233c4e15d3551e4a882abc90b364b26f43b0..1d4f1db2fcb0da707f70f7343029b116d6f6e859 100644 (file)
@@ -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
index f315180b941a95a527ca7cb94b8a0a3de591e82a..b5914883b942ea5fac30e5d9e8841a2387e0ec77 100644 (file)
@@ -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
index a2f28892f61a6d6af1d911517732bd492de90c7b..f034f00a8ef21a3959e941a135a1d7191fe89f54 100644 (file)
@@ -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
index 5df6d6713858a6c00da57930e9483154051c8755..3f78120d0b0e0d83d9f0200c83902ae00b93e96c 100644 (file)
@@ -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
index 87189f616ec1addfcd42561d60128caadab52386..19650709199875f5303d43716b3cd36904314b7d 100644 (file)
@@ -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
index 336dd9f73358f881ac6d75bf404af96025206faa..0af4972dac8c2f227a5ca7e4c26c62f018aabc13 100644 (file)
@@ -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"
index 0b96b15f6f8ecf4acf779662d2a2d012e5a93cc5..694310e5081d326194a3c83ca3032f995a90b13d 100644 (file)
@@ -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
index 26b2001a68042ef22a9b2341af68e7c91fcbe6fb..6498bc8f0972858a970ab8e6467ab78ad58fd9f8 100644 (file)
@@ -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
index 9329638c32b52b16b66e0351195467bef7712fa6..67656ae19fe95a6caf98fbf4b07c8bbc664260c5 100644 (file)
@@ -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
index 7e5d208247db2c7f0856ab9055ce2a4347f3dcd1..3ec1e560af457fc2c9e352718d6fe6d20c32da0d 100644 (file)
@@ -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
index 5df6d6713858a6c00da57930e9483154051c8755..3f78120d0b0e0d83d9f0200c83902ae00b93e96c 100644 (file)
@@ -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
index ef38d8a8ab751e25055ce9ba0d78f442892fb2e5..f198573c3f76316b5d1ce21004922c478b6e64a4 100644 (file)
@@ -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
index 691185c34f7266d127d498eeee8c476db000a2d0..8719815e08079f278e6f7c985b002f87a0791de5 100644 (file)
@@ -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
index 9ca0c79709a60e6d979b3190f324e667d96d4c4c..a3dd0599e43e7bc57b19c08106392f464aeedf0a 100644 (file)
@@ -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