Add RMPQUERY to the list of SNP instructions.
Tech Documentation: https://www.amd.com/system/files/TechDocs/24594.pdf
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Is it worth adding a SNP feature predicate to X86.td? Are they ever going to be exposed as intrinsics or just asm?
SNP is there from znver3. We earlier planned to add some intrinsics. Then decided that these instructions will be system instructions so will be just asm. May be if we decide to add those intrinsics in future, we will have the predicate then. At present, I will not be adding the intrinsics. For znver3, we initially had the predicate as placeholder and then removed it as the intrinsics weren't there.
llvm/lib/Target/X86/X86InstrSNP.td | ||
---|---|---|
43 | Defs doesn't reflect this additional sentence from the spec Upon completion, a return code is stored in EAX. rFLAGS bits OF, ZF, AF, PF and SF are set based on return code. |
llvm/lib/Target/X86/X86InstrSNP.td | ||
---|---|---|
43 | All the SNP instructions seem to be missing this in fact - and many update RAX/EAX with a return code as well. |
llvm/lib/Target/X86/X86InstrSNP.td | ||
---|---|---|
38 | Looking at the description in APM3 - it uses RDX as well (for permissions) Modifies RMP permissions for a guest page. The guest virtual address is specified in the RAX register. The page size is specified in RCX[0]. The target VMPL and its permissions are specified in the RDX register as follows: | |
43 | Uses RCX as well? Reads an RMP permission mask for a guest page. The guest virtual address is specified in the RAX register. The target VMPL is specified in RDX[7:0]. RMP permissions for the specified VMPL are returned in RDX[63:8] and the RCX register as shown below |
Modified RMPADJUST instruction definition.
RMPQUERY doesn't use RCX as source. It is used only while returning the permissions.
Looking at the description in APM3 - it uses RDX as well (for permissions)