diff options
Diffstat (limited to 'llvm/lib/TargetParser')
-rw-r--r-- | llvm/lib/TargetParser/AArch64TargetParser.cpp | 19 | ||||
-rw-r--r-- | llvm/lib/TargetParser/Host.cpp | 10 | ||||
-rw-r--r-- | llvm/lib/TargetParser/RISCVISAInfo.cpp | 3 |
3 files changed, 14 insertions, 18 deletions
diff --git a/llvm/lib/TargetParser/AArch64TargetParser.cpp b/llvm/lib/TargetParser/AArch64TargetParser.cpp index 50c9a56..7d0b8c3 100644 --- a/llvm/lib/TargetParser/AArch64TargetParser.cpp +++ b/llvm/lib/TargetParser/AArch64TargetParser.cpp @@ -48,17 +48,12 @@ std::optional<AArch64::ArchInfo> AArch64::ArchInfo::findBySubArch(StringRef SubA return {}; } -unsigned AArch64::getFMVPriority(ArrayRef<StringRef> Features) { - constexpr unsigned MaxFMVPriority = 1000; - unsigned Priority = 0; - unsigned NumFeatures = 0; - for (StringRef Feature : Features) { - if (auto Ext = parseFMVExtension(Feature)) { - Priority = std::max(Priority, Ext->Priority); - NumFeatures++; - } - } - return Priority + MaxFMVPriority * NumFeatures; +uint64_t AArch64::getFMVPriority(ArrayRef<StringRef> Features) { + uint64_t Priority = 0; + for (StringRef Feature : Features) + if (std::optional<FMVInfo> Info = parseFMVExtension(Feature)) + Priority |= (1ULL << Info->PriorityBit); + return Priority; } uint64_t AArch64::getCpuSupportsMask(ArrayRef<StringRef> Features) { @@ -73,7 +68,7 @@ uint64_t AArch64::getCpuSupportsMask(ArrayRef<StringRef> Features) { uint64_t FeaturesMask = 0; for (const FMVInfo &Info : getFMVInfo()) if (Info.ID && FeatureBits.Enabled.test(*Info.ID)) - FeaturesMask |= (1ULL << Info.Bit); + FeaturesMask |= (1ULL << Info.FeatureBit); return FeaturesMask; } diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp index 45b4caf..9d1b7b8b 100644 --- a/llvm/lib/TargetParser/Host.cpp +++ b/llvm/lib/TargetParser/Host.cpp @@ -173,7 +173,7 @@ StringRef sys::detail::getHostCPUNameForARM(StringRef ProcCpuinfoContent) { // Read 32 lines from /proc/cpuinfo, which should contain the CPU part line // in all cases. SmallVector<StringRef, 32> Lines; - ProcCpuinfoContent.split(Lines, "\n"); + ProcCpuinfoContent.split(Lines, '\n'); // Look for the CPU implementer line. StringRef Implementer; @@ -436,7 +436,7 @@ StringRef sys::detail::getHostCPUNameForS390x(StringRef ProcCpuinfoContent) { // The "processor 0:" line comes after a fair amount of other information, // including a cache breakdown, but this should be plenty. SmallVector<StringRef, 32> Lines; - ProcCpuinfoContent.split(Lines, "\n"); + ProcCpuinfoContent.split(Lines, '\n'); // Look for the CPU features. SmallVector<StringRef, 32> CPUFeatures; @@ -478,7 +478,7 @@ StringRef sys::detail::getHostCPUNameForS390x(StringRef ProcCpuinfoContent) { StringRef sys::detail::getHostCPUNameForRISCV(StringRef ProcCpuinfoContent) { // There are 24 lines in /proc/cpuinfo SmallVector<StringRef> Lines; - ProcCpuinfoContent.split(Lines, "\n"); + ProcCpuinfoContent.split(Lines, '\n'); // Look for uarch line to determine cpu name StringRef UArch; @@ -1630,7 +1630,7 @@ StringRef sys::getHostCPUName() { #if defined(__linux__) StringRef sys::detail::getHostCPUNameForSPARC(StringRef ProcCpuinfoContent) { SmallVector<StringRef> Lines; - ProcCpuinfoContent.split(Lines, "\n"); + ProcCpuinfoContent.split(Lines, '\n'); // Look for cpu line to determine cpu name StringRef Cpu; @@ -1970,7 +1970,7 @@ const StringMap<bool> sys::getHostCPUFeatures() { return Features; SmallVector<StringRef, 32> Lines; - P->getBuffer().split(Lines, "\n"); + P->getBuffer().split(Lines, '\n'); SmallVector<StringRef, 32> CPUFeatures; diff --git a/llvm/lib/TargetParser/RISCVISAInfo.cpp b/llvm/lib/TargetParser/RISCVISAInfo.cpp index cafc9d3..d6e1eac 100644 --- a/llvm/lib/TargetParser/RISCVISAInfo.cpp +++ b/llvm/lib/TargetParser/RISCVISAInfo.cpp @@ -742,7 +742,8 @@ Error RISCVISAInfo::checkDependency() { bool HasZvl = MinVLen != 0; bool HasZcmt = Exts.count("zcmt") != 0; static constexpr StringLiteral XqciExts[] = { - {"xqcia"}, {"xqcics"}, {"xqcicsr"}, {"xqcilsm"}, {"xqcisls"}}; + {"xqcia"}, {"xqciac"}, {"xqcicli"}, {"xqcicm"}, + {"xqcics"}, {"xqcicsr"}, {"xqcilsm"}, {"xqcisls"}}; if (HasI && HasE) return getIncompatibleError("i", "e"); |