xref: /freebsd/contrib/llvm-project/llvm/lib/Target/X86/X86InstrSNP.td (revision 5b56413d04e608379c9a306373554a8e4d321bc0)
1//===-- X86InstrSNP.td - SNP Instruction Set Extension -----*- tablegen -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8//
9// This file describes the instructions that make up the AMD Secure Nested
10// Paging (SNP) instruction set.
11//
12//===----------------------------------------------------------------------===//
13
14//===----------------------------------------------------------------------===//
15// SNP instructions
16
17let SchedRW = [WriteSystem] in {
18// F3 0F 01 FF
19let Uses = [RAX], Defs = [EAX, EFLAGS] in
20def PSMASH: I<0x01, MRM_FF, (outs), (ins), "psmash", []>, TB, XS,
21            Requires<[In64BitMode]>;
22
23// F2 0F 01 FF
24let Uses = [RAX, RCX, RDX], Defs = [EAX, EFLAGS] in
25def PVALIDATE64: I<0x01, MRM_FF, (outs), (ins), "pvalidate",[]>,
26                 TB, XD, Requires<[In64BitMode]>;
27
28let Uses = [EAX, ECX, EDX], Defs = [EAX, EFLAGS] in
29def PVALIDATE32: I<0x01, MRM_FF, (outs), (ins), "pvalidate",[]>,
30                 TB, XD, Requires<[Not64BitMode]>;
31
32// F2 0F 01 FE
33let Uses = [RAX, RCX], Defs = [EAX, EFLAGS] in
34def RMPUPDATE: I<0x01, MRM_FE, (outs), (ins), "rmpupdate", []>, TB, XD,
35               Requires<[In64BitMode]>;
36
37// F3 0F 01 FE
38let Uses = [RAX, RCX, RDX], Defs = [EAX, EFLAGS] in
39def RMPADJUST: I<0x01, MRM_FE, (outs), (ins), "rmpadjust", []>, TB, XS,
40               Requires<[In64BitMode]>;
41
42// F3 0F 01 FD
43let Uses = [RAX, RDX], Defs = [RAX, RCX, RDX, EFLAGS] in
44def RMPQUERY: I<0x01, MRM_FD, (outs), (ins), "rmpquery", []>, TB, XS,
45               Requires<[In64BitMode]>;
46} // SchedRW
47
48def : InstAlias<"psmash\t{%rax|rax}", (PSMASH)>, Requires<[In64BitMode]>;
49def : InstAlias<"pvalidate\t{%rax, %rcx, %rdx|rdx, rcx, rax|}", (PVALIDATE64)>, Requires<[In64BitMode]>;
50def : InstAlias<"pvalidate\t{%eax, %ecx, %edx|edx, ecx, eax|}", (PVALIDATE32)>, Requires<[Not64BitMode]>;
51def : InstAlias<"rmpupdate\t{%rax, %rcx|rcx, rax|}", (RMPUPDATE)>, Requires<[In64BitMode]>;
52def : InstAlias<"rmpadjust\t{%rax, %rcx, %rdx|rdx, rcx, rax|}", (RMPADJUST)>, Requires<[In64BitMode]>;
53def : InstAlias<"rmpquery\t{%rax, %rdx|rdx, rax|}", (RMPQUERY)>, Requires<[In64BitMode]>;
54