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
2 changes: 1 addition & 1 deletion clang/test/Driver/print-supported-extensions-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +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: xcheriot 1.0 'XCheriot' (Implements XCheriot 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
3 changes: 1 addition & 2 deletions llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1827,8 +1827,7 @@ bool RISCVAsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
"%cheri_compartment_cgprel_hi modifier or "
"an integer in the range");
case Match_InvalidUImm20AUIPC:
// FIXME: This should be keyed off an Xcheriot feature, not a CPU name.
if (getSTI().getCPU() == "cheriot")
if (getSTI().hasFeature(RISCV::FeatureVendorXCheriot))
return generateImmOutOfRangeError(
Operands, ErrorInfo, 0, (1 << 20) - 1,
"operand must be a symbol with a "
Expand Down
6 changes: 3 additions & 3 deletions llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ 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::FeatureVendorXCheriot]) {
if (!FeatureBits[RISCV::FeatureVendorXCheri])
report_fatal_error("XCheriotV1 extension requires XCheri extension");
report_fatal_error("XCheriot extension requires XCheri extension");
if (!FeatureBits[RISCV::FeatureCapMode])
report_fatal_error("XCheriotV1 extension requires CapMode");
report_fatal_error("XCheriot extension requires CapMode");
}
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/MCTargetDesc/RISCVCompressedCap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace RISCVCompressedCap {

static inline CompressedCapability::CapabilityFormat
GetCapabilitySize(const MCSubtargetInfo &STI) {
if (STI.getCPU() == "cheriot")
if (STI.hasFeature(RISCV::FeatureVendorXCheriot))
return CompressedCapability::Cheriot64;

bool IsRV64 = STI.hasFeature(RISCV::Feature64Bit);
Expand Down
5 changes: 3 additions & 2 deletions llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ unsigned RISCVELFObjectWriter::getRelocType(MCContext &Ctx,
return ELF::R_RISCV_CHERI_CJAL;
case RISCV::fixup_riscv_ccall: {
const auto *STI = Ctx.getSubtargetInfo();
if (STI->getCPU() == "cheriot" || STI->getTargetTriple().getSubArch() ==
Triple::RISCV32SubArch_cheriot_v1)
if (STI->hasFeature(RISCV::FeatureVendorXCheriot) ||
STI->getTargetTriple().getSubArch() ==
Triple::RISCV32SubArch_cheriot_v1)
return ELF::R_RISCV_CHERIOT_CCALL;
return ELF::R_RISCV_CHERI_CCALL;
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/RISCV/RISCVFeatures.td
Original file line number Diff line number Diff line change
Expand Up @@ -1397,8 +1397,8 @@ def IsPureCapABI
def NotPureCapABI
: Predicate<"!RISCVABI::isCheriPureCapABI(Subtarget->getTargetABI())">;

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

def FeatureRelax
: SubtargetFeature<"relax", "EnableLinkerRelax", "true",
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/RISCV/RISCVProcessors.td
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,6 @@ def RP2350_HAZARD3 : RISCVProcessorModel<"rp2350-hazard3",
// NB: FeatureCheri =>'s RVC (!FeatureCheriNoRVC)
def CHERIOT : RISCVProcessorModel<"cheriot", NoSchedModel,
[Feature32Bit, FeatureVendorXCheri,
FeatureVendorXCheriot1, FeatureCapMode,
FeatureVendorXCheriot, FeatureCapMode,
FeatureStdExtC, FeatureStdExtE,
FeatureStdExtM, FeatureUnalignedScalarMem]>;
2 changes: 1 addition & 1 deletion llvm/unittests/TargetParser/RISCVISAInfoTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ R"(All available -march extensions for RISC-V
svpbmt 1.0
svvptc 1.0
xcheri 0.0
xcheriot1 1.0
xcheriot 1.0
xcvalu 1.0
xcvbi 1.0
xcvbitmanip 1.0
Expand Down