From: "Pawar, Amit" <Amit.Pawar@amd.com>
To: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: [PATH] AMD MWAITX enablement
Date: Tue, 02 Jun 2015 06:56:00 -0000 [thread overview]
Message-ID: <0428E25D138CAA4D819A6FED9429E51AF4A29C@SCYBEXDAG02.amd.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 239 bytes --]
Hi All,
PFA, the patch enables support for MWAITX CPU and has been tested on x86-64 and found no regressions.
This is my first patch and please let me know how do I apply to trunk or can somebody apply from my side?
Regards,
Amit
[-- Attachment #2: mwaitx.patch --]
[-- Type: application/octet-stream, Size: 16989 bytes --]
diff --git a/gas/ChangeLog b/gas/ChangeLog
index dd2f446..c5d2bc8 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2015-05-28 Amit Pawar <Amit.Pawar@amd.com>
+
+ * config/tc-i386.c: Updated to handle monitorx/mwaitx instruction.
+ * doc/c-i386.texi: Add mwaitx cpu.
+
2015-06-01 Matthew Wahab <matthew.wahab@arm.com>
* config/tc-aarch64.c (parse_sys_reg): New parameter. Check target
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 34b5c28..581370a 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -954,6 +954,8 @@ static const arch_entry cpu_arch[] =
CPU_AVX512VBMI_FLAGS, 0, 0 },
{ STRING_COMMA_LEN (".clzero"), PROCESSOR_UNKNOWN,
CPU_CLZERO_FLAGS, 0, 0 },
+ { STRING_COMMA_LEN (".mwaitx"), PROCESSOR_UNKNOWN,
+ CPU_MWAITX_FLAGS, 0, 0 },
};
#ifdef I386COFF
@@ -3329,7 +3331,8 @@ process_immext (void)
{
expressionS *exp;
- if ((i.tm.cpu_flags.bitfield.cpusse3 || i.tm.cpu_flags.bitfield.cpusvme)
+ if ((i.tm.cpu_flags.bitfield.cpusse3 || i.tm.cpu_flags.bitfield.cpusvme ||
+ i.tm.cpu_flags.bitfield.cpumwaitx)
&& i.operands > 0)
{
/* MONITOR/MWAIT as well as SVME instructions have fixed operands
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index 6118987..4af05e3 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -189,6 +189,7 @@ accept various extension mnemonics. For example,
@code{rtm},
@code{invpcid},
@code{clflush},
+@code{mwaitx},
@code{clzero},
@code{lwp},
@code{fma4},
@@ -1112,7 +1113,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}
+@item @samp{.padlock} @tab @samp{.clzero} @tab @samp{.mwaitx}
@end multitable
Apart from the warning, there are only two other effects on
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 233e138..71bbd01 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,17 @@
+2015-05-29 Amit Pawar <Amit.Pawar@amd.com>
+
+ * gas/i386/i386.exp: Add new mwaitx test cases.
+ * gas/i386/x86-64-mwaitx-znver1.d: New.
+ * gas/i386/x86-64-mwaitx-reg.l: New.
+ * gas/i386/mwaitx-znver1.d: New.
+ * gas/i386/x86-64-mwaitx-reg.s: New.
+ * gas/i386/mwaitx-bdver4.d: New.
+ * gas/i386/x86-64-mwaitx-bdver4.d: New.
+ * gas/i386/mwaitx.s: New.
+ * gas/i386/mwaitx-reg.s: New.
+ * gas/i386/x86-64-mwaitx.s: New.
+ * gas/i386/mwaitx-reg.l: New.
+
2015-06-01 Matthew Wahab <matthew.wahab@arm.com>
* pan-directive.d: New.
diff --git a/gas/testsuite/gas/i386/mwaitx-bdver4.d b/gas/testsuite/gas/i386/mwaitx-bdver4.d
new file mode 100644
index 0000000..5c4c891
--- /dev/null
+++ b/gas/testsuite/gas/i386/mwaitx-bdver4.d
@@ -0,0 +1,17 @@
+#source: mwaitx.s
+#as: -march=bdver4
+#objdump: -dw
+#name: i386 monitorx and mwaitx insn
+
+.*: +file format .*
+
+
+Disassembly of section \.text:
+
+00000000 <_start>:
+[ ]*[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
+[ ]*[a-f0-9]+: 0f 01 fb mwaitx %eax,%ecx
+#pass
diff --git a/gas/testsuite/gas/i386/mwaitx-reg.l b/gas/testsuite/gas/i386/mwaitx-reg.l
new file mode 100644
index 0000000..b5c212a
--- /dev/null
+++ b/gas/testsuite/gas/i386/mwaitx-reg.l
@@ -0,0 +1,52 @@
+#as: -march=mwaitx
+.*: Assembler messages:
+#eax
+.*:[0-9]*: Error: .*eax.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*eax.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*eax.* 2 .*mwaitx.*
+
+#ebx
+.*:[0-9]*: Error: .*ebx.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*ebx.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*ebx.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*ebx.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*ebx.* 2 .*mwaitx.*
+
+#ecx
+.*:[0-9]*: Error: .*ecx.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*ecx.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*ecx.* 1 .*mwaitx.*
+
+#edx
+.*:[0-9]*: Error: .*edx.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*edx.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*edx.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*edx.* 2 .*mwaitx.*
+
+#esp
+.*:[0-9]*: Error: .*esp.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*esp.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*esp.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*esp.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*esp.* 2 .*mwaitx.*
+
+#ebp
+.*:[0-9]*: Error: .*ebp.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*ebp.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*ebp.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*ebp.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*ebp.* 2 .*mwaitx.*
+
+#esi
+.*:[0-9]*: Error: .*esi.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*esi.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*esi.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*esi.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*esi.* 2 .*mwaitx.*
+
+#edi
+.*:[0-9]*: Error: .*edi.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*edi.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*edi.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*edi.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*edi.* 2 .*mwaitx.*
diff --git a/gas/testsuite/gas/i386/mwaitx-reg.s b/gas/testsuite/gas/i386/mwaitx-reg.s
new file mode 100644
index 0000000..91f34d2
--- /dev/null
+++ b/gas/testsuite/gas/i386/mwaitx-reg.s
@@ -0,0 +1,7 @@
+.irp reg ax,bx,cx,dx,sp,bp,si,di
+ monitorx %e\reg, %ecx, %edx
+ monitorx %eax, %e\reg, %edx
+ monitorx %eax, %ecx, %e\reg
+ mwaitx %e\reg, %ecx
+ mwaitx %eax, %e\reg
+.endr
diff --git a/gas/testsuite/gas/i386/mwaitx.s b/gas/testsuite/gas/i386/mwaitx.s
new file mode 100644
index 0000000..dddc684
--- /dev/null
+++ b/gas/testsuite/gas/i386/mwaitx.s
@@ -0,0 +1,9 @@
+# Check monitorx and mwaitx instructions
+
+ .text
+_start:
+ monitorx %eax, %ecx, %edx
+ monitorx %ax, %ecx, %edx
+ monitorx
+ mwaitx %eax, %ecx
+ mwaitx
diff --git a/gas/testsuite/gas/i386/x86-64-mwaitx-bdver4.d b/gas/testsuite/gas/i386/x86-64-mwaitx-bdver4.d
new file mode 100644
index 0000000..d75ec3b
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-mwaitx-bdver4.d
@@ -0,0 +1,17 @@
+#source: x86-64-mwaitx.s
+#as: -march=bdver4
+#objdump: -dw
+#name: x86_64 monitorx and mwaitx insn
+
+.*: +file format .*
+
+
+Disassembly of section \.text:
+
+0000000000000000 <_start>:
+[ ]*[a-f0-9]+: 0f 01 fa monitorx %rax,%rcx,%rdx
+[ ]*[a-f0-9]+: 67 0f 01 fa monitorx %eax,%rcx,%rdx
+[ ]*[a-f0-9]+: 0f 01 fa monitorx %rax,%rcx,%rdx
+[ ]*[a-f0-9]+: 0f 01 fb mwaitx %rax,%rcx
+[ ]*[a-f0-9]+: 0f 01 fb mwaitx %rax,%rcx
+#pass
diff --git a/gas/testsuite/gas/i386/x86-64-mwaitx-reg.l b/gas/testsuite/gas/i386/x86-64-mwaitx-reg.l
new file mode 100644
index 0000000..6be79c1
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-mwaitx-reg.l
@@ -0,0 +1,108 @@
+#as: -march=mwaitx
+.*: Assembler messages:
+#rax
+.*:[0-9]*: Error: .*rax.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*rax.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*rax.* 2 .*mwaitx.*
+
+#rbx
+.*:[0-9]*: Error: .*rbx.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*rbx.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*rbx.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*rbx.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*rbx.* 2 .*mwaitx.*
+
+#rcx
+.*:[0-9]*: Error: .*rcx.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*rcx.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*rcx.* 1 .*mwaitx.*
+
+#rdx
+.*:[0-9]*: Error: .*rdx.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*rdx.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*rdx.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*rdx.* 2 .*mwaitx.*
+
+#rsp
+.*:[0-9]*: Error: .*rsp.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*rsp.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*rsp.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*rsp.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*rsp.* 2 .*mwaitx.*
+
+#rbp
+.*:[0-9]*: Error: .*rbp.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*rbp.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*rbp.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*rbp.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*rbp.* 2 .*mwaitx.*
+
+#rsi
+.*:[0-9]*: Error: .*rsi.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*rsi.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*rsi.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*rsi.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*rsi.* 2 .*mwaitx.*
+
+#rdi
+.*:[0-9]*: Error: .*rdi.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*rdi.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*rdi.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*rdi.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*rdi.* 2 .*mwaitx.*
+
+#r8
+.*:[0-9]*: Error: .*r8.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*r8.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*r8.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*r8.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*r8.* 2 .*mwaitx.*
+
+#r9
+.*:[0-9]*: Error: .*r9.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*r9.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*r9.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*r9.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*r9.* 2 .*mwaitx.*
+
+#r10
+.*:[0-9]*: Error: .*r10.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*r10.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*r10.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*r10.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*r10.* 2 .*mwaitx.*
+
+#r11
+.*:[0-9]*: Error: .*r11.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*r11.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*r11.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*r11.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*r11.* 2 .*mwaitx.*
+
+#r12
+.*:[0-9]*: Error: .*r12.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*r12.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*r12.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*r12.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*r12.* 2 .*mwaitx.*
+
+#r13
+.*:[0-9]*: Error: .*r13.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*r13.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*r13.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*r13.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*r13.* 2 .*mwaitx.*
+
+#r14
+.*:[0-9]*: Error: .*r14.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*r14.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*r14.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*r14.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*r14.* 2 .*mwaitx.*
+
+#r15
+.*:[0-9]*: Error: .*r15.* 1 .*monitorx.*
+.*:[0-9]*: Error: .*r15.* 2 .*monitorx.*
+.*:[0-9]*: Error: .*r15.* 3 .*monitorx.*
+.*:[0-9]*: Error: .*r15.* 1 .*mwaitx.*
+.*:[0-9]*: Error: .*r15.* 2 .*mwaitx.*
diff --git a/gas/testsuite/gas/i386/x86-64-mwaitx-reg.s b/gas/testsuite/gas/i386/x86-64-mwaitx-reg.s
new file mode 100644
index 0000000..3108adc
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-mwaitx-reg.s
@@ -0,0 +1,7 @@
+.irp reg ax,bx,cx,dx,sp,bp,si,di,8,9,10,11,12,13,14,15
+ monitorx %r\reg, %rcx, %rdx
+ monitorx %rax, %r\reg, %rdx
+ monitorx %rax, %rcx, %r\reg
+ mwaitx %r\reg, %rcx
+ mwaitx %rax, %r\reg
+.endr
diff --git a/gas/testsuite/gas/i386/x86-64-mwaitx.s b/gas/testsuite/gas/i386/x86-64-mwaitx.s
new file mode 100644
index 0000000..889218c
--- /dev/null
+++ b/gas/testsuite/gas/i386/x86-64-mwaitx.s
@@ -0,0 +1,9 @@
+# Check monitorx and mwaitx instructions
+
+ .text
+_start:
+ monitorx %rax, %rcx, %rdx
+ monitorx %eax, %rcx, %rdx
+ monitorx
+ mwaitx %rax, %rcx
+ mwaitx
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index f4688c8..26e2daa 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,12 @@
+2015-05-29 Amit Pawar <Amit.Pawar@amd.com>
+
+ * i386-dis.c (rm_table): Add monitorx/mwaitx.
+ * i386-gen.c (cpu_flag_init): Add new CPU_MWAITX_FLAGS.
+ * i386-opc.h: Add CpuMWAITX.
+ * i386-opc.tbl: Add monitorx and mwaitx.
+ * i386-init.h: Re-generated.
+ * i386-tbl.h: Re-generated.
+
2015-06-01 Matthew Wahab <matthew.wahab@arm.com>
* aarch64-opc.c (F_ARCHEXT): New.
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 767bab3..7212993 100644
--- a/opcodes/i386-dis.c
+++ b/opcodes/i386-dis.c
@@ -12072,8 +12072,8 @@ static const struct dis386 rm_table[][8] = {
/* RM_0F01_REG_7 */
{ "swapgs", { Skip_MODRM }, 0 },
{ "rdtscp", { Skip_MODRM }, 0 },
- { Bad_Opcode },
- { Bad_Opcode },
+ { "monitorx", { { OP_Monitor, 0 } }, 0 },
+ { "mwaitx", { { OP_Mwait, 0 } }, 0 },
{ "clzero", { Skip_MODRM }, 0 },
},
{
diff --git a/opcodes/i386-gen.c b/opcodes/i386-gen.c
index 0523936..5aca18a 100644
--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -94,9 +94,9 @@ static initializer cpu_flag_init[] =
{ "CPU_BDVER3_FLAGS",
"Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|CpuRdtscp|Cpu387|Cpu687|CpuFISTTP|CpuNop|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a|CpuABM|CpuLM|CpuFMA|CpuFMA4|CpuXOP|CpuLWP|CpuBMI|CpuTBM|CpuF16C|CpuCX16|CpuClflush|CpuSSSE3|CpuSVME|CpuSSE4_1|CpuSSE4_2|CpuAES|CpuAVX|CpuPCLMUL|CpuLZCNT|CpuPRFCHW|CpuXsave|CpuXsaveopt|CpuFSGSBase" },
{ "CPU_BDVER4_FLAGS",
- "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|CpuRdtscp|Cpu387|Cpu687|CpuFISTTP|CpuNop|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a|CpuABM|CpuLM|CpuFMA|CpuFMA4|CpuXOP|CpuLWP|CpuBMI|CpuTBM|CpuF16C|CpuCX16|CpuClflush|CpuSSSE3|CpuSVME|CpuSSE4_1|CpuSSE4_2|CpuAES|CpuAVX|CpuPCLMUL|CpuLZCNT|CpuPRFCHW|CpuXsave|CpuXsaveopt|CpuFSGSBase|CpuAVX2|CpuMovbe|CpuBMI2|CpuRdRnd" },
+ "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|CpuRdtscp|Cpu387|Cpu687|CpuFISTTP|CpuNop|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a|CpuABM|CpuLM|CpuFMA|CpuFMA4|CpuXOP|CpuLWP|CpuBMI|CpuTBM|CpuF16C|CpuCX16|CpuClflush|CpuSSSE3|CpuSVME|CpuSSE4_1|CpuSSE4_2|CpuAES|CpuAVX|CpuPCLMUL|CpuLZCNT|CpuPRFCHW|CpuXsave|CpuXsaveopt|CpuFSGSBase|CpuAVX2|CpuMovbe|CpuBMI2|CpuRdRnd|CpuMWAITX" },
{ "CPU_ZNVER1_FLAGS",
- "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|CpuRdtscp|Cpu387|Cpu687|CpuFISTTP|CpuNop|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a|CpuABM|CpuLM|CpuFMA|CpuFMA4|CpuBMI|CpuF16C|CpuCX16|CpuClflush|CpuSSSE3|CpuSVME|CpuSSE4_1|CpuSSE4_2|CpuAES|CpuAVX|CpuPCLMUL|CpuLZCNT|CpuPRFCHW|CpuXsave|CpuXsaveopt|CpuFSGSBase|CpuAVX2|CpuMovbe|CpuBMI2|CpuRdRnd|CpuADX|CpuRdSeed|CpuSMAP|CpuSHA|CpuXSAVEC|CpuXSAVES|CpuClflushOpt|CpuCLZERO" },
+ "Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|CpuRdtscp|Cpu387|Cpu687|CpuFISTTP|CpuNop|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a|CpuABM|CpuLM|CpuFMA|CpuFMA4|CpuBMI|CpuF16C|CpuCX16|CpuClflush|CpuSSSE3|CpuSVME|CpuSSE4_1|CpuSSE4_2|CpuAES|CpuAVX|CpuPCLMUL|CpuLZCNT|CpuPRFCHW|CpuXsave|CpuXsaveopt|CpuFSGSBase|CpuAVX2|CpuMovbe|CpuBMI2|CpuRdRnd|CpuADX|CpuRdSeed|CpuSMAP|CpuSHA|CpuXSAVEC|CpuXSAVES|CpuClflushOpt|CpuCLZERO|CpuMWAITX" },
{ "CPU_BTVER1_FLAGS",
"Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuSYSCALL|CpuRdtscp|Cpu387|Cpu687|CpuNop|CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4a|CpuABM|CpuLM|CpuPRFCHW|CpuCX16|CpuClflush|CpuFISTTP|CpuSVME|CpuLZCNT" },
{ "CPU_BTVER2_FLAGS",
@@ -253,6 +253,8 @@ static initializer cpu_flag_init[] =
"CpuMMX|CpuSSE|CpuSSE2|CpuSSE3|CpuSSSE3|CpuSSE4_1|CpuSSE4_2|CpuAVX|CpuAVX2|CpuAVX512F|CpuAVX512VBMI" },
{ "CPU_CLZERO_FLAGS",
"CpuCLZERO" },
+ { "CPU_MWAITX_FLAGS",
+ "CpuMWAITX" },
};
static initializer operand_type_init[] =
@@ -457,6 +459,7 @@ static bitfield cpu_flags[] =
BITFIELD (CpuMPX),
BITFIELD (CpuAVX512IFMA),
BITFIELD (CpuAVX512VBMI),
+ BITFIELD (CpuMWAITX),
BITFIELD (CpuCLZERO),
BITFIELD (CpuAMD64),
BITFIELD (CpuIntel64),
diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h
index 62ac42a..d598ce5 100644
--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -194,6 +194,8 @@ enum
CpuAVX512IFMA,
/* Intel AVX-512 VBMI Instructions support required. */
CpuAVX512VBMI,
+ /* mwaitx instruction required */
+ CpuMWAITX,
/* Clzero instruction required */
CpuCLZERO,
/* 64bit support required */
@@ -304,6 +306,7 @@ typedef union i386_cpu_flags
unsigned int cpupcommit:1;
unsigned int cpuavx512ifma:1;
unsigned int cpuavx512vbmi:1;
+ unsigned int cpumwaitx:1;
unsigned int cpuclzero:1;
unsigned int cpu64:1;
unsigned int cpuno64:1;
diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl
index a3bd7de..00a1bb0 100644
--- a/opcodes/i386-opc.tbl
+++ b/opcodes/i386-opc.tbl
@@ -5938,3 +5938,16 @@ clzero, 0, 0xf01fc, None, 3, CpuCLZERO, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|
// CLZERO instructions end
+// MONITORX/MWAITX instructions
+monitorx, 0, 0xf01, 0xfa, 2, CpuMWAITX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ImmExt, { 0 }
+// Need to ensure only "monitorx %eax/%ax,%ecx,%edx" is accepted.
+monitorx, 3, 0xf01, 0xfa, 2, CpuMWAITX|CpuNo64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ImmExt|AddrPrefixOp0, { Reg16|Reg32, Reg32, Reg32 }
+// Need to ensure only "monitorx %rax/%eax,%rcx,%rdx" is accepted.
+monitorx, 3, 0xf01, 0xfa, 2, CpuMWAITX|Cpu64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ImmExt|AddrPrefixOp0|NoRex64, { Reg32|Reg64, Reg64, Reg64 }
+
+mwaitx, 0, 0xf01, 0xfb, 2, CpuMWAITX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ImmExt, { 0 }
+// Need to ensure only "mwaitx %eax,%ecx" is accepted.
+mwaitx, 2, 0xf01, 0xfb, 2, CpuMWAITX|CpuNo64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ImmExt|NoAVX, { Reg32, Reg32 }
+// Need to ensure only "mwaitx %rax,%rcx" is accepted.
+mwaitx, 2, 0xf01, 0xfb, 2, CpuMWAITX|Cpu64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ImmExt|NoRex64|NoAVX, { Reg64, Reg64 }
+// MONITORX/MWAITX instructions end
next reply other threads:[~2015-06-02 6:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 6:56 Pawar, Amit [this message]
2015-06-02 8:22 ` Jan Beulich
2015-06-02 13:35 ` Pawar, Amit
2015-06-08 6:16 ` Pawar, Amit
2015-06-08 7:05 ` Jan Beulich
2015-06-10 9:37 ` Pawar, Amit
2015-06-25 7:55 ` Pawar, Amit
2015-06-25 9:26 ` H.J. Lu
2015-06-26 5:46 ` Pawar, Amit
2015-06-26 10:04 ` H.J. Lu
2015-06-26 11:09 ` Pawar, Amit
2015-06-26 11:55 ` H.J. Lu
2015-06-26 15:00 ` Pawar, Amit
2015-06-26 15:04 ` H.J. Lu
2015-06-26 16:26 ` Pawar, Amit
2015-06-26 16:30 ` H.J. Lu
2015-06-26 16:33 ` Pawar, Amit
2015-06-26 16:39 ` Pawar, Amit
2015-06-26 16:43 ` H.J. Lu
2015-06-26 16:52 ` Pawar, Amit
2015-06-26 18:02 ` Andreas Schwab
2015-06-27 5:20 ` Pawar, Amit
2015-06-30 6:58 ` Pawar, Amit
2015-06-30 14:53 ` H.J. Lu
2015-06-30 15:39 ` Pawar, Amit
2015-06-26 17:06 ` Pawar, Amit
2015-06-26 17:08 ` H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0428E25D138CAA4D819A6FED9429E51AF4A29C@SCYBEXDAG02.amd.com \
--to=amit.pawar@amd.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).