[compiler-rt] [AArch64][compiler-rt] Add a function returning the current vector length (PR #92921)
Kerry McLaughlin via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 3 06:11:15 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 {
----------------
kmclaughlin-arm wrote:
I've split this into a separate file and replaced the use of `has_sme()` with `__aarch64_has_sme_and_tpidr2_el0`.
https://github.com/llvm/llvm-project/pull/92921
More information about the llvm-commits
mailing list