aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-11-07 09:29:14 +0100
committerJan Beulich <jbeulich@suse.com>2019-11-07 09:29:14 +0100
commit142861dfd5b55fe4440c35351a068dcde4ad8ce9 (patch)
tree82f0a734706af0d57cd3e46d045d92e0bda78680 /gas
parent081e283fafb415b4e37f2ac1d5f945ad0b61e282 (diff)
downloadfsf-binutils-gdb-142861dfd5b55fe4440c35351a068dcde4ad8ce9.zip
fsf-binutils-gdb-142861dfd5b55fe4440c35351a068dcde4ad8ce9.tar.gz
fsf-binutils-gdb-142861dfd5b55fe4440c35351a068dcde4ad8ce9.tar.bz2
x86: support further AMD Zen2 instructions
Both RDPRU and MCOMMIT have been publicly documented meanwhile: https://www.amd.com/system/files/TechDocs/24594.pdf.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog15
-rw-r--r--gas/config/tc-i386.c4
-rw-r--r--gas/doc/c-i386.texi5
-rw-r--r--gas/testsuite/gas/i386/arch-13-znver1.d28
-rw-r--r--gas/testsuite/gas/i386/arch-13-znver2.d26
-rw-r--r--gas/testsuite/gas/i386/arch-13.d4
-rw-r--r--gas/testsuite/gas/i386/arch-13.s6
-rw-r--r--gas/testsuite/gas/i386/x86-64-arch-3-znver1.d2
-rw-r--r--gas/testsuite/gas/i386/x86-64-arch-3.d4
-rw-r--r--gas/testsuite/gas/i386/x86-64-arch-3.s6
10 files changed, 45 insertions, 55 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0a05d16..e59f3d9 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,20 @@
2019-11-07 Jan Beulich <jbeulich@suse.com>
+ * config/tc-i386.c (cpu_arch): Add .rdpru and .mcommit entries.
+ * doc/c-i386.texi: Mention rdpru and mcommit.
+ * testsuite/gas/i386/arch-13.s,
+ testsuite/gas/i386/x86-64-arch-3.s: Add mcommit and rdpru cases.
+ * testsuite/gas/i386/arch-13.d,
+ testsuite/gas/i386/x86-64-arch-3.d: Extend -march=. Adjust
+ expectations.
+ * testsuite/gas/i386/arch-13-znver1.d: Extend -march=. Redirect
+ expectations to arch-13.d.
+ * testsuite/gas/i386/arch-13-znver2.d: Redirect expectations to
+ arch-13.d.
+ testsuite/gas/i386/x86-64-arch-3-znver1.d: Extend -march=.
+
+2019-11-07 Jan Beulich <jbeulich@suse.com>
+
* testsuite/gas/i386/x86-64-arch-3.s: Add monitorx/mwaitx cases
with canonical operand sizes.
* testsuite/gas/i386/x86-64-sse3.s: Add monitor/mwait cases with
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 5866bd6..ad51daf 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1089,6 +1089,10 @@ static const arch_entry cpu_arch[] =
CPU_AVX512_VP2INTERSECT_FLAGS, 0 },
{ STRING_COMMA_LEN (".enqcmd"), PROCESSOR_UNKNOWN,
CPU_ENQCMD_FLAGS, 0 },
+ { STRING_COMMA_LEN (".rdpru"), PROCESSOR_UNKNOWN,
+ CPU_RDPRU_FLAGS, 0 },
+ { STRING_COMMA_LEN (".mcommit"), PROCESSOR_UNKNOWN,
+ CPU_MCOMMIT_FLAGS, 0 },
};
static const noarch_entry cpu_noarch[] =
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index 6fad69f..589b426 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -245,6 +245,8 @@ accept various extension mnemonics. For example,
@code{pconfig},
@code{waitpkg},
@code{cldemote},
+@code{rdpru},
+@code{mcommit},
@code{lwp},
@code{fma4},
@code{xop},
@@ -1341,7 +1343,8 @@ supported on the CPU specified. The choices for @var{cpu_type} are:
@item @samp{.3dnow} @tab @samp{.3dnowa} @tab @samp{.sse4a} @tab @samp{.sse5}
@item @samp{.syscall} @tab @samp{.rdtscp} @tab @samp{.svme} @tab @samp{.abm}
@item @samp{.lwp} @tab @samp{.fma4} @tab @samp{.xop} @tab @samp{.cx16}
-@item @samp{.padlock} @tab @samp{.clzero} @tab @samp{.mwaitx}
+@item @samp{.padlock} @tab @samp{.clzero} @tab @samp{.mwaitx} @tab @samp{.rdpru}
+@item @samp{.mcommit}
@end multitable
Apart from the warning, there are only two other effects on
diff --git a/gas/testsuite/gas/i386/arch-13-znver1.d b/gas/testsuite/gas/i386/arch-13-znver1.d
index 8e84b5e..df7ebf5 100644
--- a/gas/testsuite/gas/i386/arch-13-znver1.d
+++ b/gas/testsuite/gas/i386/arch-13-znver1.d
@@ -1,29 +1,5 @@
#source: arch-13.s
-#as: -march=znver1+rdpid+clwb+wbnoinvd
+#as: -march=znver1+rdpid+clwb+wbnoinvd+rdpru+mcommit
#objdump: -dw
#name: i386 arch 13 (znver1)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <.text>:
-[ ]*[a-f0-9]+: 0f 01 ca clac
-[ ]*[a-f0-9]+: 0f 01 cb stac
-[ ]*[a-f0-9]+: 66 0f 38 f6 ca adcx %edx,%ecx
-[ ]*[a-f0-9]+: f3 0f 38 f6 ca adox %edx,%ecx
-[ ]*[a-f0-9]+: 0f c7 f8 rdseed %eax
-[ ]*[a-f0-9]+: 0f 01 fc clzero
-[ ]*[a-f0-9]+: 0f c7 21 xsavec \(%ecx\)
-[ ]*[a-f0-9]+: 0f c7 29 xsaves \(%ecx\)
-[ ]*[a-f0-9]+: 66 0f ae 39 clflushopt \(%ecx\)
-[ ]*[a-f0-9]+: 0f 01 fa monitorx %eax,%ecx,%edx
-[ ]*[a-f0-9]+: 67 0f 01 fa monitorx %ax,%ecx,%edx
-[ ]*[a-f0-9]+: 0f 01 fa monitorx %eax,%ecx,%edx
-[ ]*[a-f0-9]+: 0f 01 fb mwaitx %eax,%ecx,%ebx
-[ ]*[a-f0-9]+: 0f 01 fb mwaitx %eax,%ecx,%ebx
-[ ]*[a-f0-9]+:[ ]*66 0f ae 31[ ]*clwb \(%ecx\)
-[ ]*[a-f0-9]+:[ ]*66 0f ae b4 f4 c0 1d fe ff[ ]*clwb -0x1e240\(%esp,%esi,8\)
-[ ]*[a-f0-9]+:[ ]*f3 0f c7 f8[ ]*rdpid %eax
-[ ]*[a-f0-9]+:[ ]*f3 0f 09[ ]*wbnoinvd[ ]*
-#pass
+#dump: arch-13.d
diff --git a/gas/testsuite/gas/i386/arch-13-znver2.d b/gas/testsuite/gas/i386/arch-13-znver2.d
index e780bf9..c410305 100644
--- a/gas/testsuite/gas/i386/arch-13-znver2.d
+++ b/gas/testsuite/gas/i386/arch-13-znver2.d
@@ -2,28 +2,4 @@
#as: -march=znver2
#objdump: -dw
#name: i386 arch 13 (znver2)
-
-.*: file format .*
-
-Disassembly of section .text:
-
-0+ <.text>:
-[ ]*[a-f0-9]+: 0f 01 ca clac[ ]*
-[ ]*[a-f0-9]+: 0f 01 cb stac[ ]*
-[ ]*[a-f0-9]+: 66 0f 38 f6 ca adcx %edx,%ecx
-[ ]*[a-f0-9]+: f3 0f 38 f6 ca adox %edx,%ecx
-[ ]*[a-f0-9]+: 0f c7 f8 rdseed %eax
-[ ]*[a-f0-9]+: 0f 01 fc clzero[ ]*
-[ ]*[a-f0-9]+: 0f c7 21 xsavec \(%ecx\)
-[ ]*[a-f0-9]+: 0f c7 29 xsaves \(%ecx\)
-[ ]*[a-f0-9]+: 66 0f ae 39 clflushopt \(%ecx\)
-[ ]*[a-f0-9]+: 0f 01 fa monitorx %eax,%ecx,%edx
-[ ]*[a-f0-9]+: 67 0f 01 fa monitorx %ax,%ecx,%edx
-[ ]*[a-f0-9]+: 0f 01 fa monitorx %eax,%ecx,%edx
-[ ]*[a-f0-9]+: 0f 01 fb mwaitx %eax,%ecx,%ebx
-[ ]*[a-f0-9]+: 0f 01 fb mwaitx %eax,%ecx,%ebx
-[ ]*[a-f0-9]+:[ ]*66 0f ae 31[ ]*clwb \(%ecx\)
-[ ]*[a-f0-9]+:[ ]*66 0f ae b4 f4 c0 1d fe ff[ ]*clwb -0x1e240\(%esp,%esi,8\)
-[ ]*[a-f0-9]+:[ ]*f3 0f c7 f8[ ]*rdpid %eax
-[ ]*[a-f0-9]+:[ ]*f3 0f 09[ ]*wbnoinvd[ ]*
-#pass
+#dump: arch-13.d
diff --git a/gas/testsuite/gas/i386/arch-13.d b/gas/testsuite/gas/i386/arch-13.d
index ad18c31..b9d79b4 100644
--- a/gas/testsuite/gas/i386/arch-13.d
+++ b/gas/testsuite/gas/i386/arch-13.d
@@ -1,4 +1,4 @@
-#as: -march=i686+smap+adx+rdseed+clzero+xsavec+xsaves+clflushopt+mwaitx+rdpid+clwb+wbnoinvd
+#as: -march=i686+smap+adx+rdseed+clzero+xsavec+xsaves+clflushopt+mwaitx+rdpid+clwb+wbnoinvd+rdpru+mcommit
#objdump: -dw
#name: i386 arch 13
@@ -23,6 +23,8 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 01 fb mwaitx %eax,%ecx,%ebx
[ ]*[a-f0-9]+:[ ]*66 0f ae 31[ ]*clwb \(%ecx\)
[ ]*[a-f0-9]+:[ ]*66 0f ae b4 f4 c0 1d fe ff[ ]*clwb -0x1e240\(%esp,%esi,8\)
+[ ]*[a-f0-9]+:[ ]*f3 0f 01 fa[ ]*mcommit[ ]*
[ ]*[a-f0-9]+:[ ]*f3 0f c7 f8[ ]*rdpid %eax
+[ ]*[a-f0-9]+:[ ]*0f 01 fd[ ]*rdpru[ ]*
[ ]*[a-f0-9]+:[ ]*f3 0f 09[ ]*wbnoinvd[ ]*
#pass
diff --git a/gas/testsuite/gas/i386/arch-13.s b/gas/testsuite/gas/i386/arch-13.s
index 1766cc2..56d421b 100644
--- a/gas/testsuite/gas/i386/arch-13.s
+++ b/gas/testsuite/gas/i386/arch-13.s
@@ -27,8 +27,14 @@
clwb (%ecx) # CLWB
clwb -123456(%esp,%esi,8) # CLWB
+# mcommit instruction
+ mcommit
+
# rdpid instruction
rdpid %eax
+# rdpru instruction
+ rdpru
+
# wbnoinvd instruction
wbnoinvd
diff --git a/gas/testsuite/gas/i386/x86-64-arch-3-znver1.d b/gas/testsuite/gas/i386/x86-64-arch-3-znver1.d
index e5a6228..e7e62d9 100644
--- a/gas/testsuite/gas/i386/x86-64-arch-3-znver1.d
+++ b/gas/testsuite/gas/i386/x86-64-arch-3-znver1.d
@@ -1,5 +1,5 @@
#source: x86-64-arch-3.s
-#as: -march=znver1+rdpid+clwb+wbnoinvd
+#as: -march=znver1+rdpid+clwb+wbnoinvd+rdpru+mcommit
#objdump: -dw
#name: x86-64 arch 3 (znver1)
#dump: x86-64-arch-3.d
diff --git a/gas/testsuite/gas/i386/x86-64-arch-3.d b/gas/testsuite/gas/i386/x86-64-arch-3.d
index 9f5bd61..19d34fc 100644
--- a/gas/testsuite/gas/i386/x86-64-arch-3.d
+++ b/gas/testsuite/gas/i386/x86-64-arch-3.d
@@ -1,4 +1,4 @@
-#as: -march=generic64+smap+adx+rdseed+clzero+sha+xsavec+xsaves+clflushopt+mwaitx+rdpid+clwb+wbnoinvd
+#as: -march=generic64+smap+adx+rdseed+clzero+sha+xsavec+xsaves+clflushopt+mwaitx+rdpid+clwb+wbnoinvd+rdpru+mcommit
#objdump: -dw
#name: x86-64 arch 3
@@ -27,7 +27,9 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 01 fb mwaitx %eax,%ecx,%ebx
[ ]*[a-f0-9]+:[ ]*66 0f ae 31[ ]*clwb \(%rcx\)
[ ]*[a-f0-9]+:[ ]*66 42 0f ae b4 f0 23 01 00 00[ ]*clwb 0x123\(%rax,%r14,8\)
+[ ]*[a-f0-9]+:[ ]*f3 0f 01 fa[ ]*mcommit[ ]*
[ ]*[a-f0-9]+:[ ]*f3 0f c7 f8[ ]*rdpid %rax
[ ]*[a-f0-9]+:[ ]*f3 41 0f c7 fa[ ]*rdpid %r10
+[ ]*[a-f0-9]+:[ ]*0f 01 fd[ ]*rdpru[ ]*
[ ]*[a-f0-9]+:[ ]*f3 0f 09[ ]*wbnoinvd[ ]*
#pass
diff --git a/gas/testsuite/gas/i386/x86-64-arch-3.s b/gas/testsuite/gas/i386/x86-64-arch-3.s
index 1f5a0e6..e002af4 100644
--- a/gas/testsuite/gas/i386/x86-64-arch-3.s
+++ b/gas/testsuite/gas/i386/x86-64-arch-3.s
@@ -30,9 +30,15 @@
clwb (%rcx) # CLWB
clwb 0x123(%rax,%r14,8) # CLWB
+# mcommit instruction
+ mcommit
+
# rdpid instruction
rdpid %rax
rdpid %r10
+# rdpru instruction
+ rdpru
+
# wbnoinvd instruction
wbnoinvd