[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
Fri May 31 12:27:41 PDT 2024
================
@@ -50,3 +52,35 @@ __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))) static void get_aarch64_cpu_features(void) {
+ if (!__get_aarch64_features())
+ __init_cpu_features();
+}
+
+struct SME_STATE {
+ long PSTATE;
+ long TPIDR2_EL0;
+};
+
+extern struct SME_STATE __arm_sme_state(void) __arm_streaming_compatible;
+
+__attribute__((target("sve"))) long
+__arm_get_current_vg(void) __arm_streaming_compatible {
----------------
efriedma-quic wrote:
Maybe split this into a separate file, so code using the other stuff defined in this file doesn't pull in the constructor? I assume __arm_get_current_vg won't be used in most configurations.
https://github.com/llvm/llvm-project/pull/92921
More information about the llvm-commits
mailing list