================ @@ -48,6 +48,19 @@ 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; ---------------- jroelofs wrote:
I don't understand the algorithm here. This seems like sorts resolvees first by how many conditions they've got, and _then_ by the highest priority of each in that group. But what we actually need is a total order on two sets. Maybe the API should be shaped more like a comparison operator on feature sets, rather than a serialized index constructed from members's priorities? https://github.com/llvm/llvm-project/pull/116257 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits