Lines Matching +full:supervisor +full:- +full:level
1 //===-- RISCVISAInfo.cpp - RISC-V Arch String Parser ----------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
84 outs() << "All available -march extensions for RISC-V\n\n"; in printSupportedExtensions()
103 PrintExtension(E.first, Version, DescMap["experimental-" + E.first]); in printSupportedExtensions()
114 outs() << "\nUse -march to specify the target's extension.\n" in printSupportedExtensions()
115 "For example, clang -march=rv32i_v1p0\n"; in printSupportedExtensions()
121 outs() << "Extensions enabled for the given RISC-V target\n\n"; in printEnabledExtensions()
141 if (EnabledFeatureNames.count("experimental-" + Name.str()) != 0) { in printEnabledExtensions()
149 PrintExtension(E.first, Version, DescMap["experimental-" + E.first]); in printEnabledExtensions()
154 outs() << "\nISA String: " << ISAString.get()->toString() << "\n"; in printEnabledExtensions()
158 return Ext.consume_front("experimental-"); in stripExperimentalPrefix()
163 // consume [0-9]*p[0-9]* starting from the backward. An extension name will not
170 "Already guarded by if-statement in ::parseArchString"); in findLastNonVersionCharacter()
172 int Pos = Ext.size() - 1; in findLastNonVersionCharacter()
174 Pos--; in findLastNonVersionCharacter()
175 if (Pos > 0 && Ext[Pos] == 'p' && isDigit(Ext[Pos - 1])) { in findLastNonVersionCharacter()
176 Pos--; in findLastNonVersionCharacter()
178 Pos--; in findLastNonVersionCharacter()
202 if (I == ExtInfo.end() || I->Name != ExtName) in findDefaultVersion()
205 return I->Version; in findDefaultVersion()
212 return "standard supervisor-level extension"; in getExtensionTypeDesc()
214 return "non-standard user-level extension"; in getExtensionTypeDesc()
216 return "standard user-level extension"; in getExtensionTypeDesc()
234 if (I == std::end(SupportedExperimentalExtensions) || I->Name != Ext) in isExperimentalExtension()
237 return I->Version; in isExperimentalExtension()
248 return I != ExtInfo.end() && I->Name == Ext; in isSupportedExtensionFeature()
257 if (I != ExtInfo.end() && I->Name == Ext) in isSupportedExtension()
271 if (I->Version.Major == MajorVersion && I->Version.Minor == MinorVersion) in isSupportedExtension()
292 // https://github.com/riscv/riscv-isa-manual/blob/main/src/naming.adoc#base-integer-isa) in toFeatures()
293 // and is not recognized in clang -cc1 in toFeatures()
300 Features.push_back((llvm::Twine("+experimental-") + ExtName).str()); in toFeatures()
309 Features.push_back((llvm::Twine("-") + Ext.Name).str()); in toFeatures()
315 Features.push_back((llvm::Twine("-experimental-") + Ext.Name).str()); in toFeatures()
327 return getError("unsupported standard user-level extension '" + ExtName + in getErrorForInvalidExt()
352 In = In.substr(MajorStr.size() + MinorStr.size() - 1); in getExtensionVersion()
374 // Expected multi-character extension with version number to have no in getExtensionVersion()
379 "multi-character extensions must be separated by underscores"); in getExtensionVersion()
384 return getError("requires '-menable-experimental-extensions' " in getExtensionVersion()
415 Major = DefaultVersion->Major; in getExtensionVersion()
416 Minor = DefaultVersion->Minor; in getExtensionVersion()
442 ISAInfo->Exts = Exts; in createFromExtMap()
455 assert(ExtName.size() > 1 && (ExtName[0] == '+' || ExtName[0] == '-')); in parseFeatures()
457 ExtName = ExtName.drop_front(1); // Drop '+' or '-' in parseFeatures()
466 // `save-restore`, skip those feature. in parseFeatures()
468 ExtensionInfoIterator->Name != ExtName) in parseFeatures()
472 ISAInfo->Exts[ExtName.str()] = ExtensionInfoIterator->Version; in parseFeatures()
474 ISAInfo->Exts.erase(ExtName.str()); in parseFeatures()
482 // RISC-V ISA strings must be [a-z0-9_] in parseNormalizedArchString()
485 return getError("string may only contain [a-z0-9_]"); in parseNormalizedArchString()
525 if (!isDigit(Prefix[VersionStart - 1])) in parseNormalizedArchString()
527 --VersionStart; in parseNormalizedArchString()
545 if (!ISAInfo->Exts in parseNormalizedArchString()
552 ISAInfo->updateImpliedLengths(); in parseNormalizedArchString()
559 // RISC-V ISA strings must be [a-z0-9_] in parseArchString()
562 return getError("string may only contain [a-z0-9_]"); in parseArchString()
577 Arch.starts_with(std::prev(I)->Name); in parseArchString()
581 Arch.starts_with(std::prev(I)->Name)); in parseArchString()
583 return getError("requires '-menable-experimental-extensions' " in parseArchString()
585 std::prev(I)->Name + "'"); in parseArchString()
589 --I; in parseArchString()
590 std::string NewArch = I->MArch.str(); in parseArchString()
591 StringRef ArchWithoutProfile = Arch.drop_front(I->Name.size()); in parseArchString()
610 // Ref: Table 22.1 in RISC-V User-Level ISA V2.2 in parseArchString()
630 ISAInfo->Exts[std::string(1, Baseline)] = {Major, Minor}; in parseArchString()
647 ISAInfo->Exts[std::string(Ext)] = {Version->Major, Version->Minor}; in parseArchString()
673 Desc = "standard user-level extension"; in parseArchString()
677 // general purpose and standard user-level extensions. in parseArchString()
678 // Parse the ISA string containing non-standard user-level in parseArchString()
679 // extensions, standard supervisor-level extensions and in parseArchString()
680 // non-standard supervisor-level extensions. in parseArchString()
695 return getError("invalid standard user-level extension '" + in parseArchString()
712 if (!ISAInfo->Exts in parseArchString()
957 ISAInfo->updateImplication(); in postProcessAndChecking()
958 ISAInfo->updateCombination(); in postProcessAndChecking()
959 ISAInfo->updateImpliedLengths(); in postProcessAndChecking()
961 if (Error Result = ISAInfo->checkDependency()) in postProcessAndChecking()
1020 return isExperimentalExtension(Name) ? "experimental-" + Name.str() in getTargetFeatureForExtension()