[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:37 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) {
+ long vl;
+ __asm__ __volatile__("cntd %0" : "=r"(vl));
+ return vl;
+}
+
+long get_runtime_vl(void) {
----------------
efriedma-quic wrote:
This probably should be prefixed with `__aarch64`
https://github.com/llvm/llvm-project/pull/92921
More information about the llvm-commits
mailing list