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 @@ -16,32 +16,38 @@ let SchedRW = [WriteSystem] in { // F3 0F 01 FF -let Uses = [RAX] in +let Uses = [RAX], Defs = [EAX, EFLAGS] in def PSMASH: I<0x01, MRM_FF, (outs), (ins), "psmash", []>, XS, Requires<[In64BitMode]>; // F2 0F 01 FF -let Uses = [RAX] in +let Uses = [RAX, RCX, RDX], Defs = [EAX, EFLAGS] in def PVALIDATE64: I<0x01, MRM_FF, (outs), (ins), "pvalidate",[]>, XD, Requires<[In64BitMode]>; -let Uses = [EAX] in +let Uses = [EAX, ECX, EDX], Defs = [EAX, EFLAGS] in def PVALIDATE32: I<0x01, MRM_FF, (outs), (ins), "pvalidate",[]>, XD, Requires<[Not64BitMode]>; // F2 0F 01 FE -let Uses = [RAX] in +let Uses = [RAX, RCX], Defs = [EAX, EFLAGS] in def RMPUPDATE: I<0x01, MRM_FE, (outs), (ins), "rmpupdate", []>, XD, Requires<[In64BitMode]>; // F3 0F 01 FE -let Uses = [RAX] in +let Uses = [RAX, RCX, RDX], Defs = [EAX, EFLAGS] in def RMPADJUST: I<0x01, MRM_FE, (outs), (ins), "rmpadjust", []>, XS, Requires<[In64BitMode]>; + +// F3 0F 01 FD +let Uses = [RAX, RDX], Defs = [RAX, RCX, RDX, EFLAGS] in +def RMPQUERY: I<0x01, MRM_FD, (outs), (ins), "rmpquery", []>, XS, + Requires<[In64BitMode]>; } // SchedRW def : InstAlias<"psmash\t{%rax|rax}", (PSMASH)>, Requires<[In64BitMode]>; -def : InstAlias<"pvalidate\t{%rax|rax}", (PVALIDATE64)>, Requires<[In64BitMode]>; -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<"pvalidate\t{%rax, %rcx, %rdx|rdx, rcx, rax|}", (PVALIDATE64)>, Requires<[In64BitMode]>; +def : InstAlias<"pvalidate\t{%eax, %ecx, %edx|edx, ecx, eax|}", (PVALIDATE32)>, Requires<[Not64BitMode]>; +def : InstAlias<"rmpupdate\t{%rax, %rcx|rcx, rax|}", (RMPUPDATE)>, Requires<[In64BitMode]>; +def : InstAlias<"rmpadjust\t{%rax, %rcx, %rdx|rdx, rcx, rax|}", (RMPADJUST)>, Requires<[In64BitMode]>; +def : InstAlias<"rmpquery\t{%rax, %rdx|rdx, 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-32.s b/llvm/test/MC/X86/SNP-32.s --- a/llvm/test/MC/X86/SNP-32.s +++ b/llvm/test/MC/X86/SNP-32.s @@ -6,4 +6,4 @@ // CHECK: pvalidate // CHECK: encoding: [0xf2,0x0f,0x01,0xff] -pvalidate %eax +pvalidate %eax, %ecx, %edx 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 @@ -2,32 +2,40 @@ // CHECK: rmpupdate // CHECK: encoding: [0xf2,0x0f,0x01,0xfe] -rmpupdate +rmpupdate %rax, %rcx // CHECK: psmash // CHECK: encoding: [0xf3,0x0f,0x01,0xff] -psmash +psmash %rax // CHECK: pvalidate // CHECK: encoding: [0xf2,0x0f,0x01,0xff] -pvalidate +pvalidate %rax, %rcx, %rdx // CHECK: rmpadjust // CHECK: encoding: [0xf3,0x0f,0x01,0xfe] -rmpadjust +rmpadjust %rax, %rcx, %rdx + +// CHECK: rmpquery +// CHECK: encoding: [0xf3,0x0f,0x01,0xfd] +rmpquery %rax, %rdx // CHECK: rmpupdate // CHECK: encoding: [0xf2,0x0f,0x01,0xfe] -rmpupdate %rax +rmpupdate // CHECK: psmash // CHECK: encoding: [0xf3,0x0f,0x01,0xff] -psmash %rax +psmash // CHECK: pvalidate // CHECK: encoding: [0xf2,0x0f,0x01,0xff] -pvalidate %rax +pvalidate // CHECK: rmpadjust // CHECK: encoding: [0xf3,0x0f,0x01,0xfe] -rmpadjust %rax +rmpadjust + +// CHECK: rmpquery +// CHECK: encoding: [0xf3,0x0f,0x01,0xfd] +rmpquery