================
@@ -5896,4 +5896,39 @@ def CIR_BlockAddressOp : CIR_Op<"block_address", [Pure]> 
{
   }];
 }
 
+//===----------------------------------------------------------------------===//
+// CpuIdOp
+//===----------------------------------------------------------------------===//
+
+def CIR_CpuIdOp : CIR_Op<"cpuid"> {
+  let summary = "Get information about the CPU";
+  let description = [{
+    The `cir.cpuid` operation retrieves different types of CPU information and
+    stores it in an array of 4 integers.
+
+    This operation takes 3 arguments: `basePtr`, a pointer to an array of 4
+    integers; `funcID`, an integer determining what type of information to be
+    retrieved (for instance, basic information, processor information and
+    features, or cache/TLB information); and `subFuncId`, an integer that adds
+    more detail about what information is requested.
+
+    As a result, the array of 4 integers is filled with the requested 
information.
+
+    Note that, since arrays usually decay to pointers, `basePtr` is expected 
to be
+    just a pointer to integer. Extra verifications are done at the verifier.
+
+    Example:
+
+    ```mlir
+    cir.cpuid %basePtr, %funcId, %subFuncId : (!cir.ptr<!s32i>, !s32i, !s32i)
+    ```
+  }];
+
+  let arguments =
+      (ins Arg<CIR_PointerType, "array address", [MemWrite]>:$basePtr,
----------------
rturrado wrote:

I'll give it a go!

https://github.com/llvm/llvm-project/pull/173197
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to