Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/test/Driver/print-supported-extensions-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
// CHECK-NEXT: svpbmt 1.0 'Svpbmt' (Page-Based Memory Types)
// CHECK-NEXT: svvptc 1.0 'Svvptc' (Obviating Memory-Management Instructions after Marking PTEs Valid)
// CHECK-NEXT: xcheri 0.0 'XCheri' (Implements CHERI extension)
// CHECK-NEXT: xcheriot1 1.0 'XCheriot1' (Implements Cheriot1 extension)
// CHECK-NEXT: xcvalu 1.0 'XCValu' (CORE-V ALU Operations)
// CHECK-NEXT: xcvbi 1.0 'XCVbi' (CORE-V Immediate Branching)
// CHECK-NEXT: xcvbitmanip 1.0 'XCVbitmanip' (CORE-V Bit Manipulation)
Expand Down
6 changes: 6 additions & 0 deletions llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ void validate(const Triple &TT, const FeatureBitset &FeatureBits) {
if (FeatureBits[RISCV::Feature32Bit] &&
FeatureBits[RISCV::Feature64Bit])
report_fatal_error("RV32 and RV64 can't be combined");
if (FeatureBits[RISCV::FeatureVendorXCheriot1]) {
if (!FeatureBits[RISCV::FeatureVendorXCheri])
report_fatal_error("XCheriotV1 extension requires XCheri extension");
if (!FeatureBits[RISCV::FeatureCapMode])
report_fatal_error("XCheriotV1 extension requires CapMode");
}
}

llvm::Expected<std::unique_ptr<RISCVISAInfo>>
Expand Down
3 changes: 3 additions & 0 deletions llvm/lib/Target/RISCV/RISCVFeatures.td
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,9 @@ def IsPureCapABI
def NotPureCapABI
: Predicate<"!RISCVABI::isCheriPureCapABI(Subtarget->getTargetABI())">;

def FeatureVendorXCheriot1
: RISCVExtension<1, 0, "Implements Cheriot1 extension">;

def FeatureRelax
: SubtargetFeature<"relax", "EnableLinkerRelax", "true",
"Enable Linker relaxation.">;
Expand Down
14 changes: 5 additions & 9 deletions llvm/lib/Target/RISCV/RISCVProcessors.td
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,8 @@ def RP2350_HAZARD3 : RISCVProcessorModel<"rp2350-hazard3",
FeatureStdExtZcmp]>;

// NB: FeatureCheri =>'s RVC (!FeatureCheriNoRVC)
def CHERIOT : RISCVProcessorModel<"cheriot",
NoSchedModel,
[Feature32Bit,
FeatureVendorXCheri,
FeatureCapMode,
FeatureStdExtC,
FeatureStdExtE,
FeatureStdExtM,
FeatureUnalignedScalarMem]>;
def CHERIOT : RISCVProcessorModel<"cheriot", NoSchedModel,
[Feature32Bit, FeatureVendorXCheri,
FeatureVendorXCheriot1, FeatureCapMode,
FeatureStdExtC, FeatureStdExtE,
FeatureStdExtM, FeatureUnalignedScalarMem]>;
1 change: 1 addition & 0 deletions llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,7 @@ R"(All available -march extensions for RISC-V
svpbmt 1.0
svvptc 1.0
xcheri 0.0
xcheriot1 1.0
xcvalu 1.0
xcvbi 1.0
xcvbitmanip 1.0
Expand Down