[llvm] [CHERIoT] Define a RISCV target feature for XCheriot. (PR #189968)

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 07:20:13 PDT 2026


https://github.com/resistor created https://github.com/llvm/llvm-project/pull/189968

The specification for this extension is publically available here: https://github.com/CHERIoT-Platform/cheriot-sail/releases/download/v1.0/cheriot-architecture-v1.0.pdf

This change only adds the target feature, without adding any functionality gated by it yet. This change is intended to enable DataLayout-related changes in TargetParser, which depend on RISCVISAInfo being able at least to recognize the name of this extension.


>From 0a88483062aab7028d804a6770b43eb78916ca26 Mon Sep 17 00:00:00 2001
From: Owen Anderson <resistor at mac.com>
Date: Wed, 1 Apr 2026 16:15:08 +0200
Subject: [PATCH] [CHERIoT] Define a RISCV target feature for XCheriot.

The specification for this extension is publically available here: https://github.com/CHERIoT-Platform/cheriot-sail/releases/download/v1.0/cheriot-architecture-v1.0.pdf

This change only adds the target feature, without adding any functionality gated by it yet. This change is intended to enable DataLayout-related changes in TargetParser, which depend on RISCVISAInfo being able at least to recognize the name of this extension.
---
 llvm/lib/Target/RISCV/RISCVFeatures.td | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/llvm/lib/Target/RISCV/RISCVFeatures.td b/llvm/lib/Target/RISCV/RISCVFeatures.td
index 59525fb0a469e..a166524ad15ff 100644
--- a/llvm/lib/Target/RISCV/RISCVFeatures.td
+++ b/llvm/lib/Target/RISCV/RISCVFeatures.td
@@ -1750,6 +1750,13 @@ def HasXAIFET : Predicate<"Subtarget->hasXAIFET()">,
                           AssemblerPredicate<(all_of FeatureVendorXAIFET),
                           "'XAIFET' (AI Foundry ET Extension)">;
 
+def FeatureVendorXCheriot
+    : RISCVExtension<1, 0, "CHERIoT extension",
+    [FeatureStdExtC, FeatureStdExtE, FeatureStdExtM]>;
+def HasCheriot
+    : Predicate<"Subtarget->hasVendorXCheriot()">,
+      AssemblerPredicate<(all_of FeatureVendorXCheriot), "'XCheriot' (CHERIoT Extension)">;
+
 //===----------------------------------------------------------------------===//
 // LLVM specific features and extensions
 //===----------------------------------------------------------------------===//



More information about the llvm-commits mailing list