aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog29
-rw-r--r--gas/config/tc-i386.c25
-rw-r--r--gas/doc/c-i386.texi13
-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
17 files changed, 482 insertions, 10 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a9d2268..ccd8c07 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,34 @@
2016-05-27 H.J. Lu <hongjiu.lu@intel.com>
+ 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.
+
+2016-05-27 H.J. Lu <hongjiu.lu@intel.com>
+
PR gas/20154
* config/tc-i386.c (cpu_flags_match): Don't set cpuamd64 nor
cpuintel64.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 8358740..b69130a 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -823,6 +823,8 @@ static const arch_entry cpu_arch[] =
CPU_287_FLAGS, 0 },
{ STRING_COMMA_LEN (".387"), PROCESSOR_UNKNOWN,
CPU_387_FLAGS, 0 },
+ { STRING_COMMA_LEN (".687"), PROCESSOR_UNKNOWN,
+ CPU_687_FLAGS, 0 },
{ STRING_COMMA_LEN (".mmx"), PROCESSOR_UNKNOWN,
CPU_MMX_FLAGS, 0 },
{ STRING_COMMA_LEN (".sse"), PROCESSOR_UNKNOWN,
@@ -972,9 +974,19 @@ static const arch_entry cpu_arch[] =
static const noarch_entry cpu_noarch[] =
{
{ STRING_COMMA_LEN ("no87"), CPU_ANY_X87_FLAGS },
+ { STRING_COMMA_LEN ("no287"), CPU_ANY_287_FLAGS },
+ { STRING_COMMA_LEN ("no387"), CPU_ANY_387_FLAGS },
+ { STRING_COMMA_LEN ("no687"), CPU_ANY_687_FLAGS },
{ STRING_COMMA_LEN ("nommx"), CPU_ANY_MMX_FLAGS },
{ STRING_COMMA_LEN ("nosse"), CPU_ANY_SSE_FLAGS },
+ { STRING_COMMA_LEN ("nosse2"), CPU_ANY_SSE2_FLAGS },
+ { STRING_COMMA_LEN ("nosse3"), CPU_ANY_SSE3_FLAGS },
+ { STRING_COMMA_LEN ("nossse3"), CPU_ANY_SSSE3_FLAGS },
+ { STRING_COMMA_LEN ("nosse4.1"), CPU_ANY_SSE4_1_FLAGS },
+ { STRING_COMMA_LEN ("nosse4.2"), CPU_ANY_SSE4_2_FLAGS },
+ { STRING_COMMA_LEN ("nosse4"), CPU_ANY_SSE4_1_FLAGS },
{ STRING_COMMA_LEN ("noavx"), CPU_ANY_AVX_FLAGS },
+ { STRING_COMMA_LEN ("noavx2"), CPU_ANY_AVX2_FLAGS },
};
#ifdef I386COFF
@@ -9537,17 +9549,20 @@ parse_real_register (char *reg_string, char **end_op)
&& !cpu_arch_flags.bitfield.cpu387)
return (const reg_entry *) NULL;
- if (r->reg_type.bitfield.regmmx && !cpu_arch_flags.bitfield.cpummx)
+ if (r->reg_type.bitfield.regmmx && !cpu_arch_flags.bitfield.cpuregmmx)
return (const reg_entry *) NULL;
- if (r->reg_type.bitfield.regxmm && !cpu_arch_flags.bitfield.cpusse)
+ if (r->reg_type.bitfield.regxmm && !cpu_arch_flags.bitfield.cpuregxmm)
return (const reg_entry *) NULL;
- if (r->reg_type.bitfield.regymm && !cpu_arch_flags.bitfield.cpuavx)
+ if (r->reg_type.bitfield.regymm && !cpu_arch_flags.bitfield.cpuregymm)
return (const reg_entry *) NULL;
- if ((r->reg_type.bitfield.regzmm || r->reg_type.bitfield.regmask)
- && !cpu_arch_flags.bitfield.cpuavx512f)
+ if (r->reg_type.bitfield.regzmm && !cpu_arch_flags.bitfield.cpuregzmm)
+ return (const reg_entry *) NULL;
+
+ if (r->reg_type.bitfield.regmask
+ && !cpu_arch_flags.bitfield.cpuregmask)
return (const reg_entry *) NULL;
/* Don't allow fake index register unless allow_index_reg isn't 0. */
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index edd187b..696cadf 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -134,7 +134,11 @@ accept various extension mnemonics. For example,
@code{8087},
@code{287},
@code{387},
+@code{687},
@code{no87},
+@code{no287},
+@code{no387},
+@code{no687},
@code{mmx},
@code{nommx},
@code{sse},
@@ -145,8 +149,16 @@ accept various extension mnemonics. For example,
@code{sse4.2},
@code{sse4},
@code{nosse},
+@code{nosse2},
+@code{nosse3},
+@code{nossse3},
+@code{nosse4.1},
+@code{nosse4.2},
+@code{nosse4},
@code{avx},
@code{avx2},
+@code{noavx},
+@code{noavx2},
@code{adx},
@code{rdseed},
@code{prfchw},
@@ -168,7 +180,6 @@ accept various extension mnemonics. For example,
@code{avx512dq},
@code{avx512ifma},
@code{avx512vbmi},
-@code{noavx},
@code{vmx},
@code{vmfunc},
@code{smx},
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