diff --git a/llvm/lib/Target/X86/X86InstrSNP.td b/llvm/lib/Target/X86/X86InstrSNP.td --- a/llvm/lib/Target/X86/X86InstrSNP.td +++ b/llvm/lib/Target/X86/X86InstrSNP.td @@ -38,6 +38,11 @@ let Uses = [RAX] in def RMPADJUST: I<0x01, MRM_FE, (outs), (ins), "rmpadjust", []>, XS, Requires<[In64BitMode]>; + +// F3 0F 01 FD +let Uses = [RAX, RDX], Defs = [RCX, RDX] in +def RMPQUERY: I<0x01, MRM_FD, (outs), (ins), "rmpquery", []>, XS, + Requires<[In64BitMode]>; } // SchedRW def : InstAlias<"psmash\t{%rax|rax}", (PSMASH)>, Requires<[In64BitMode]>; @@ -45,3 +50,4 @@ def : InstAlias<"pvalidate\t{%eax|eax}", (PVALIDATE32)>, Requires<[Not64BitMode]>; def : InstAlias<"rmpupdate\t{%rax|rax}", (RMPUPDATE)>, Requires<[In64BitMode]>; def : InstAlias<"rmpadjust\t{%rax|rax}", (RMPADJUST)>, Requires<[In64BitMode]>; +def : InstAlias<"rmpquery\t{%rax, %rcx, %rdx|rdx, rcx, rax}", (RMPQUERY)>, Requires<[In64BitMode]>; diff --git a/llvm/test/MC/Disassembler/X86/x86-64.txt b/llvm/test/MC/Disassembler/X86/x86-64.txt --- a/llvm/test/MC/Disassembler/X86/x86-64.txt +++ b/llvm/test/MC/Disassembler/X86/x86-64.txt @@ -744,6 +744,9 @@ # CHECK: rmpadjust 0xf3 0x0f 0x01 0xfe +# CHECK: rmpquery +0xf3 0x0f 0x01 0xfd + # CHECK: testui 0xf3,0x0f,0x01,0xed diff --git a/llvm/test/MC/X86/SNP-64.s b/llvm/test/MC/X86/SNP-64.s --- a/llvm/test/MC/X86/SNP-64.s +++ b/llvm/test/MC/X86/SNP-64.s @@ -16,6 +16,10 @@ // CHECK: encoding: [0xf3,0x0f,0x01,0xfe] rmpadjust +// CHECK: rmpquery +// CHECK: encoding: [0xf3,0x0f,0x01,0xfd] +rmpquery + // CHECK: rmpupdate // CHECK: encoding: [0xf2,0x0f,0x01,0xfe] rmpupdate %rax @@ -31,3 +35,7 @@ // CHECK: rmpadjust // CHECK: encoding: [0xf3,0x0f,0x01,0xfe] rmpadjust %rax + +// CHECK: rmpquery +// CHECK: encoding: [0xf3,0x0f,0x01,0xfd] +rmpquery %rax, %rcx, %rdx