Expand Up
@@ -36,11 +36,6 @@ struct RISCVSupportedExtension {
}
};
struct RISCVProfile {
const char *Name;
const char *MArch;
};
} // end anonymous namespace
static constexpr StringLiteral AllStdExts = " mafdqlcbkjtpvnh" ;
Expand Down
Expand Up
@@ -246,42 +241,6 @@ static const RISCVSupportedExtension SupportedExperimentalExtensions[] = {
};
// clang-format on
static const RISCVProfile SupportedProfiles[] = {
{" rvi20u32" , " rv32i" },
{" rvi20u64" , " rv64i" },
{" rva20u64" , " rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_za128rs" },
{" rva20s64" , " rv64imafdc_ziccamoa_ziccif_zicclsm_ziccrse_zicntr_zifencei_"
" za128rs_ssccptr_sstvala_sstvecd_svade_svbare" },
{" rva22u64" ,
" rv64imafdc_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_"
" zicntr_zihintpause_zihpm_za64rs_zfhmin_zba_zbb_zbs_zkt" },
{" rva22s64" ,
" rv64imafdc_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_"
" zicntr_zifencei_zihintpause_zihpm_za64rs_zfhmin_zba_zbb_zbs_zkt_ssccptr_"
" sscounterenw_sstvala_sstvecd_svade_svbare_svinval_svpbmt" },
{" rva23u64" ,
" rv64imafdcv_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_"
" zicntr_zicond_zihintntl_zihintpause_zihpm_zimop0p1_za64rs_zawrs_zfa_"
" zfhmin_zcb_zcmop0p2_zba_zbb_zbs_zkt_zvbb_zvfhmin_zvkt" },
{" rva23s64" ,
" rv64imafdcvh_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_"
" zicntr_zicond_zifencei_zihintntl_zihintpause_zihpm_zimop0p1_za64rs_zawrs_"
" zfa_zfhmin_zcb_zcmop0p2_zba_zbb_zbs_zkt_zvbb_zvfhmin_zvkt_shcounterenw_"
" shgatpa_shtvala_shvsatpa_shvstvala_shvstvecd_ssccptr_sscofpmf_"
" sscounterenw_ssnpm0p8_ssstateen_sstc_sstvala_sstvecd_ssu64xl_svade_"
" svbare_svinval_svnapot_svpbmt" },
{" rvb23u64" , " rv64imafdc_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_"
" zicclsm_ziccrse_zicntr_zicond_zihintntl_zihintpause_zihpm_"
" zimop0p1_za64rs_zawrs_zfa_zcb_zcmop0p2_zba_zbb_zbs_zkt" },
{" rvb23s64" ,
" rv64imafdc_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_"
" zicntr_zicond_zifencei_zihintntl_zihintpause_zihpm_zimop0p1_za64rs_zawrs_"
" zfa_zcb_zcmop0p2_zba_zbb_zbs_zkt_ssccptr_sscofpmf_sscounterenw_sstc_"
" sstvala_sstvecd_ssu64xl_svade_svbare_svinval_svnapot_svpbmt" },
{" rvm23u32" , " rv32im_zicbop_zicond_zicsr_zihintntl_zihintpause_zimop0p1_"
" zca_zcb_zce_zcmop0p2_zcmp_zcmt_zba_zbb_zbs" },
};
static void verifyTables () {
#ifndef NDEBUG
static std::atomic<bool > TableChecked (false );
Expand Down
Expand Up
@@ -569,11 +528,6 @@ std::vector<std::string> RISCVISAInfo::toFeatures(bool AddAllExtensions,
Features.push_back ((llvm::Twine (" -experimental-" ) + Ext.Name ).str ());
}
}
// Add profile feature.
if (!Profile.empty ())
Features.push_back ((Twine (" +" ) + Profile).str ());
return Features;
}
Expand Down
Expand Up
@@ -900,33 +854,6 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
" string must be lowercase" );
}
bool IsProfile = Arch.starts_with (" rvi" ) || Arch.starts_with (" rva" ) ||
Arch.starts_with (" rvb" ) || Arch.starts_with (" rvm" );
std::string NewArch;
std::string ProfileName;
if (IsProfile) {
const auto *FoundProfile =
llvm::find_if (SupportedProfiles, [&](const RISCVProfile &Profile) {
return Arch.starts_with (Profile.Name );
});
if (FoundProfile == std::end (SupportedProfiles))
return createStringError (errc::invalid_argument, " unsupported profile" );
ProfileName = FoundProfile->Name ;
NewArch = FoundProfile->MArch ;
StringRef ArchWithoutProfile = Arch.substr (ProfileName.size ());
if (!ArchWithoutProfile.empty ()) {
if (!ArchWithoutProfile.starts_with (" _" ))
return createStringError (
errc::invalid_argument,
" additional extensions must be after separator '_'" );
NewArch = NewArch + ArchWithoutProfile.str ();
}
Arch = NewArch;
}
bool HasRV64 = Arch.starts_with (" rv64" );
// ISA string must begin with rv32 or rv64.
if (!(Arch.starts_with (" rv32" ) || HasRV64) || (Arch.size () < 5 )) {
Expand All
@@ -937,9 +864,6 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
unsigned XLen = HasRV64 ? 64 : 32 ;
std::unique_ptr<RISCVISAInfo> ISAInfo (new RISCVISAInfo (XLen));
if (!ProfileName.empty ())
ISAInfo->Profile = ProfileName;
MapVector<std::string, RISCVISAInfo::ExtensionVersion,
std::map<std::string, unsigned >>
SeenExtMap;
Expand Down