[clang] [llvm] [RISC-V] Add CSR read/write builtins (PR #85091)

Craig Topper via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 13 12:17:42 PDT 2024


================
@@ -20,6 +20,12 @@ class RISCVBuiltin<string prototype, string features = ""> : TargetBuiltin {
 
 let Attributes = [NoThrow, Const] in {
 //===----------------------------------------------------------------------===//
+// Zicsr extension.
+//===----------------------------------------------------------------------===//
+def csrr : RISCVBuiltin<"unsigned long int(unsigned long int)", "zicsr">;
----------------
topperc wrote:

I don't think these are `Const` since they operate on state that is not part of their arguments/return.

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


More information about the cfe-commits mailing list