Lines Matching full:arch
1 //===-- RISCVISAInfo.cpp - RISC-V Arch String Parser ----------------------===//
481 RISCVISAInfo::parseNormalizedArchString(StringRef Arch) { in parseNormalizedArchString() argument
484 Arch, [](char C) { return isDigit(C) || isLower(C) || C == '_'; })) in parseNormalizedArchString()
489 if (Arch.consume_front("rv32")) in parseNormalizedArchString()
491 else if (Arch.consume_front("rv64")) in parseNormalizedArchString()
494 if (XLen == 0 || Arch.empty() || (Arch[0] != 'i' && Arch[0] != 'e')) in parseNormalizedArchString()
495 return getError("arch string must begin with valid base ISA"); in parseNormalizedArchString()
502 while (!Arch.empty()) { in parseNormalizedArchString()
503 if (Arch[0] == '_') { in parseNormalizedArchString()
504 if (Arch.size() == 1 || Arch[1] == '_') in parseNormalizedArchString()
506 Arch = Arch.drop_front(); in parseNormalizedArchString()
509 size_t Idx = Arch.find('_'); in parseNormalizedArchString()
510 StringRef Ext = Arch.slice(0, Idx); in parseNormalizedArchString()
511 Arch = Arch.slice(Idx, StringRef::npos); in parseNormalizedArchString()
557 RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension, in parseArchString() argument
561 Arch, [](char C) { return isDigit(C) || isLower(C) || C == '_'; })) in parseArchString()
566 if (Arch.consume_front("rv32")) { in parseArchString()
568 } else if (Arch.consume_front("rv64")) { in parseArchString()
572 auto ProfileCmp = [](StringRef Arch, const RISCVProfile &Profile) { in parseArchString() argument
573 return Arch < Profile.Name; in parseArchString()
575 auto I = llvm::upper_bound(SupportedProfiles, Arch, ProfileCmp); in parseArchString()
577 Arch.starts_with(std::prev(I)->Name); in parseArchString()
579 I = llvm::upper_bound(SupportedExperimentalProfiles, Arch, ProfileCmp); in parseArchString()
581 Arch.starts_with(std::prev(I)->Name)); in parseArchString()
591 StringRef ArchWithoutProfile = Arch.drop_front(I->Name.size()); in parseArchString()
602 if (XLen == 0 || Arch.empty()) in parseArchString()
611 char Baseline = Arch.front(); in parseArchString()
613 Arch = Arch.drop_front(); in parseArchString()
626 StringRef(&Baseline, 1), Arch, Major, Minor, ConsumeLength, in parseArchString()
634 if (!Arch.empty() && isDigit(Arch.front())) in parseArchString()
654 Arch = Arch.drop_front(ConsumeLength); in parseArchString()
656 while (!Arch.empty()) { in parseArchString()
657 if (Arch.front() == '_') { in parseArchString()
658 if (Arch.size() == 1 || Arch[1] == '_') in parseArchString()
660 Arch = Arch.drop_front(); in parseArchString()
663 size_t Idx = Arch.find('_'); in parseArchString()
664 StringRef Ext = Arch.slice(0, Idx); in parseArchString()
665 Arch = Arch.slice(Idx, StringRef::npos); in parseArchString()
940 raw_string_ostream Arch(Buffer); in toString() local
942 Arch << "rv" << XLen; in toString()
948 Arch << LS << ExtName; in toString()
949 Arch << ExtInfo.Major << "p" << ExtInfo.Minor; in toString()
952 return Arch.str(); in toString()