diff options
author | Jan Beulich <jbeulich@suse.com> | 2023-02-24 13:59:35 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2023-02-24 13:59:35 +0100 |
commit | cafa5ef72e29d0a203d0c07cbec4e0688c26d1eb (patch) | |
tree | c41857c717df8fb2e2ff879271e7f49574c56f5e /gas | |
parent | c3bb24f5663f3e423f313bc16f27e32ef5e1dc0a (diff) | |
download | gdb-cafa5ef72e29d0a203d0c07cbec4e0688c26d1eb.zip gdb-cafa5ef72e29d0a203d0c07cbec4e0688c26d1eb.tar.gz gdb-cafa5ef72e29d0a203d0c07cbec4e0688c26d1eb.tar.bz2 |
x86: MONITOR/MWAIT are not SSE3 insns
These have their own CPUID bit and hence they should also have their own
separate control.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-i386.c | 1 | ||||
-rw-r--r-- | gas/doc/c-i386.texi | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10-1.l | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10-2.l | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10-3.l | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10-4.l | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10-6.l | 99 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10-6.s | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10-lzcnt.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10-prefetchw.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/arch-10.s | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/i386.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nosse-3.l | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nosse-3.s | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nosse-4.l | 38 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/nosse-4.s | 2 |
17 files changed, 140 insertions, 28 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 71d991b..3df0a47 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1027,6 +1027,7 @@ static const arch_entry cpu_arch[] = SUBARCH (avx512dq, AVX512DQ, ANY_AVX512DQ, false), SUBARCH (avx512bw, AVX512BW, ANY_AVX512BW, false), SUBARCH (avx512vl, AVX512VL, ANY_AVX512VL, false), + SUBARCH (monitor, MONITOR, MONITOR, false), SUBARCH (vmx, VMX, ANY_VMX, false), SUBARCH (vmfunc, VMFUNC, ANY_VMFUNC, false), SUBARCH (smx, SMX, SMX, false), diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi index f529383..d35f93c 100644 --- a/gas/doc/c-i386.texi +++ b/gas/doc/c-i386.texi @@ -152,6 +152,7 @@ accept various extension mnemonics. For example, @code{avx}, @code{avx2}, @code{lahf_sahf}, +@code{monitor}, @code{adx}, @code{rdseed}, @code{prfchw}, @@ -1487,7 +1488,7 @@ supported on the CPU specified. The choices for @var{cpu_type} are: @item @samp{.aes} @tab @samp{.pclmul} @tab @samp{.fma} @tab @samp{.fsgsbase} @item @samp{.rdrnd} @tab @samp{.f16c} @tab @samp{.avx2} @tab @samp{.bmi2} @item @samp{.lzcnt} @tab @samp{.popcnt} @tab @samp{.invpcid} @tab @samp{.vmfunc} -@item @samp{.hle} @tab @samp{.rtm} @tab @samp{.tsx} +@item @samp{.monitor} @tab @samp{.hle} @tab @samp{.rtm} @tab @samp{.tsx} @item @samp{.lahf_sahf} @tab @samp{.adx} @tab @samp{.rdseed} @tab @samp{.prfchw} @item @samp{.smap} @tab @samp{.mpx} @tab @samp{.sha} @tab @samp{.prefetchwt1} @item @samp{.clflushopt} @tab @samp{.xsavec} @tab @samp{.xsaves} @tab @samp{.se1} diff --git a/gas/testsuite/gas/i386/arch-10-1.l b/gas/testsuite/gas/i386/arch-10-1.l index c47d01d..6c954cd 100644 --- a/gas/testsuite/gas/i386/arch-10-1.l +++ b/gas/testsuite/gas/i386/arch-10-1.l @@ -30,6 +30,7 @@ .*:60: Error: .* .*:62: Error: .* .*:64: Error: .* +.*:66: Error: .* GAS LISTING .* @@ -101,3 +102,5 @@ GAS LISTING .* [ ]*62[ ]+blsr %ecx,%ebx [ ]*63[ ]+\# TBM [ ]*64[ ]+blcfill %ecx,%ebx +[ ]*65[ ]+\# MONITOR +[ ]*66[ ]+monitor diff --git a/gas/testsuite/gas/i386/arch-10-2.l b/gas/testsuite/gas/i386/arch-10-2.l index 65f09a5..4eed783 100644 --- a/gas/testsuite/gas/i386/arch-10-2.l +++ b/gas/testsuite/gas/i386/arch-10-2.l @@ -29,6 +29,7 @@ .*:60: Error: .* .*:62: Error: .* .*:64: Error: .* +.*:66: Error: .* GAS LISTING .* @@ -100,3 +101,5 @@ GAS LISTING .* [ ]*62[ ]+blsr %ecx,%ebx [ ]*63[ ]+\# TBM [ ]*64[ ]+blcfill %ecx,%ebx +[ ]*65[ ]+\# MONITOR +[ ]*66[ ]+monitor diff --git a/gas/testsuite/gas/i386/arch-10-3.l b/gas/testsuite/gas/i386/arch-10-3.l index 13ff5db..cbad562 100644 --- a/gas/testsuite/gas/i386/arch-10-3.l +++ b/gas/testsuite/gas/i386/arch-10-3.l @@ -22,6 +22,7 @@ .*:60: Error: .* .*:62: Error: .* .*:64: Error: .* +.*:66: Error: .* GAS LISTING .* @@ -96,3 +97,5 @@ GAS LISTING .* [ ]*62[ ]+blsr %ecx,%ebx [ ]*63[ ]+\# TBM [ ]*64[ ]+blcfill %ecx,%ebx +[ ]*65[ ]+\# MONITOR +[ ]*66[ ]+monitor diff --git a/gas/testsuite/gas/i386/arch-10-4.l b/gas/testsuite/gas/i386/arch-10-4.l index df795ba..3de221f 100644 --- a/gas/testsuite/gas/i386/arch-10-4.l +++ b/gas/testsuite/gas/i386/arch-10-4.l @@ -20,6 +20,7 @@ .*:60: Error: .* .*:62: Error: .* .*:64: Error: .* +.*:66: Error: .* GAS LISTING .* @@ -94,3 +95,5 @@ GAS LISTING .* [ ]*62[ ]+blsr %ecx,%ebx [ ]*63[ ]+\# TBM [ ]*64[ ]+blcfill %ecx,%ebx +[ ]*65[ ]+\# MONITOR +[ ]*66[ ]+monitor diff --git a/gas/testsuite/gas/i386/arch-10-6.l b/gas/testsuite/gas/i386/arch-10-6.l new file mode 100644 index 0000000..dc258d2 --- /dev/null +++ b/gas/testsuite/gas/i386/arch-10-6.l @@ -0,0 +1,99 @@ +.*: Assembler messages: +.*:4: Error: .* +.*:6: Error: .* +.*:8: Error: .* +.*:10: Error: .* +.*:12: Error: .* +.*:14: Error: .* +.*:16: Error: .* +.*:18: Error: .* +.*:20: Error: .* +.*:22: Error: .* +.*:24: Error: .* +.*:26: Error: .* +.*:28: Error: .* +.*:30: Error: .* +.*:32: Error: .* +.*:34: Error: .* +.*:36: Error: .* +.*:38: Error: .* +.*:40: Error: .* +.*:42: Error: .* +.*:44: Error: .* +.*:46: Error: .* +.*:48: Error: .* +.*:50: Error: .* +.*:52: Error: .* +.*:54: Error: .* +.*:56: Error: .* +.*:58: Error: .* +.*:60: Error: .* +.*:62: Error: .* +.*:64: Error: .* +[ ]*1[ ]+\.include "arch-10\.s" +[ ]*1[ ]+\# Test -march= +[ ]*2[ ]+\.text +[ ]*3[ ]+\# cmov feature * +[ ]*4[ ]+cmove %eax,%ebx +[ ]*5[ ]+\# clflush +[ ]*6[ ]+clflush \(%eax\) +[ ]*7[ ]+\# SYSCALL +[ ]*8[ ]+syscall +[ ]*9[ ]+\# MMX +[ ]*10[ ]+paddb %mm4,%mm3 +[ ]*11[ ]+\# SSE +[ ]*12[ ]+addss %xmm4,%xmm3 +[ ]*13[ ]+\# SSE2 +[ ]*14[ ]+addsd %xmm4,%xmm3 +[ ]*15[ ]+\# SSE3 +[ ]*16[ ]+addsubpd %xmm4,%xmm3 +[ ]*17[ ]+\# SSSE3 +[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]+\# TBM +[ ]*64[ ]+blcfill %ecx,%ebx +[ ]*65[ ]+\# MONITOR +[ ]*66[ ]+\?\?\?\? 0F01C8 monitor diff --git a/gas/testsuite/gas/i386/arch-10-6.s b/gas/testsuite/gas/i386/arch-10-6.s new file mode 100644 index 0000000..6805c7a --- /dev/null +++ b/gas/testsuite/gas/i386/arch-10-6.s @@ -0,0 +1 @@ +.include "arch-10.s" diff --git a/gas/testsuite/gas/i386/arch-10-lzcnt.d b/gas/testsuite/gas/i386/arch-10-lzcnt.d index d772085..c75f6f3 100644 --- a/gas/testsuite/gas/i386/arch-10-lzcnt.d +++ b/gas/testsuite/gas/i386/arch-10-lzcnt.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+3dnowa+sse4a+svme+lzcnt+padlock+bmi+tbm +#as: -march=i686+nop+avx+vmx+smx+xsave+xsaveopt+aes+pclmul+fma+movbe+ept+clflush+syscall+monitor+rdtscp+3dnowa+sse4a+svme+lzcnt+padlock+bmi+tbm #objdump: -dw #name: i386 arch 10 (lzcnt) #dump: arch-10.d diff --git a/gas/testsuite/gas/i386/arch-10-prefetchw.d b/gas/testsuite/gas/i386/arch-10-prefetchw.d index 2aaeb79..1f8159a 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+mmx+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+monitor+rdtscp+sse4a+svme+lzcnt+padlock+bmi+tbm+prfchw #objdump: -dw #name: i386 arch 10 (prefetchw) #dump: arch-10.d diff --git a/gas/testsuite/gas/i386/arch-10.d b/gas/testsuite/gas/i386/arch-10.d index d89a31e..41ede17 100644 --- a/gas/testsuite/gas/i386/arch-10.d +++ b/gas/testsuite/gas/i386/arch-10.d @@ -1,4 +1,4 @@ -#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 +#as: -march=i686+mmx+avx+vmx+smx+xsave+xsaveopt+aes+pclmul+fma+movbe+ept+clflush+nop+syscall+monitor+rdtscp+3dnowa+sse4a+svme+abm+padlock+bmi+tbm #objdump: -dw #name: i386 arch 10 @@ -38,4 +38,5 @@ Disassembly of section .text: [ ]*[a-f0-9]+: 0f 1f 00 nopl \(%eax\) [ ]*[a-f0-9]+: c4 e2 60 f3 c9 blsr %ecx,%ebx [ ]*[a-f0-9]+: 8f e9 60 01 c9 blcfill %ecx,%ebx +[ ]*[a-f0-9]+: 0f 01 c8 monitor( .*) #pass diff --git a/gas/testsuite/gas/i386/arch-10.s b/gas/testsuite/gas/i386/arch-10.s index 39989d1..785824e 100644 --- a/gas/testsuite/gas/i386/arch-10.s +++ b/gas/testsuite/gas/i386/arch-10.s @@ -62,3 +62,5 @@ nopl (%eax) blsr %ecx,%ebx # TBM blcfill %ecx,%ebx +# MONITOR +monitor diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp index 8d5f4e8..590cd78 100644 --- a/gas/testsuite/gas/i386/i386.exp +++ b/gas/testsuite/gas/i386/i386.exp @@ -206,6 +206,7 @@ if [gas_32_check] then { 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_list_test "arch-10-5" "-march=generic32+i686 -al" + run_list_test "arch-10-6" "-march=generic32+monitor -I${srcdir}/$subdir -aln" run_dump_test "arch-11" run_dump_test "arch-12" run_dump_test "arch-13" diff --git a/gas/testsuite/gas/i386/nosse-3.l b/gas/testsuite/gas/i386/nosse-3.l index 6626928..5570f3a 100644 --- a/gas/testsuite/gas/i386/nosse-3.l +++ b/gas/testsuite/gas/i386/nosse-3.l @@ -5,3 +5,4 @@ GAS LISTING .* [ ]*1[ ]+\# Test -march=\+nosse [ ]*2[ ]+\.text [ ]*3[ ]+lfence +[ ]*4[ ]+\?\?\?\? 0F01C8 monitor diff --git a/gas/testsuite/gas/i386/nosse-3.s b/gas/testsuite/gas/i386/nosse-3.s index b2ba5f7..7814969 100644 --- a/gas/testsuite/gas/i386/nosse-3.s +++ b/gas/testsuite/gas/i386/nosse-3.s @@ -1,3 +1,4 @@ # Test -march=+nosse .text lfence + monitor diff --git a/gas/testsuite/gas/i386/nosse-4.l b/gas/testsuite/gas/i386/nosse-4.l index 3d840fa..d2af33f 100644 --- a/gas/testsuite/gas/i386/nosse-4.l +++ b/gas/testsuite/gas/i386/nosse-4.l @@ -2,6 +2,7 @@ .*:6: Error: .*generic.* .*:9: Error: .*\.sse.* .*:12: Error: .*\.sse2.* +.*:14: Error: .*\.sse3.* .*:15: Error: .*\.sse3.* .*:18: Error: .*\.ssse3.* .*:21: Error: .*\.sse4\.1.* @@ -9,10 +10,9 @@ .*:32: Error: .*\.nosse4\.2.* .*:35: Error: .*\.nosse4\.1.* .*:38: Error: .*\.nossse3.* -.*:43: Error: .*\.nosse3.* -.*:45: Error: .*\.nommx.* -.*:47: Error: .*\.nosse2.* -.*:50: Error: .*\.nosse.* +.*:43: Error: .*\.nommx.* +.*:45: Error: .*\.nosse2.* +.*:48: Error: .*\.nosse.* GAS LISTING .* #... [ ]*1[ ]+\# Test \.arch \[\.sseX|\.nosseX\] @@ -28,7 +28,7 @@ GAS LISTING .* [ ]*11[ ]+\?\?\?\? 0FAEE8 lfence [ ]*12[ ]+mwait [ ]*13[ ]+\.arch \.sse3 -[ ]*14[ ]+\?\?\?\? 0F01C9 mwait +[ ]*14[ ]+mwait [ ]*15[ ]+pabsd %xmm0, %xmm0 [ ]*16[ ]+\.arch \.ssse3 [ ]*17[ ]+\?\?\?\? 660F381E pabsd %xmm0, %xmm0 @@ -60,21 +60,15 @@ GAS LISTING .* [ ]*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 +[ ]*39[ ]+\?\?\?\? 0F77 emms +[ ]*40[ ]+\.arch \.nommx +[ ]*41[ ]+\.arch \.nosse3 +[ ]*42[ ]+\?\?\?\? 0FAEE8 lfence +[ ]*43[ ]+emms +[ ]*44[ ]+\.arch \.nosse2 +[ ]*45[ ]+lfence +[ ]*46[ ]+\?\?\?\? 0F58C0 addps %xmm0, %xmm0 +[ ]*47[ ]+\.arch \.nosse +[ ]*48[ ]+addps %xmm0, %xmm0 +[ ]*49[ ]+\?\?\?\? .* \.p2align 4 #pass diff --git a/gas/testsuite/gas/i386/nosse-4.s b/gas/testsuite/gas/i386/nosse-4.s index e2e7f83..87712d5 100644 --- a/gas/testsuite/gas/i386/nosse-4.s +++ b/gas/testsuite/gas/i386/nosse-4.s @@ -36,11 +36,9 @@ pabsd %xmm0, %xmm0 .arch .nossse3 pabsd %xmm0, %xmm0 - mwait emms .arch .nommx .arch .nosse3 - mwait lfence emms .arch .nosse2 |