[clang] [llvm] [RISC-V][MC] Introduce RVY extension feature (PR #176870)

Alexander Richardson via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 22 00:14:14 PST 2026


================
@@ -1119,6 +1119,28 @@ def HasStdExtZbkbOrP
                          "'Zbkb' (Bitmanip instructions for Cryptography) or "
                          "'Base P' (Packed-SIMD)">;
 
+// "Y" extension (CHERI support)
+
+def FeatureStdExtY : RISCVExperimentalExtension<0, 96, "'Base Y' (CHERI)">;
+def HasStdExtY
+    : Predicate<"Subtarget->hasStdExtY()">,
+      AssemblerPredicate<(all_of FeatureStdExtY), "'Base Y' (CHERI)">;
+
+// When enabled all memory operations (e.g. loads/stores) uses capability
+// registers as the base operand instead of the address sub-register.
+// Currently, capability mode needs to be chosen at assembly time, but follow-up
+// commits will add support for "hybrid" mode that adds instructions to
+// dynamically switch between capability mode and address mode (the latter being
+// fully backwards compatible with non-Y code).
+def FeatureCapMode : SubtargetFeature<"cap-mode", "IsCapMode", "true",
----------------
arichardson wrote:

For now this specific one is internal to LLVM. In the future we will likely upstream changes to add `.option (no)capmode` to toggle this in the assembler dynamically.  But this is a niche use case and the only way this should be controlled as a user by setting the -mabi= flag to a pure-capability ABI (e.g. il32pc64).

Also the extension is still marked as experimental so I think that means renames of flags should not be a problem right? 

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


More information about the cfe-commits mailing list