Skip to content

Commit c1f2955

Browse files
authored
[CHERIoT] Define a RISCV target feature for XCheriot. (llvm#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.
1 parent e633189 commit c1f2955

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

clang/test/Driver/print-supported-extensions-riscv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
// CHECK-NEXT: xandesvpackfph 5.0 'XAndesVPackFPH' (Andes Vector Packed FP16 Extension)
171171
// CHECK-NEXT: xandesvsinth 5.0 'XAndesVSIntH' (Andes Vector Small INT Handling Extension)
172172
// CHECK-NEXT: xandesvsintload 5.0 'XAndesVSIntLoad' (Andes Vector INT4 Load Extension)
173+
// CHECK-NEXT: xcheriot 1.0 'XCheriot' (CHERIoT extension)
173174
// CHECK-NEXT: xcvalu 1.0 'XCValu' (CORE-V ALU Operations)
174175
// CHECK-NEXT: xcvbi 1.0 'XCVbi' (CORE-V Immediate Branching)
175176
// CHECK-NEXT: xcvbitmanip 1.0 'XCVbitmanip' (CORE-V Bit Manipulation)

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,13 @@ def HasXAIFET : Predicate<"Subtarget->hasXAIFET()">,
17501750
AssemblerPredicate<(all_of FeatureVendorXAIFET),
17511751
"'XAIFET' (AI Foundry ET Extension)">;
17521752

1753+
def FeatureVendorXCheriot
1754+
: RISCVExtension<1, 0, "CHERIoT extension",
1755+
[FeatureStdExtZca, FeatureStdExtE, FeatureStdExtM]>;
1756+
def HasCheriot
1757+
: Predicate<"Subtarget->hasVendorXCheriot()">,
1758+
AssemblerPredicate<(all_of FeatureVendorXCheriot), "'XCheriot' (CHERIoT Extension)">;
1759+
17531760
//===----------------------------------------------------------------------===//
17541761
// LLVM specific features and extensions
17551762
//===----------------------------------------------------------------------===//

llvm/test/CodeGen/RISCV/features-info.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195
; CHECK-NEXT: xandesvpackfph - 'XAndesVPackFPH' (Andes Vector Packed FP16 Extension).
196196
; CHECK-NEXT: xandesvsinth - 'XAndesVSIntH' (Andes Vector Small INT Handling Extension).
197197
; CHECK-NEXT: xandesvsintload - 'XAndesVSIntLoad' (Andes Vector INT4 Load Extension).
198+
; CHECK-NEXT: xcheriot - 'XCheriot' (CHERIoT extension).
198199
; CHECK-NEXT: xcvalu - 'XCValu' (CORE-V ALU Operations).
199200
; CHECK-NEXT: xcvbi - 'XCVbi' (CORE-V Immediate Branching).
200201
; CHECK-NEXT: xcvbitmanip - 'XCVbitmanip' (CORE-V Bit Manipulation).

llvm/unittests/TargetParser/RISCVISAInfoTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,7 @@ R"(All available -march extensions for RISC-V
13011301
xandesvpackfph 5.0
13021302
xandesvsinth 5.0
13031303
xandesvsintload 5.0
1304+
xcheriot 1.0
13041305
xcvalu 1.0
13051306
xcvbi 1.0
13061307
xcvbitmanip 1.0

0 commit comments

Comments
 (0)