[clang] [llvm] [AArch64][FMV] Add missing feature dependencies and detect at runtime. (PR #119231)
Sander de Smalen via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 11 05:47:15 PST 2024
================
@@ -61,13 +61,13 @@ unsigned AArch64::getFMVPriority(ArrayRef<StringRef> Features) {
return Priority + MaxFMVPriority * NumFeatures;
}
-uint64_t AArch64::getCpuSupportsMask(ArrayRef<StringRef> FeatureStrs) {
- uint64_t FeaturesMask = 0;
- for (const StringRef &FeatureStr : FeatureStrs) {
- if (auto Ext = parseFMVExtension(FeatureStr))
- FeaturesMask |= (1ULL << Ext->Bit);
- }
- return FeaturesMask;
+uint64_t AArch64::getCpuSupportsMask(ArrayRef<StringRef> Features) {
+ ExtensionSet FeatureBits;
+ for (StringRef Feature : Features)
+ if (auto Ext = parseFMVExtension(Feature))
+ if (Ext->ID)
+ FeatureBits.enable(*Ext->ID);
----------------
sdesmalen-arm wrote:
Thanks. Could you make this more explicit in the documentation, i.e. that `AArch64::CPUFeatures` is a bitmask of features used by the FMV mechanism to test whether a certain feature is enabled at runtime?
https://github.com/llvm/llvm-project/pull/119231
More information about the llvm-commits
mailing list