1 //===-- X86InstrSNP.td - SNP Instruction Set Extension -----*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file describes the instructions that make up the AMD Secure Nested
10 // Paging (SNP) instruction set.
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
17 let SchedRW = [WriteSystem] in {
19 let Uses = [RAX], Defs = [EAX, EFLAGS] in
20 def PSMASH: I<0x01, MRM_FF, (outs), (ins), "psmash", []>, TB, XS,
21 Requires<[In64BitMode]>;
24 let Uses = [RAX, RCX, RDX], Defs = [EAX, EFLAGS] in
25 def PVALIDATE64: I<0x01, MRM_FF, (outs), (ins), "pvalidate",[]>,
26 TB, XD, Requires<[In64BitMode]>;
28 let Uses = [EAX, ECX, EDX], Defs = [EAX, EFLAGS] in
29 def PVALIDATE32: I<0x01, MRM_FF, (outs), (ins), "pvalidate",[]>,
30 TB, XD, Requires<[Not64BitMode]>;
33 let Uses = [RAX, RCX], Defs = [EAX, EFLAGS] in
34 def RMPUPDATE: I<0x01, MRM_FE, (outs), (ins), "rmpupdate", []>, TB, XD,
35 Requires<[In64BitMode]>;
38 let Uses = [RAX, RCX, RDX], Defs = [EAX, EFLAGS] in
39 def RMPADJUST: I<0x01, MRM_FE, (outs), (ins), "rmpadjust", []>, TB, XS,
40 Requires<[In64BitMode]>;
43 let Uses = [RAX, RDX], Defs = [RAX, RCX, RDX, EFLAGS] in
44 def RMPQUERY: I<0x01, MRM_FD, (outs), (ins), "rmpquery", []>, TB, XS,
45 Requires<[In64BitMode]>;
48 def : InstAlias<"psmash\t{%rax|rax}", (PSMASH)>, Requires<[In64BitMode]>;
49 def : InstAlias<"pvalidate\t{%rax, %rcx, %rdx|rdx, rcx, rax|}", (PVALIDATE64)>, Requires<[In64BitMode]>;
50 def : InstAlias<"pvalidate\t{%eax, %ecx, %edx|edx, ecx, eax|}", (PVALIDATE32)>, Requires<[Not64BitMode]>;
51 def : InstAlias<"rmpupdate\t{%rax, %rcx|rcx, rax|}", (RMPUPDATE)>, Requires<[In64BitMode]>;
52 def : InstAlias<"rmpadjust\t{%rax, %rcx, %rdx|rdx, rcx, rax|}", (RMPADJUST)>, Requires<[In64BitMode]>;
53 def : InstAlias<"rmpquery\t{%rax, %rdx|rdx, rax|}", (RMPQUERY)>, Requires<[In64BitMode]>;