aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlexander Fomin <alexander.fomin@intel.com>2016-05-10 21:35:52 +0300
committerAlexander Fomin <alexander.fomin@intel.com>2016-05-10 21:38:39 +0300
commit8bc526963edde8cf8789ce82072d05fd2bcc90c4 (patch)
tree25c9322e513f282eeb724e0213b10bb27e1fddad /gas
parent4f4faa4d43aeaf5dd0a5fe0aff2fde89df3e5b8c (diff)
downloadgdb-8bc526963edde8cf8789ce82072d05fd2bcc90c4.zip
gdb-8bc526963edde8cf8789ce82072d05fd2bcc90c4.tar.gz
gdb-8bc526963edde8cf8789ce82072d05fd2bcc90c4.tar.bz2
Enable Intel RDPID instruction.
This patch enables Intel RDPID instruction described in Intel64 and IA-32 Architectures Software Developer's Manual, April 2016. gas/ * config/tc-i386.c (cpu_arch): Add RDPID. * doc/c-i386.texi: Document RDPID. gas/testsuite/ * gas/i386/i386.exp: Run RDPID tests. * gas/i386/prefix.d: Adjust. * gas/i386/rdpid.s: New test. * gas/i386/rdpid.d: Ditto. * gas/i386/rdpid-intel.d: Ditto. * gas/i386/x86-64-rdpid.s: Ditto. * gas/i386/x86-64-rdpid.d: Ditto. * gas/i386/x86-64-rdpid-intel.d: Ditto. opcodes/ * i386-dis.c (prefix_table): Add RDPID instruction. * i386-gen.c (cpu_flag_init): Add RDPID flag. (cpu_flags): Add RDPID bitfield. * i386-opc.h (enum): Add RDPID element. (i386_cpu_flags): Add RDPID field. * i386-opc.tbl: Add RDPID instruction. * i386-init.h: Regenerate. * i386-tbl.h: Regenerate.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c2
-rw-r--r--gas/doc/c-i386.texi3
-rw-r--r--gas/testsuite/ChangeLog25
-rw-r--r--gas/testsuite/gas/i386/i386.exp4
-rw-r--r--gas/testsuite/gas/i386/prefix.d3
-rw-r--r--gas/testsuite/gas/i386/rdpid-intel.d11
-rw-r--r--gas/testsuite/gas/i386/rdpid.d11
-rw-r--r--gas/testsuite/gas/i386/rdpid.s5
-rw-r--r--gas/testsuite/gas/i386/x86-64-rdpid-intel.d12
-rw-r--r--gas/testsuite/gas/i386/x86-64-rdpid.d12
-rw-r--r--gas/testsuite/gas/i386/x86-64-rdpid.s6
12 files changed, 96 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0012cd7..8e0fe65 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-10 Alexander Fomin <alexander.fomin@intel.com>
+
+ * config/tc-i386.c (cpu_arch): Add RDPID.
+ * doc/c-i386.texi: Document RDPID.
+
2016-05-10 Thomas Preud'homme <thomas.preudhomme@arm.com>
* config/tc-arm.c (arm_adjust_symtab): Use ARM_SET_SYM_BRANCH_TYPE to
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index f382a73..2aeaf7b 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -961,6 +961,8 @@ static const arch_entry cpu_arch[] =
CPU_MWAITX_FLAGS, 0, 0 },
{ STRING_COMMA_LEN (".ospke"), PROCESSOR_UNKNOWN,
CPU_OSPKE_FLAGS, 0, 0 },
+ { STRING_COMMA_LEN (".rdpid"), PROCESSOR_UNKNOWN,
+ CPU_RDPID_FLAGS, 0, 0 },
};
#ifdef I386COFF
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index adbcb99..edd187b 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -153,6 +153,7 @@ accept various extension mnemonics. For example,
@code{smap},
@code{mpx},
@code{sha},
+@code{rdpid},
@code{prefetchwt1},
@code{clflushopt},
@code{se1},
@@ -1173,7 +1174,7 @@ 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{.rdpid}
@end multitable
Apart from the warning, there are only two other effects on
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
new file mode 100644
index 0000000..b3a95ff
--- /dev/null
+++ b/gas/testsuite/ChangeLog
@@ -0,0 +1,25 @@
+2016-05-10 Alexander Fomin <alexander.fomin@intel.com>
+
+ * gas/i386/i386.exp: Run RDPID tests.
+ * gas/i386/prefix.d: Adjust.
+ * gas/i386/rdpid.s: New test.
+ * gas/i386/rdpid.d: Ditto.
+ * gas/i386/rdpid-intel.d: Ditto.
+ * gas/i386/x86-64-rdpid.s: Ditto.
+ * gas/i386/x86-64-rdpid.d: Ditto.
+ * gas/i386/x86-64-rdpid-intel.d: Ditto.
+
+For older changes see ChangeLog-2015
+
+Copyright (C) 2016 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
+
+Local Variables:
+mode: change-log
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 9c4fdea..df1518b 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -346,6 +346,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "mwaitx-bdver4"
run_list_test "mwaitx-reg"
run_dump_test "ospke"
+ run_dump_test "rdpid"
+ run_dump_test "rdpid-intel"
# These tests require support for 8 and 16 bit relocs,
# so we only run them for ELF and COFF targets.
@@ -737,6 +739,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-mwaitx-bdver4"
run_list_test "x86-64-mwaitx-reg"
run_dump_test "x86-64-ospke"
+ run_dump_test "x86-64-rdpid"
+ run_dump_test "x86-64-rdpid-intel"
run_dump_test "x86-64-fence-as-lock-add-yes"
run_dump_test "x86-64-fence-as-lock-add-no"
diff --git a/gas/testsuite/gas/i386/prefix.d b/gas/testsuite/gas/i386/prefix.d
index 7afb0c1..8dd200b 100644
--- a/gas/testsuite/gas/i386/prefix.d
+++ b/gas/testsuite/gas/i386/prefix.d
@@ -63,8 +63,7 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: f3 f0 66 3e 36 90 lock data16 ds ss pause
[ ]*[a-f0-9]+: f3 f2 67 3e 36 90 repz repnz addr16 ds ss nop
[ ]*[a-f0-9]+: f3 67 f2 66 3e 36 90 repz addr16 repnz ds ss xchg %ax,%ax
-[ ]*[a-f0-9]+: f3 0f c7 \(bad\)
-[ ]*[a-f0-9]+: f8 clc
+[ ]*[a-f0-9]+: f3 0f c7 f8 rdpid %eax
[ ]*[a-f0-9]+: 90 nop
[ ]*[a-f0-9]+: f3 0f c7 \(bad\)
[ ]*[a-f0-9]+: f0 90 lock nop
diff --git a/gas/testsuite/gas/i386/rdpid-intel.d b/gas/testsuite/gas/i386/rdpid-intel.d
new file mode 100644
index 0000000..f733b17
--- /dev/null
+++ b/gas/testsuite/gas/i386/rdpid-intel.d
@@ -0,0 +1,11 @@
+#objdump: -dwMintel
+#name: i386 RDPID (Intel disassembly)
+#source: rdpid.s
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*f3 0f c7 f8[ ]*rdpid eax
+#pass
diff --git a/gas/testsuite/gas/i386/rdpid.d b/gas/testsuite/gas/i386/rdpid.d
new file mode 100644
index 0000000..ef67c84
--- /dev/null
+++ b/gas/testsuite/gas/i386/rdpid.d
@@ -0,0 +1,11 @@
+#objdump: -dw
+#name: i386 RDPID insns
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*f3 0f c7 f8[ ]*rdpid %eax
+#pass
diff --git a/gas/testsuite/gas/i386/rdpid.s b/gas/testsuite/gas/i386/rdpid.s
new file mode 100644
index 0000000..fe6e401
--- /dev/null
+++ b/gas/testsuite/gas/i386/rdpid.s
@@ -0,0 +1,5 @@
+# Check 32bit RDPID instructions.
+
+ .text
+_start:
+ rdpid %eax
diff --git a/gas/testsuite/gas/i386/x86-64-rdpid-intel.d b/gas/testsuite/gas/i386/x86-64-rdpid-intel.d
new file mode 100644
index 0000000..240b4fa
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-rdpid-intel.d
@@ -0,0 +1,12 @@
+#objdump: -dwMintel
+#name: x86_64 RDPID (Intel disassembly)
+#source: x86-64-rdpid.s
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*f3 0f c7 f8[ ]*rdpid rax
+[ ]*[a-f0-9]+:[ ]*f3 41 0f c7 fa[ ]*rdpid r10
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-rdpid.d b/gas/testsuite/gas/i386/x86-64-rdpid.d
new file mode 100644
index 0000000..3834784
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-rdpid.d
@@ -0,0 +1,12 @@
+#objdump: -dw
+#name: x86_64 RDPID insns
+
+.*: +file format .*
+
+
+Disassembly of section .text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*f3 0f c7 f8[ ]*rdpid %rax
+[ ]*[a-f0-9]+:[ ]*f3 41 0f c7 fa[ ]*rdpid %r10
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-rdpid.s b/gas/testsuite/gas/i386/x86-64-rdpid.s
new file mode 100644
index 0000000..96647bd
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-rdpid.s
@@ -0,0 +1,6 @@
+# Check 64bit RDPID instructions.
+
+ .text
+_start:
+ rdpid %rax
+ rdpid %r10