Skip to content

Commit e3df4ba

Browse files
committed
[X86] Add MSRLIST instructions.
For more details about these instructions, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html Reviewed By: skan, RKSimon Differential Revision: https://reviews.llvm.org/D135934
1 parent b18293e commit e3df4ba

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

llvm/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ Changes to the Windows Target
136136
Changes to the X86 Backend
137137
--------------------------
138138

139+
* Add support for the ``RDMSRLIST and WRMSRLIST`` instructions.
140+
139141
Changes to the OCaml bindings
140142
-----------------------------
141143

llvm/lib/Target/X86/X86InstrSystem.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,11 @@ def WRMSR : I<0x30, RawFrm, (outs), (ins), "wrmsr", []>, TB;
428428
let Defs = [EAX, EDX], Uses = [ECX] in
429429
def RDMSR : I<0x32, RawFrm, (outs), (ins), "rdmsr", []>, TB;
430430

431+
let Uses = [RSI, RDI, RCX], Predicates = [In64BitMode] in {
432+
def WRMSRLIST : I<0x01, MRM_C6, (outs), (ins), "wrmsrlist", []>, XS;
433+
def RDMSRLIST : I<0x01, MRM_C6, (outs), (ins), "rdmsrlist", []>, XD;
434+
}
435+
431436
let Defs = [RAX, RDX], Uses = [ECX] in
432437
def RDPMC : I<0x33, RawFrm, (outs), (ins), "rdpmc", []>, TB;
433438

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# RUN: llvm-mc --disassemble %s -triple=x86_64 | FileCheck %s --check-prefixes=ATT
2+
# RUN: llvm-mc --disassemble %s -triple=x86_64 -x86-asm-syntax=intel --output-asm-variant=1 | FileCheck %s --check-prefixes=INTEL
3+
4+
# ATT: rdmsrlist
5+
# INTEL: rdmsrlist
6+
0xf2,0x0f,0x01,0xc6
7+
8+
# ATT: wrmsrlist
9+
# INTEL: wrmsrlist
10+
0xf3,0x0f,0x01,0xc6

llvm/test/MC/X86/x86-64-msrlist.s

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: llvm-mc -triple x86_64 --show-encoding %s | FileCheck %s
2+
// RUN: llvm-mc -triple x86_64 -x86-asm-syntax=intel -output-asm-variant=1 --show-encoding %s | FileCheck %s
3+
4+
// CHECK: rdmsrlist
5+
// CHECK: encoding: [0xf2,0x0f,0x01,0xc6]
6+
rdmsrlist
7+
8+
// CHECK: wrmsrlist
9+
// CHECK: encoding: [0xf3,0x0f,0x01,0xc6]
10+
wrmsrlist

0 commit comments

Comments
 (0)