[llvm] [X86] Support promoted ENQCMD, KEYLOCKER and USER-MSR instructions (PR #77293)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 00:55:53 PST 2024


================
@@ -1541,32 +1541,40 @@ def MOVDIR64B64_EVEX : I<0xF8, MRMSrcMem, (outs), (ins GR64:$dst, i512mem_GR64:$
 //===----------------------------------------------------------------------===//
 // ENQCMD/S - Enqueue 64-byte command as user with 64-byte write atomicity
 //
+multiclass Enqcmds<string suffix> {
+  def ENQCMD32#suffix : I<0xF8, MRMSrcMem, (outs), (ins GR32:$dst, i512mem_GR32:$src),
+                          "enqcmd\t{$src, $dst|$dst, $src}",
+                          [(set EFLAGS, (X86enqcmd GR32:$dst, addr:$src))]>,
+                        NoCD8, XD, AdSize32, Requires<[HasENQCMD, NoEGPR]>;
+  def ENQCMD64#suffix : I<0xF8, MRMSrcMem, (outs), (ins GR64:$dst, i512mem_GR64:$src),
+                          "enqcmd\t{$src, $dst|$dst, $src}",
+                          [(set EFLAGS, (X86enqcmd GR64:$dst, addr:$src))]>,
+                        NoCD8, XD, AdSize64, Requires<[HasENQCMD, NoEGPR, In64BitMode]>;
----------------
KanRobert wrote:

In64BitMode can be removed for ENQCMD64/ENQCMS64 b/c the explicit GR64 operand. Then we ca n move `Requires<[HasENQCMD, NoEGPR]>` to line 1574

https://github.com/llvm/llvm-project/pull/77293


More information about the llvm-commits mailing list