aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorIgor Tsimbalist <igor.v.tsimbalist@intel.com>2018-04-16 23:09:01 +0200
committerIgor Tsimbalist <igor.v.tsimbalist@intel.com>2018-04-17 11:56:34 +0200
commitc48935d75f720ecb006c81b37f4058e751f1dc31 (patch)
treed43c586c582243ca9af171c54c1bb1f66d31cc3d /gas
parentf954747f10467071b0acde07ee5f5e268ab606a6 (diff)
downloadfsf-binutils-gdb-c48935d75f720ecb006c81b37f4058e751f1dc31.zip
fsf-binutils-gdb-c48935d75f720ecb006c81b37f4058e751f1dc31.tar.gz
fsf-binutils-gdb-c48935d75f720ecb006c81b37f4058e751f1dc31.tar.bz2
Enable Intel CLDEMOTE instruction.
gas/ * config/tc-i386.c (cpu_arch): Add .cldemote. * doc/c-i386.texi: Document cldemote/.cldemote. * testsuite/gas/i386/cldemote-intel.d: New. * testsuite/gas/i386/cldemote.d: Likewise. * testsuite/gas/i386/cldemote.s: Likewise. * testsuite/gas/i386/i386.exp: Run new tests. * testsuite/gas/i386/x86-64-cldemote-intel.d: New. * testsuite/gas/i386/x86-64-cldemote.d: Likewise. * testsuite/gas/i386/x86-64-cldemote.s: Likewise. * testsuite/gas/i386/ilp32/x86-64-nops.d: Remove 0x0f1c NOP encoding that maps to cldemote. * testsuite/gas/i386/nops.d: Likewise. * testsuite/gas/i386/nops.s: Likewise. * testsuite/gas/i386/x86-64-nops.d: Likewise. * testsuite/gas/i386/x86-64-nops.s: Likewise. opcode/ * i386-dis.c: Add REG_0F1C_MOD_0, MOD_0F1C_PREFIX_0, PREFIX_0F1C. * i386-gen.c (cpu_flag_init): Add CPU_CLDEMOTE_FLAGS, (cpu_flags): Add CpuCLDEMOTE. * i386-init.h: Regenerate. * i386-opc.h (enum): Add CpuCLDEMOTE, (i386_cpu_flags): Add cpucldemote. * i386-opc.tbl: Add cldemote. * i386-tbl.h: Regenerate.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog18
-rw-r--r--gas/config/tc-i386.c2
-rw-r--r--gas/doc/c-i386.texi3
-rw-r--r--gas/testsuite/gas/i386/cldemote-intel.d16
-rw-r--r--gas/testsuite/gas/i386/cldemote.d16
-rw-r--r--gas/testsuite/gas/i386/cldemote.s12
-rw-r--r--gas/testsuite/gas/i386/i386.exp4
-rw-r--r--gas/testsuite/gas/i386/ilp32/x86-64-nops.d2
-rw-r--r--gas/testsuite/gas/i386/nops.d2
-rw-r--r--gas/testsuite/gas/i386/nops.s4
-rw-r--r--gas/testsuite/gas/i386/x86-64-cldemote-intel.d16
-rw-r--r--gas/testsuite/gas/i386/x86-64-cldemote.d16
-rw-r--r--gas/testsuite/gas/i386/x86-64-cldemote.s12
-rw-r--r--gas/testsuite/gas/i386/x86-64-nops.d2
-rw-r--r--gas/testsuite/gas/i386/x86-64-nops.s4
15 files changed, 118 insertions, 11 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2f478be..ca54c4d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,21 @@
+2018-04-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
+
+ * config/tc-i386.c (cpu_arch): Add .cldemote.
+ * doc/c-i386.texi: Document cldemote/.cldemote.
+ * testsuite/gas/i386/cldemote-intel.d: New.
+ * testsuite/gas/i386/cldemote.d: Likewise.
+ * testsuite/gas/i386/cldemote.s: Likewise.
+ * testsuite/gas/i386/i386.exp: Run new tests.
+ * testsuite/gas/i386/x86-64-cldemote-intel.d: New.
+ * testsuite/gas/i386/x86-64-cldemote.d: Likewise.
+ * testsuite/gas/i386/x86-64-cldemote.s: Likewise.
+ * testsuite/gas/i386/ilp32/x86-64-nops.d: Remove 0x0f1c
+ NOP encoding that maps to cldemote.
+ * testsuite/gas/i386/nops.d: Likewise.
+ * testsuite/gas/i386/nops.s: Likewise.
+ * testsuite/gas/i386/x86-64-nops.d: Likewise.
+ * testsuite/gas/i386/x86-64-nops.s: Likewise.
+
2018-04-16 Nick Clifton <nickc@redhat.com>
PR 23054
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 9d5293d..9bfec10 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -1027,6 +1027,8 @@ static const arch_entry cpu_arch[] =
CPU_PCONFIG_FLAGS, 0 },
{ STRING_COMMA_LEN (".waitpkg"), PROCESSOR_UNKNOWN,
CPU_WAITPKG_FLAGS, 0 },
+ { STRING_COMMA_LEN (".cldemote"), PROCESSOR_UNKNOWN,
+ CPU_CLDEMOTE_FLAGS, 0 },
};
static const noarch_entry cpu_noarch[] =
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index a6e9d04..3d459e2 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -232,6 +232,7 @@ accept various extension mnemonics. For example,
@code{wbnoinvd},
@code{pconfig},
@code{waitpkg},
+@code{cldemote},
@code{lwp},
@code{fma4},
@code{xop},
@@ -1273,7 +1274,7 @@ supported on the CPU specified. The choices for @var{cpu_type} are:
@item @samp{.avx512_vpopcntdq} @tab @samp{.avx512_vbmi2} @tab @samp{.avx512_vnni}
@item @samp{.avx512_bitalg}
@item @samp{.clwb} @tab @samp{.rdpid} @tab @samp{.ptwrite} @tab @item @samp{.ibt}
-@item @samp{.wbnoinvd} @tab @samp{.pconfig} @tab @samp{.waitpkg}
+@item @samp{.wbnoinvd} @tab @samp{.pconfig} @tab @samp{.waitpkg} @tab @samp{.cldemote}
@item @samp{.shstk} @tab @samp{.gfni} @tab @samp{.vaes} @tab @samp{.vpclmulqdq}
@item @samp{.3dnow} @tab @samp{.3dnowa} @tab @samp{.sse4a} @tab @samp{.sse5}
@item @samp{.syscall} @tab @samp{.rdtscp} @tab @samp{.svme} @tab @samp{.abm}
diff --git a/gas/testsuite/gas/i386/cldemote-intel.d b/gas/testsuite/gas/i386/cldemote-intel.d
new file mode 100644
index 0000000..0f3f97d
--- /dev/null
+++ b/gas/testsuite/gas/i386/cldemote-intel.d
@@ -0,0 +1,16 @@
+#as:
+#objdump: -dw -Mintel
+#name: i386 CLDEMOTE insns (Intel disassembly)
+#source: cldemote.s
+
+.*: +file format .*
+
+
+Disassembly of section \.text:
+
+00000000 <_start>:
+[ ]*[a-f0-9]+:[ ]*0f 1c 01[ ]*cldemote BYTE PTR \[ecx\]
+[ ]*[a-f0-9]+:[ ]*0f 1c 84 f4 c0 1d fe ff[ ]*cldemote BYTE PTR \[esp\+esi\*8-0x1e240\]
+[ ]*[a-f0-9]+:[ ]*0f 1c 01[ ]*cldemote BYTE PTR \[ecx\]
+[ ]*[a-f0-9]+:[ ]*0f 1c 84 f4 c0 1d fe ff[ ]*cldemote BYTE PTR \[esp\+esi\*8-0x1e240\]
+#pass
diff --git a/gas/testsuite/gas/i386/cldemote.d b/gas/testsuite/gas/i386/cldemote.d
new file mode 100644
index 0000000..00df116
--- /dev/null
+++ b/gas/testsuite/gas/i386/cldemote.d
@@ -0,0 +1,16 @@
+#as:
+#objdump: -dw
+#name: i386 CLDEMOTE insns
+#source: cldemote.s
+
+.*: +file format .*
+
+
+Disassembly of section \.text:
+
+00000000 <_start>:
+[ ]*[a-f0-9]+:[ ]*0f 1c 01[ ]*cldemote \(%ecx\)
+[ ]*[a-f0-9]+:[ ]*0f 1c 84 f4 c0 1d fe ff[ ]*cldemote -0x1e240\(%esp,%esi,8\)
+[ ]*[a-f0-9]+:[ ]*0f 1c 01[ ]*cldemote \(%ecx\)
+[ ]*[a-f0-9]+:[ ]*0f 1c 84 f4 c0 1d fe ff[ ]*cldemote -0x1e240\(%esp,%esi,8\)
+#pass
diff --git a/gas/testsuite/gas/i386/cldemote.s b/gas/testsuite/gas/i386/cldemote.s
new file mode 100644
index 0000000..2856559
--- /dev/null
+++ b/gas/testsuite/gas/i386/cldemote.s
@@ -0,0 +1,12 @@
+# Check 32bit CLDEMOTE instructions
+
+ .allow_index_reg
+ .text
+_start:
+
+ cldemote (%ecx)
+ cldemote -123456(%esp,%esi,8)
+
+ .intel_syntax noprefix
+ cldemote BYTE PTR [ecx]
+ cldemote BYTE PTR [esp+esi*8-123456]
diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 93e3082..91d91d6 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -424,6 +424,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_32_check]]
run_dump_test "pconfig-intel"
run_dump_test "waitpkg"
run_dump_test "waitpkg-intel"
+ run_dump_test "cldemote"
+ run_dump_test "cldemote-intel"
run_list_test "avx512vl-1" "-al"
run_list_test "avx512vl-2" "-al"
run_list_test "avx512vl-plain" "-al"
@@ -914,6 +916,8 @@ if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] t
run_dump_test "x86-64-pconfig-intel"
run_dump_test "x86-64-waitpkg"
run_dump_test "x86-64-waitpkg-intel"
+ run_dump_test "x86-64-cldemote"
+ run_dump_test "x86-64-cldemote-intel"
run_dump_test "x86-64-fence-as-lock-add-yes"
run_dump_test "x86-64-fence-as-lock-add-no"
run_dump_test "x86-64-pr20141"
diff --git a/gas/testsuite/gas/i386/ilp32/x86-64-nops.d b/gas/testsuite/gas/i386/ilp32/x86-64-nops.d
index 282ec5e..5461611 100644
--- a/gas/testsuite/gas/i386/ilp32/x86-64-nops.d
+++ b/gas/testsuite/gas/i386/ilp32/x86-64-nops.d
@@ -33,12 +33,10 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 1e 9c 1d 11 22 33 44 nopl 0x44332211\(%rbp,%rbx,1\)
[ ]*[a-f0-9]+: 0f 1f 9c 1d 11 22 33 44 nopl 0x44332211\(%rbp,%rbx,1\)
[ ]*[a-f0-9]+: 0f 19 04 60 nopl \(%rax,%riz,2\)
-[ ]*[a-f0-9]+: 0f 1c 04 60 nopl \(%rax,%riz,2\)
[ ]*[a-f0-9]+: 0f 1d 04 60 nopl \(%rax,%riz,2\)
[ ]*[a-f0-9]+: 0f 1e 04 60 nopl \(%rax,%riz,2\)
[ ]*[a-f0-9]+: 0f 1f 04 60 nopl \(%rax,%riz,2\)
[ ]*[a-f0-9]+: 0f 19 04 59 nopl \(%rcx,%rbx,2\)
-[ ]*[a-f0-9]+: 0f 1c 04 59 nopl \(%rcx,%rbx,2\)
[ ]*[a-f0-9]+: 0f 1d 04 59 nopl \(%rcx,%rbx,2\)
[ ]*[a-f0-9]+: 0f 1e 04 59 nopl \(%rcx,%rbx,2\)
[ ]*[a-f0-9]+: 0f 1f 04 59 nopl \(%rcx,%rbx,2\)
diff --git a/gas/testsuite/gas/i386/nops.d b/gas/testsuite/gas/i386/nops.d
index 2884927..e6212e4 100644
--- a/gas/testsuite/gas/i386/nops.d
+++ b/gas/testsuite/gas/i386/nops.d
@@ -32,12 +32,10 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 1e 9c 1d 11 22 33 44 nopl 0x44332211\(%ebp,%ebx,1\)
[ ]*[a-f0-9]+: 0f 1f 9c 1d 11 22 33 44 nopl 0x44332211\(%ebp,%ebx,1\)
[ ]*[a-f0-9]+: 0f 19 04 60 nopl \(%eax,%eiz,2\)
-[ ]*[a-f0-9]+: 0f 1c 04 60 nopl \(%eax,%eiz,2\)
[ ]*[a-f0-9]+: 0f 1d 04 60 nopl \(%eax,%eiz,2\)
[ ]*[a-f0-9]+: 0f 1e 04 60 nopl \(%eax,%eiz,2\)
[ ]*[a-f0-9]+: 0f 1f 04 60 nopl \(%eax,%eiz,2\)
[ ]*[a-f0-9]+: 0f 19 04 59 nopl \(%ecx,%ebx,2\)
-[ ]*[a-f0-9]+: 0f 1c 04 59 nopl \(%ecx,%ebx,2\)
[ ]*[a-f0-9]+: 0f 1d 04 59 nopl \(%ecx,%ebx,2\)
[ ]*[a-f0-9]+: 0f 1e 04 59 nopl \(%ecx,%ebx,2\)
[ ]*[a-f0-9]+: 0f 1f 04 59 nopl \(%ecx,%ebx,2\)
diff --git a/gas/testsuite/gas/i386/nops.s b/gas/testsuite/gas/i386/nops.s
index abeff5e..c75e8ce 100644
--- a/gas/testsuite/gas/i386/nops.s
+++ b/gas/testsuite/gas/i386/nops.s
@@ -33,13 +33,13 @@
.byte 0x0f, 0x1f, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
.byte 0x0f, 0x19, 0x04, 0x60
- .byte 0x0f, 0x1c, 0x04, 0x60
+# .byte 0x0f, 0x1c, 0x04, 0x60 Now it became cldemote (%eax,%eiz,2)
.byte 0x0f, 0x1d, 0x04, 0x60
.byte 0x0f, 0x1e, 0x04, 0x60
.byte 0x0f, 0x1f, 0x04, 0x60
.byte 0x0f, 0x19, 0x04, 0x59
- .byte 0x0f, 0x1c, 0x04, 0x59
+# .byte 0x0f, 0x1c, 0x04, 0x59 Now it became cldemote (%eax,%ebx,2)
.byte 0x0f, 0x1d, 0x04, 0x59
.byte 0x0f, 0x1e, 0x04, 0x59
.byte 0x0f, 0x1f, 0x04, 0x59
diff --git a/gas/testsuite/gas/i386/x86-64-cldemote-intel.d b/gas/testsuite/gas/i386/x86-64-cldemote-intel.d
new file mode 100644
index 0000000..9610e14
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-cldemote-intel.d
@@ -0,0 +1,16 @@
+#as:
+#objdump: -dw -Mintel
+#name: x86_64 CLDEMOTE insns (Intel disassembly)
+#source: x86-64-cldemote.s
+
+.*: +file format .*
+
+
+Disassembly of section \.text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*0f 1c 01[ ]*cldemote BYTE PTR \[rcx\]
+[ ]*[a-f0-9]+:[ ]*42 0f 1c 84 f0 23 01 00 00[ ]*cldemote BYTE PTR \[rax\+r14\*8\+0x123\]
+[ ]*[a-f0-9]+:[ ]*0f 1c 01[ ]*cldemote BYTE PTR \[rcx\]
+[ ]*[a-f0-9]+:[ ]*42 0f 1c 84 f0 34 12 00 00[ ]*cldemote BYTE PTR \[rax\+r14\*8\+0x1234\]
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-cldemote.d b/gas/testsuite/gas/i386/x86-64-cldemote.d
new file mode 100644
index 0000000..48fd0eb
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-cldemote.d
@@ -0,0 +1,16 @@
+#as:
+#objdump: -dw
+#name: x86_64 CLDEMOTE insns
+#source: x86-64-cldemote.s
+
+.*: +file format .*
+
+
+Disassembly of section \.text:
+
+0+ <_start>:
+[ ]*[a-f0-9]+:[ ]*0f 1c 01[ ]*cldemote \(%rcx\)
+[ ]*[a-f0-9]+:[ ]*42 0f 1c 84 f0 23 01 00 00[ ]*cldemote 0x123\(%rax,%r14,8\)
+[ ]*[a-f0-9]+:[ ]*0f 1c 01[ ]*cldemote \(%rcx\)
+[ ]*[a-f0-9]+:[ ]*42 0f 1c 84 f0 34 12 00 00[ ]*cldemote 0x1234\(%rax,%r14,8\)
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-cldemote.s b/gas/testsuite/gas/i386/x86-64-cldemote.s
new file mode 100644
index 0000000..ecf203f
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-cldemote.s
@@ -0,0 +1,12 @@
+# Check 64bit CLDEMOTE instructions
+
+ .allow_index_reg
+ .text
+_start:
+
+ cldemote (%rcx)
+ cldemote 0x123(%rax,%r14,8)
+
+ .intel_syntax noprefix
+ cldemote BYTE PTR [rcx]
+ cldemote BYTE PTR [rax+r14*8+0x1234]
diff --git a/gas/testsuite/gas/i386/x86-64-nops.d b/gas/testsuite/gas/i386/x86-64-nops.d
index da87676..57091aa 100644
--- a/gas/testsuite/gas/i386/x86-64-nops.d
+++ b/gas/testsuite/gas/i386/x86-64-nops.d
@@ -32,12 +32,10 @@ Disassembly of section .text:
[ ]*[a-f0-9]+: 0f 1e 9c 1d 11 22 33 44 nopl 0x44332211\(%rbp,%rbx,1\)
[ ]*[a-f0-9]+: 0f 1f 9c 1d 11 22 33 44 nopl 0x44332211\(%rbp,%rbx,1\)
[ ]*[a-f0-9]+: 0f 19 04 60 nopl \(%rax,%riz,2\)
-[ ]*[a-f0-9]+: 0f 1c 04 60 nopl \(%rax,%riz,2\)
[ ]*[a-f0-9]+: 0f 1d 04 60 nopl \(%rax,%riz,2\)
[ ]*[a-f0-9]+: 0f 1e 04 60 nopl \(%rax,%riz,2\)
[ ]*[a-f0-9]+: 0f 1f 04 60 nopl \(%rax,%riz,2\)
[ ]*[a-f0-9]+: 0f 19 04 59 nopl \(%rcx,%rbx,2\)
-[ ]*[a-f0-9]+: 0f 1c 04 59 nopl \(%rcx,%rbx,2\)
[ ]*[a-f0-9]+: 0f 1d 04 59 nopl \(%rcx,%rbx,2\)
[ ]*[a-f0-9]+: 0f 1e 04 59 nopl \(%rcx,%rbx,2\)
[ ]*[a-f0-9]+: 0f 1f 04 59 nopl \(%rcx,%rbx,2\)
diff --git a/gas/testsuite/gas/i386/x86-64-nops.s b/gas/testsuite/gas/i386/x86-64-nops.s
index 1e04891..57851ee 100644
--- a/gas/testsuite/gas/i386/x86-64-nops.s
+++ b/gas/testsuite/gas/i386/x86-64-nops.s
@@ -33,13 +33,13 @@
.byte 0x0f, 0x1f, 0x9C, 0x1D, 0x11, 0x22, 0x33, 0x44
.byte 0x0f, 0x19, 0x04, 0x60
- .byte 0x0f, 0x1c, 0x04, 0x60
+# .byte 0x0f, 0x1c, 0x04, 0x60 Now it became cldemote (%rcx,%riz,2)
.byte 0x0f, 0x1d, 0x04, 0x60
.byte 0x0f, 0x1e, 0x04, 0x60
.byte 0x0f, 0x1f, 0x04, 0x60
.byte 0x0f, 0x19, 0x04, 0x59
- .byte 0x0f, 0x1c, 0x04, 0x59
+# .byte 0x0f, 0x1c, 0x04, 0x59 Now it became cldemote (%rcx,%rbx,2)
.byte 0x0f, 0x1d, 0x04, 0x59
.byte 0x0f, 0x1e, 0x04, 0x59
.byte 0x0f, 0x1f, 0x04, 0x59