================
@@ -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;
----------------
labrinea wrote:

> I'm not sure it does that correctly: I think simd+dotprod is weighted higher 
> than sme with this algorithm purely because it has more features.

Exactly. `Priority(simd+dotprod) > Priority(sme) > Priority(simd) + 
Priority(dotprod)`. That's intentional according to the current spec.

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

Reply via email to