aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-05-27 10:05:39 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-05-27 10:05:57 -0700
commit1848e567343e9c50979453463f34e0a55ba892eb (patch)
treeeedcc3ffad34c670f8ecf27859d28b4e67d90072 /gas/testsuite
parent744608cc854a365661e93d307aadf22ab6e6bd7c (diff)
downloadgdb-1848e567343e9c50979453463f34e0a55ba892eb.zip
gdb-1848e567343e9c50979453463f34e0a55ba892eb.tar.gz
gdb-1848e567343e9c50979453463f34e0a55ba892eb.tar.bz2
Update x86 CPU_XXX_FLAGS handling
Support defining CPU_XXX_FLAGS with other CPU_XXX_FLAGS. Update CPU_XXX_FLAGS to enable more bits like x87 and SYSCALL. Don't enable MMX when enabling SSE, AVX or AVX512. Don't disable AVX nor AVX512 when disabling SSE. Don't disable AVX512 when disabling AVX. Disable F16C, FMA, FMA4 and XOP when disabling AVX. Add 87, no287, no387, no687, nosse2, nosse3, nossse3, nosse4.1, nosse4.2, nosse4 and noavx2 directives to x86 assembler. TODO: Add more .noXXX, like .noavx512f, directives to x86 assembler. gas/ PR gas/20145 * config/tc-i386.c (cpu_arch): Add 687. (cpu_noarch): Add no287, no387, no687, nosse2, nosse3, nossse3, nosse4.1, nosse4.2, nosse4 and noavx2. (parse_real_register): Check cpuregmmx instead of cpummx for MMX register. Check cpuregxmm instead of cpusse for XMM register. Check cpuregymm instead of cpuavx for YMM register. Check cpuregzmm/cpuregmask instead of cpuavx512f for ZMMM/mask register. * doc/c-i386.texi: Mention 687, no287, no387, no687, nosse2, nosse3, nossse3, nosse4.1, nosse4.2, nosse4 and noavx2. * testsuite/gas/i386/arch-10-prefetchw.d (as): Add mmx. * testsuite/gas/i386/arch-10.d (as): Likewise. * testsuite/gas/i386/arch-11.s: Add ".arch .mmx". * testsuite/gas/i386/i386.exp: Pass mmx to assembler for arch-10-3 and arch-10-4. Run no87-3, nosse-4, nosse-5, noavx-3 and noavx-4. * testsuite/gas/i386/no87-3.l: New file. * testsuite/gas/i386/no87-3.s: Likewise. * testsuite/gas/i386/noavx-3.l: Likewise. * testsuite/gas/i386/noavx-3.s: Likewise. * testsuite/gas/i386/noavx-4.d: Likewise. * testsuite/gas/i386/noavx-4.s: Likewise. * testsuite/gas/i386/nosse-4.l: Likewise. * testsuite/gas/i386/nosse-4.s: Likewise. * testsuite/gas/i386/nosse-5.d: Likewise. * testsuite/gas/i386/nosse-5.s: Likewise. opcodes/ PR gas/20145 * i386-gen.c (cpu_flag_init): Update CPU_XXX_FLAGS. Remove CpuMMX from CPU_SSE_FLAGS. Remove AVX and AVX512 bits from CPU_ANY_SSE_FLAGS. Remove AVX512 bits from CPU_ANY_AVX_FLAGS. Add CPU_XSAVE_FLAGS to CPU_XSAVEOPT_FLAGS, CPU_XSAVE_FLAGS and CpuXSAVEC. Add CPU_AVX_FLAGS to CpuF16C. Remove CpuMMX from CPU_AVX512F_FLAGS, CPU_AVX512CD_FLAGS, CPU_AVX512ER_FLAGS, CPU_AVX512PF_FLAGS, CPU_AVX512DQ_FLAGS and CPU_AVX512BW_FLAGS. Add CPU_SSE2_FLAGS to CPU_SHA_FLAGS. Add CPU_ANY_287_FLAGS, CPU_ANY_387_FLAGS, CPU_ANY_687_FLAGS, CPU_ANY_SSE2_FLAGS, CPU_ANY_SSE3_FLAGS, CPU_ANY_SSSE3_FLAGS, CPU_ANY_SSE4_1_FLAGS, CPU_ANY_SSE4_2_FLAGS and CPU_ANY_AVX2_FLAGS. Enable CpuRegMMX for MMX. Enable CpuRegXMM for SSE, AVX and AVX512. Enable CpuRegYMM for AVX and AVX512VL, Enable CpuRegZMM and CpuRegMask for AVX512. (cpu_flags): Add CpuRegMMX, CpuRegXMM, CpuRegYMM, CpuRegZMM and CpuRegMask. (set_bitfield_from_cpu_flag_init): New function. (set_bitfield): Remove const on f. Call set_bitfield_from_cpu_flag_init to handle CPU_XXX_FLAGS. * i386-opc.h (CpuRegMMX): New. (CpuRegXMM): Likewise. (CpuRegYMM): Likewise. (CpuRegZMM): Likewise. (CpuRegMask): Likewise. (i386_cpu_flags): Add cpuregmmx, cpuregxmm, cpuregymm, cpuregzmm and cpuregmask. * i386-init.h: Regenerated. * i386-tbl.h: Likewise.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/i386/arch-10-prefetchw.d2
-rw-r--r--gas/testsuite/gas/i386/arch-10.d2
-rw-r--r--gas/testsuite/gas/i386/arch-11.s1
-rw-r--r--gas/testsuite/gas/i386/i386.exp9
-rw-r--r--gas/testsuite/gas/i386/no87-3.l39
-rw-r--r--gas/testsuite/gas/i386/no87-3.s27
-rw-r--r--gas/testsuite/gas/i386/noavx-3.l70
-rw-r--r--gas/testsuite/gas/i386/noavx-3.s42
-rw-r--r--gas/testsuite/gas/i386/noavx-4.d25
-rw-r--r--gas/testsuite/gas/i386/noavx-4.s22
-rw-r--r--gas/testsuite/gas/i386/nosse-4.l80
-rw-r--r--gas/testsuite/gas/i386/nosse-4.s51
-rw-r--r--gas/testsuite/gas/i386/nosse-5.d28
-rw-r--r--gas/testsuite/gas/i386/nosse-5.s27
14 files changed, 421 insertions, 4 deletions
diff --git a/gas/testsuite/gas/i386/arch-10-prefetchw.d b/gas/testsuite/gas/i386/arch-10-prefetchw.d
index 1129edf..8c88d94 100644
--- a/gas/testsuite/gas/i386/arch-10-prefetchw.d
+++ b/gas/testsuite/gas/i386/arch-10-prefetchw.d
@@ -1,5 +1,5 @@
#source: arch-10.s
-#as: -march=i686+nop+avx+vmx+smx+xsave+xsaveopt+aes+pclmul+fma+movbe+ept+clflush+syscall+rdtscp+sse4a+svme+lzcnt+padlock+bmi+tbm+prfchw
+#as: -march=i686+mmx+nop+avx+vmx+smx+xsave+xsaveopt+aes+pclmul+fma+movbe+ept+clflush+syscall+rdtscp+sse4a+svme+lzcnt+padlock+bmi+tbm+prfchw
#objdump: -dw
#name: i386 arch 10 (prefetchw)
diff --git a/gas/testsuite/gas/i386/arch-10.d b/gas/testsuite/gas/i386/arch-10.d
index 3e2a7f1..52ea90a 100644
--- a/gas/testsuite/gas/i386/arch-10.d
+++ b/gas/testsuite/gas/i386/arch-10.d
@@ -1,4 +1,4 @@
-#as: -march=i686+avx+vmx+smx+xsave+xsaveopt+aes+pclmul+fma+movbe+ept+clflush+nop+syscall+rdtscp+3dnowa+sse4a+svme+abm+padlock+bmi+tbm
+#as: -march=i686+mmx+avx+vmx+smx+xsave+xsaveopt+aes+pclmul+fma+movbe+ept+clflush+nop+syscall+rdtscp+3dnowa+sse4a+svme+abm+padlock+bmi+tbm
#objdump: -dw
#name: i386 arch 10
diff --git a/gas/testsuite/gas/i386/arch-11.s b/gas/testsuite/gas/i386/arch-11.s
index 0ecbe1c..0e514a4 100644
--- a/gas/testsuite/gas/i386/arch-11.s
+++ b/gas/testsuite/gas/i386/arch-11.s
@@ -1,5 +1,6 @@
# Test .arch .sse
.arch generic32
.arch .sse
+.arch .mmx
divss %xmm1,%xmm0
pminub %mm1,%mm0
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 624674d..0c22498 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -155,8 +155,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "arch-10-btver2"
run_list_test "arch-10-1" "-march=generic32 -I${srcdir}/$subdir -al"
run_list_test "arch-10-2" "-march=i686 -I${srcdir}/$subdir -al"
- run_list_test "arch-10-3" "-march=i686+sse4.2 -I${srcdir}/$subdir -al"
- run_list_test "arch-10-4" "-march=i686+sse4+vmx+smx -I${srcdir}/$subdir -al"
+ run_list_test "arch-10-3" "-march=i686+mmx+sse4.2 -I${srcdir}/$subdir -al"
+ run_list_test "arch-10-4" "-march=i686+mmx+sse4+vmx+smx -I${srcdir}/$subdir -al"
run_dump_test "arch-11"
run_dump_test "arch-12"
run_dump_test "arch-13"
@@ -165,14 +165,19 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "387"
run_list_test "no87" "-al"
run_list_test "no87-2" "-march=i686+no87 -al"
+ run_list_test "no87-3" "-al"
run_list_test "nommx-1" "-al"
run_list_test "nommx-2" "-march=core+nommx -al"
run_list_test "nommx-3" "-march=+nommx -al"
run_list_test "nosse-1" "-al"
run_list_test "nosse-2" "-march=core+nosse -al"
run_list_test "nosse-3" "-march=+nosse -al"
+ run_list_test "nosse-4" "-al"
+ run_dump_test "nosse-5"
run_list_test "noavx-1" "-al"
run_list_test "noavx-2" "-march=+noavx -al"
+ run_list_test "noavx-3" "-al"
+ run_dump_test "noavx-4"
run_dump_test "xsave"
run_dump_test "xsave-intel"
run_dump_test "aes"
diff --git a/gas/testsuite/gas/i386/no87-3.l b/gas/testsuite/gas/i386/no87-3.l
new file mode 100644
index 0000000..d6edd14
--- /dev/null
+++ b/gas/testsuite/gas/i386/no87-3.l
@@ -0,0 +1,39 @@
+.*: Assembler messages:
+.*:4: Error: .*generic.*
+.*:7: Error: .*8087.*
+.*:10: Error: .*287.*
+.*:13: Error: .*387.*
+.*:17: Error: .*no687.*
+.*:20: Error: .*no387.*
+.*:23: Error: .*no287.*
+.*:26: Error: .*no87.*
+GAS LISTING .*
+#...
+[ ]*1[ ]+\# Test \.arch \[\.x87|\.nox87\]
+[ ]*2[ ]+\.text
+[ ]*3[ ]+\.arch generic32
+[ ]*4[ ]+fneni
+[ ]*5[ ]+\.arch \.8087
+[ ]*6[ ]+\?\?\?\? DBE0 fneni
+[ ]*7[ ]+fsetpm
+[ ]*8[ ]+\.arch \.287
+[ ]*9[ ]+\?\?\?\? 9BDBE4 fsetpm
+[ ]*10[ ]+fprem1
+[ ]*11[ ]+\.arch \.387
+[ ]*12[ ]+\?\?\?\? D9F5 fprem1
+[ ]*13[ ]+fcomi
+[ ]*14[ ]+\.arch \.687
+[ ]*15[ ]+\?\?\?\? DBF1 fcomi
+[ ]*16[ ]+\.arch \.no687
+[ ]*17[ ]+fcomi
+[ ]*18[ ]+\?\?\?\? D9F5 fprem1
+[ ]*19[ ]+\.arch \.no387
+[ ]*20[ ]+fprem1
+[ ]*21[ ]+\?\?\?\? 9BDBE4 fsetpm
+[ ]*22[ ]+\.arch \.no287
+[ ]*23[ ]+fsetpm
+[ ]*24[ ]+\?\?\?\? DBE0 fneni
+[ ]*25[ ]+\.arch \.no87
+[ ]*26[ ]+fneni
+[ ]*27[ ]+\.p2align 4
+#pass
diff --git a/gas/testsuite/gas/i386/no87-3.s b/gas/testsuite/gas/i386/no87-3.s
new file mode 100644
index 0000000..dbd4309
--- /dev/null
+++ b/gas/testsuite/gas/i386/no87-3.s
@@ -0,0 +1,27 @@
+# Test .arch [.x87|.nox87]
+ .text
+ .arch generic32
+ fneni
+ .arch .8087
+ fneni
+ fsetpm
+ .arch .287
+ fsetpm
+ fprem1
+ .arch .387
+ fprem1
+ fcomi
+ .arch .687
+ fcomi
+ .arch .no687
+ fcomi
+ fprem1
+ .arch .no387
+ fprem1
+ fsetpm
+ .arch .no287
+ fsetpm
+ fneni
+ .arch .no87
+ fneni
+ .p2align 4
diff --git a/gas/testsuite/gas/i386/noavx-3.l b/gas/testsuite/gas/i386/noavx-3.l
new file mode 100644
index 0000000..7215d7c
--- /dev/null
+++ b/gas/testsuite/gas/i386/noavx-3.l
@@ -0,0 +1,70 @@
+.*: Assembler messages:
+.*:4: Error: .*generic.*
+.*:5: Error: .*generic.*
+.*:6: Error: .*generic.*
+.*:7: Error: .*generic.*
+.*:12: Error: .*generic.*
+.*:15: Error: .*avx.*
+.*:32: Error: .*noavx2.*
+.*:35: Error: .*noavx.*
+.*:36: Error: .*noavx.*
+.*:37: Error: .*noavx.*
+.*:38: Error: .*noavx.*
+.*:39: Error: .*noavx.*
+GAS LISTING .*
+#...
+[ ]*1[ ]+\# Test \.arch \[\.avxX|\.noavxX\]
+[ ]*2[ ]+\.text
+[ ]*3[ ]+\.arch generic32
+[ ]*4[ ]+vcvtph2ps %xmm4,%ymm4
+[ ]*5[ ]+vfmadd132pd %ymm4,%ymm6,%ymm2
+[ ]*6[ ]+vfmaddpd %ymm4,%ymm6,%ymm2,%ymm7
+[ ]*7[ ]+vfrczpd %xmm7,%xmm7
+[ ]*8[ ]+\.arch \.mmx
+[ ]*9[ ]+\.arch \.sse2
+[ ]*10[ ]+\?\?\?\? 0F77 emms
+[ ]*11[ ]+\?\?\?\? 0FAEE8 lfence
+[ ]*12[ ]+vzeroupper
+[ ]*13[ ]+\.arch \.avx
+[ ]*14[ ]+\?\?\?\? C5F877 vzeroupper
+[ ]*15[ ]+vpermpd \$7,%ymm6,%ymm2
+[ ]*16[ ]+\.arch \.avx2
+[ ]*17[ ]+\?\?\?\? C4E3FD01 vpermpd \$7,%ymm6,%ymm2
+[ ]*17[ ]+D607
+[ ]*18[ ]+\.arch \.f16c
+[ ]*19[ ]+\?\?\?\? C4E27D13 vcvtph2ps %xmm4,%ymm4
+[ ]*19[ ]+E4
+[ ]*20[ ]+\.arch \.fma
+[ ]*21[ ]+\?\?\?\? C4E2CD98 vfmadd132pd %ymm4,%ymm6,%ymm2
+[ ]*21[ ]+D4
+[ ]*22[ ]+\.arch \.fma4
+[ ]*23[ ]+\?\?\?\? C4E3ED69 vfmaddpd %ymm4,%ymm6,%ymm2,%ymm7
+[ ]*23[ ]+FC60
+[ ]*24[ ]+\.arch \.xop
+[ ]*25[ ]+\?\?\?\? 8FE97881 vfrczpd %xmm7,%xmm7
+[ ]*25[ ]+FF
+[ ]*26[ ]+\.arch \.noavx2
+[ ]*27[ ]+\?\?\?\? C5F877 vzeroupper
+[ ]*28[ ]+\?\?\?\? C4E27D13 vcvtph2ps %xmm4,%ymm4
+[ ]*28[ ]+E4
+[ ]*29[ ]+\?\?\?\? C4E2CD98 vfmadd132pd %ymm4,%ymm6,%ymm2
+[ ]*29[ ]+D4
+[ ]*30[ ]+\?\?\?\? C4E3ED69 vfmaddpd %ymm4,%ymm6,%ymm2,%ymm7
+[ ]*30[ ]+FC60
+[ ]*31[ ]+\?\?\?\? 8FE97881 vfrczpd %xmm7,%xmm7
+[ ]*31[ ]+FF
+[ ]*32[ ]+vpermpd \$7,%ymm6,%ymm2
+[ ]*33[ ]+\?\?\?\? 0FAEE8 lfence
+[ ]*34[ ]+\.arch \.noavx
+[ ]*35[ ]+vzeroupper
+[ ]*36[ ]+vcvtph2ps %xmm4,%ymm4
+[ ]*37[ ]+vfmadd132pd %ymm4,%ymm6,%ymm2
+[ ]*38[ ]+vfmaddpd %ymm4,%ymm6,%ymm2,%ymm7
+[ ]*39[ ]+vfrczpd %xmm7,%xmm7
+[ ]*40[ ]+\?\?\?\? 0F77 emms
+[ ]*41[ ]+\?\?\?\? 0FAEE8 lfence
+[ ]*42[ ]+\?\?\?\? 8DB60000 \.p2align 4
+[ ]*42[ ]+00008DBC
+[ ]*42[ ]+27000000
+[ ]*42[ ]+00
+#pass
diff --git a/gas/testsuite/gas/i386/noavx-3.s b/gas/testsuite/gas/i386/noavx-3.s
new file mode 100644
index 0000000..1de49e0
--- /dev/null
+++ b/gas/testsuite/gas/i386/noavx-3.s
@@ -0,0 +1,42 @@
+# Test .arch [.avxX|.noavxX]
+ .text
+ .arch generic32
+ vcvtph2ps %xmm4,%ymm4
+ vfmadd132pd %ymm4,%ymm6,%ymm2
+ vfmaddpd %ymm4,%ymm6,%ymm2,%ymm7
+ vfrczpd %xmm7,%xmm7
+ .arch .mmx
+ .arch .sse2
+ emms
+ lfence
+ vzeroupper
+ .arch .avx
+ vzeroupper
+ vpermpd $7,%ymm6,%ymm2
+ .arch .avx2
+ vpermpd $7,%ymm6,%ymm2
+ .arch .f16c
+ vcvtph2ps %xmm4,%ymm4
+ .arch .fma
+ vfmadd132pd %ymm4,%ymm6,%ymm2
+ .arch .fma4
+ vfmaddpd %ymm4,%ymm6,%ymm2,%ymm7
+ .arch .xop
+ vfrczpd %xmm7,%xmm7
+ .arch .noavx2
+ vzeroupper
+ vcvtph2ps %xmm4,%ymm4
+ vfmadd132pd %ymm4,%ymm6,%ymm2
+ vfmaddpd %ymm4,%ymm6,%ymm2,%ymm7
+ vfrczpd %xmm7,%xmm7
+ vpermpd $7,%ymm6,%ymm2
+ lfence
+ .arch .noavx
+ vzeroupper
+ vcvtph2ps %xmm4,%ymm4
+ vfmadd132pd %ymm4,%ymm6,%ymm2
+ vfmaddpd %ymm4,%ymm6,%ymm2,%ymm7
+ vfrczpd %xmm7,%xmm7
+ emms
+ lfence
+ .p2align 4
diff --git a/gas/testsuite/gas/i386/noavx-4.d b/gas/testsuite/gas/i386/noavx-4.d
new file mode 100644
index 0000000..1fe4f24
--- /dev/null
+++ b/gas/testsuite/gas/i386/noavx-4.d
@@ -0,0 +1,25 @@
+#objdump: -drw
+#name: i386 .noavx
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <.text>:
+[ ]*[a-f0-9]+: c5 d0 58 e6 vaddps %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: c5 d4 58 e6 vaddps %ymm6,%ymm5,%ymm4
+[ ]*[a-f0-9]+: 62 f1 54 0f 58 e6 vaddps %xmm6,%xmm5,%xmm4\{%k7\}
+[ ]*[a-f0-9]+: 62 f1 54 2f 58 e6 vaddps %ymm6,%ymm5,%ymm4\{%k7\}
+[ ]*[a-f0-9]+: 62 f1 54 48 58 e6 vaddps %zmm6,%zmm5,%zmm4
+[ ]*[a-f0-9]+: c5 d2 58 e6 vaddss %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: 62 f1 54 0f 58 e6 vaddps %xmm6,%xmm5,%xmm4\{%k7\}
+[ ]*[a-f0-9]+: 62 f1 54 2f 58 e6 vaddps %ymm6,%ymm5,%ymm4\{%k7\}
+[ ]*[a-f0-9]+: 62 f1 54 48 58 e6 vaddps %zmm6,%zmm5,%zmm4
+[ ]*[a-f0-9]+: c5 d0 58 e6 vaddps %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: c5 d4 58 e6 vaddps %ymm6,%ymm5,%ymm4
+[ ]*[a-f0-9]+: c5 d2 58 e6 vaddss %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: 62 f1 54 08 58 e6 vaddps %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: 62 f1 54 28 58 e6 vaddps %ymm6,%ymm5,%ymm4
+[ ]*[a-f0-9]+: 62 f1 54 48 58 e6 vaddps %zmm6,%zmm5,%zmm4
+[ ]*[a-f0-9]+: 62 f1 56 08 58 e6 vaddss %xmm6,%xmm5,%xmm4
+#pass
diff --git a/gas/testsuite/gas/i386/noavx-4.s b/gas/testsuite/gas/i386/noavx-4.s
new file mode 100644
index 0000000..fe1509f
--- /dev/null
+++ b/gas/testsuite/gas/i386/noavx-4.s
@@ -0,0 +1,22 @@
+# Test .arch .noavxX
+ .text
+ .arch generic32
+ .arch .avx512vl
+ vaddps %xmm6, %xmm5, %xmm4
+ vaddps %ymm6, %ymm5, %ymm4
+ vaddps %xmm6, %xmm5, %xmm4{%k7}
+ vaddps %ymm6, %ymm5, %ymm4{%k7}
+ vaddps %zmm6, %zmm5, %zmm4
+ vaddss %xmm6, %xmm5, %xmm4
+ .arch .noavx2
+ vaddps %xmm6, %xmm5, %xmm4{%k7}
+ vaddps %ymm6, %ymm5, %ymm4{%k7}
+ vaddps %zmm6, %zmm5, %zmm4
+ vaddps %xmm6, %xmm5, %xmm4
+ vaddps %ymm6, %ymm5, %ymm4
+ vaddss %xmm6, %xmm5, %xmm4
+ .arch .noavx
+ vaddps %xmm6, %xmm5, %xmm4
+ vaddps %ymm6, %ymm5, %ymm4
+ vaddps %zmm6, %zmm5, %zmm4
+ vaddss %xmm6, %xmm5, %xmm4
diff --git a/gas/testsuite/gas/i386/nosse-4.l b/gas/testsuite/gas/i386/nosse-4.l
new file mode 100644
index 0000000..3d840fa
--- /dev/null
+++ b/gas/testsuite/gas/i386/nosse-4.l
@@ -0,0 +1,80 @@
+.*: Assembler messages:
+.*:6: Error: .*generic.*
+.*:9: Error: .*\.sse.*
+.*:12: Error: .*\.sse2.*
+.*:15: Error: .*\.sse3.*
+.*:18: Error: .*\.ssse3.*
+.*:21: Error: .*\.sse4\.1.*
+.*:28: Error: .*\.nosse4.*
+.*:32: Error: .*\.nosse4\.2.*
+.*:35: Error: .*\.nosse4\.1.*
+.*:38: Error: .*\.nossse3.*
+.*:43: Error: .*\.nosse3.*
+.*:45: Error: .*\.nommx.*
+.*:47: Error: .*\.nosse2.*
+.*:50: Error: .*\.nosse.*
+GAS LISTING .*
+#...
+[ ]*1[ ]+\# Test \.arch \[\.sseX|\.nosseX\]
+[ ]*2[ ]+\.text
+[ ]*3[ ]+\.arch generic32
+[ ]*4[ ]+\.arch \.mmx
+[ ]*5[ ]+\?\?\?\? 0F77 emms
+[ ]*6[ ]+addps %xmm0, %xmm0
+[ ]*7[ ]+\.arch \.sse
+[ ]*8[ ]+\?\?\?\? 0F58C0 addps %xmm0, %xmm0
+[ ]*9[ ]+lfence
+[ ]*10[ ]+\.arch \.sse2
+[ ]*11[ ]+\?\?\?\? 0FAEE8 lfence
+[ ]*12[ ]+mwait
+[ ]*13[ ]+\.arch \.sse3
+[ ]*14[ ]+\?\?\?\? 0F01C9 mwait
+[ ]*15[ ]+pabsd %xmm0, %xmm0
+[ ]*16[ ]+\.arch \.ssse3
+[ ]*17[ ]+\?\?\?\? 660F381E pabsd %xmm0, %xmm0
+[ ]*17[ ]+C0
+[ ]*18[ ]+ptest %xmm0, %xmm0
+[ ]*19[ ]+\.arch \.sse4\.1
+[ ]*20[ ]+\?\?\?\? 660F3817 ptest %xmm0, %xmm0
+[ ]*20[ ]+C0
+[ ]*21[ ]+crc32 %eax, %eax
+[ ]*22[ ]+\.arch \.sse4\.2
+[ ]*23[ ]+\?\?\?\? F20F38F1 crc32 %eax, %eax
+[ ]*23[ ]+C0
+[ ]*24[ ]+\.arch \.nosse
+[ ]*25[ ]+\.arch \.sse4
+[ ]*26[ ]+\?\?\?\? F20F38F1 crc32 %eax, %eax
+[ ]*26[ ]+C0
+[ ]*27[ ]+\.arch \.nosse4
+[ ]*28[ ]+ptest %xmm0, %xmm0
+[ ]*29[ ]+\?\?\?\? 660F381E pabsd %xmm0, %xmm0
+[ ]*29[ ]+C0
+[ ]*30[ ]+\.arch \.sse4
+[ ]*31[ ]+\.arch \.nosse4\.2
+[ ]*32[ ]+crc32 %eax, %eax
+[ ]*33[ ]+\?\?\?\? 660F3817 ptest %xmm0, %xmm0
+[ ]*33[ ]+C0
+[ ]*34[ ]+\.arch \.nosse4\.1
+[ ]*35[ ]+ptest %xmm0, %xmm0
+[ ]*36[ ]+\?\?\?\? 660F381E pabsd %xmm0, %xmm0
+[ ]*36[ ]+C0
+[ ]*37[ ]+\.arch \.nossse3
+[ ]*38[ ]+pabsd %xmm0, %xmm0
+[ ]*39[ ]+\?\?\?\? 0F01C9 mwait
+[ ]*40[ ]+\?\?\?\? 0F77 emms
+[ ]*41[ ]+\.arch \.nommx
+[ ]*42[ ]+\.arch \.nosse3
+[ ]*43[ ]+mwait
+[ ]*44[ ]+\?\?\?\? 0FAEE8 lfence
+[ ]*45[ ]+emms
+[ ]*46[ ]+\.arch \.nosse2
+[ ]*47[ ]+lfence
+[ ]*48[ ]+\?\?\?\? 0F58C0 addps %xmm0, %xmm0
+[ ]*49[ ]+\.arch \.nosse
+[ ]*50[ ]+addps %xmm0, %xmm0
+ GAS LISTING .*
+
+
+[ ]*51[ ]+\?\?\?\? 8DB42600 \.p2align 4
+[ ]*51[ ]+000000
+#pass
diff --git a/gas/testsuite/gas/i386/nosse-4.s b/gas/testsuite/gas/i386/nosse-4.s
new file mode 100644
index 0000000..e2e7f83
--- /dev/null
+++ b/gas/testsuite/gas/i386/nosse-4.s
@@ -0,0 +1,51 @@
+# Test .arch [.sseX|.nosseX]
+ .text
+ .arch generic32
+ .arch .mmx
+ emms
+ addps %xmm0, %xmm0
+ .arch .sse
+ addps %xmm0, %xmm0
+ lfence
+ .arch .sse2
+ lfence
+ mwait
+ .arch .sse3
+ mwait
+ pabsd %xmm0, %xmm0
+ .arch .ssse3
+ pabsd %xmm0, %xmm0
+ ptest %xmm0, %xmm0
+ .arch .sse4.1
+ ptest %xmm0, %xmm0
+ crc32 %eax, %eax
+ .arch .sse4.2
+ crc32 %eax, %eax
+ .arch .nosse
+ .arch .sse4
+ crc32 %eax, %eax
+ .arch .nosse4
+ ptest %xmm0, %xmm0
+ pabsd %xmm0, %xmm0
+ .arch .sse4
+ .arch .nosse4.2
+ crc32 %eax, %eax
+ ptest %xmm0, %xmm0
+ .arch .nosse4.1
+ ptest %xmm0, %xmm0
+ pabsd %xmm0, %xmm0
+ .arch .nossse3
+ pabsd %xmm0, %xmm0
+ mwait
+ emms
+ .arch .nommx
+ .arch .nosse3
+ mwait
+ lfence
+ emms
+ .arch .nosse2
+ lfence
+ addps %xmm0, %xmm0
+ .arch .nosse
+ addps %xmm0, %xmm0
+ .p2align 4
diff --git a/gas/testsuite/gas/i386/nosse-5.d b/gas/testsuite/gas/i386/nosse-5.d
new file mode 100644
index 0000000..3d453ba
--- /dev/null
+++ b/gas/testsuite/gas/i386/nosse-5.d
@@ -0,0 +1,28 @@
+#objdump: -drw
+#name: i386 .nosse
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <.text>:
+[ ]*[a-f0-9]+: c5 d0 58 e6 vaddps %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: c5 d4 58 e6 vaddps %ymm6,%ymm5,%ymm4
+[ ]*[a-f0-9]+: c5 d2 58 e6 vaddss %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: c5 d0 58 e6 vaddps %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: c5 d4 58 e6 vaddps %ymm6,%ymm5,%ymm4
+[ ]*[a-f0-9]+: c5 d2 58 e6 vaddss %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: 62 f1 54 0f 58 e6 vaddps %xmm6,%xmm5,%xmm4\{%k7\}
+[ ]*[a-f0-9]+: 62 f1 54 2f 58 e6 vaddps %ymm6,%ymm5,%ymm4\{%k7\}
+[ ]*[a-f0-9]+: 62 f1 54 48 58 e6 vaddps %zmm6,%zmm5,%zmm4
+[ ]*[a-f0-9]+: 62 f1 54 0f 58 e6 vaddps %xmm6,%xmm5,%xmm4\{%k7\}
+[ ]*[a-f0-9]+: 62 f1 54 2f 58 e6 vaddps %ymm6,%ymm5,%ymm4\{%k7\}
+[ ]*[a-f0-9]+: 62 f1 54 48 58 e6 vaddps %zmm6,%zmm5,%zmm4
+[ ]*[a-f0-9]+: c5 d0 58 e6 vaddps %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: c5 d4 58 e6 vaddps %ymm6,%ymm5,%ymm4
+[ ]*[a-f0-9]+: c5 d2 58 e6 vaddss %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: 62 f1 54 08 58 e6 vaddps %xmm6,%xmm5,%xmm4
+[ ]*[a-f0-9]+: 62 f1 54 28 58 e6 vaddps %ymm6,%ymm5,%ymm4
+[ ]*[a-f0-9]+: 62 f1 54 48 58 e6 vaddps %zmm6,%zmm5,%zmm4
+[ ]*[a-f0-9]+: 62 f1 56 08 58 e6 vaddss %xmm6,%xmm5,%xmm4
+#pass
diff --git a/gas/testsuite/gas/i386/nosse-5.s b/gas/testsuite/gas/i386/nosse-5.s
new file mode 100644
index 0000000..5a299f9
--- /dev/null
+++ b/gas/testsuite/gas/i386/nosse-5.s
@@ -0,0 +1,27 @@
+# Test .arch .nosse with .noavx/.avx/.avx512vl
+ .text
+ .arch generic32
+ .arch .avx
+ vaddps %xmm6, %xmm5, %xmm4
+ vaddps %ymm6, %ymm5, %ymm4
+ vaddss %xmm6, %xmm5, %xmm4
+ .arch .nosse
+ vaddps %xmm6, %xmm5, %xmm4
+ vaddps %ymm6, %ymm5, %ymm4
+ vaddss %xmm6, %xmm5, %xmm4
+ .arch .avx512vl
+ vaddps %xmm6, %xmm5, %xmm4{%k7}
+ vaddps %ymm6, %ymm5, %ymm4{%k7}
+ vaddps %zmm6, %zmm5, %zmm4
+ .arch .nosse
+ vaddps %xmm6, %xmm5, %xmm4{%k7}
+ vaddps %ymm6, %ymm5, %ymm4{%k7}
+ vaddps %zmm6, %zmm5, %zmm4
+ vaddps %xmm6, %xmm5, %xmm4
+ vaddps %ymm6, %ymm5, %ymm4
+ vaddss %xmm6, %xmm5, %xmm4
+ .arch .noavx
+ vaddps %xmm6, %xmm5, %xmm4
+ vaddps %ymm6, %ymm5, %ymm4
+ vaddps %zmm6, %zmm5, %zmm4
+ vaddss %xmm6, %xmm5, %xmm4