[compiler-rt] [AArch64][compiler-rt] Add a function returning the current vector length (PR #92921)

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 10:48:36 PDT 2024


================
@@ -50,3 +52,24 @@ __attribute__((constructor(90)))
 static void init_aarch64_has_sme(void) {
   __aarch64_has_sme_and_tpidr2_el0 = has_sme();
 }
+
+#if __GNUC__ >= 9
+#pragma GCC diagnostic ignored "-Wprio-ctor-dtor"
+#endif
+__attribute__((constructor(90))) void get_aarch64_cpu_features(void) {
+  if (!__aarch64_cpu_features.features)
+    __init_cpu_features();
+}
+
+__attribute__((target("sve"))) long emit_cntd(void) {
----------------
efriedma-quic wrote:

`static`?

https://github.com/llvm/llvm-project/pull/92921


More information about the llvm-commits mailing list