xref: /freebsd/contrib/llvm-project/compiler-rt/lib/builtins/aarch64/sme-abi-vg.c (revision 52418fc2be8efa5172b90a3a9e617017173612c4)
1 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2 // See https://llvm.org/LICENSE.txt for license information.
3 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4 
5 #include "../cpu_model/aarch64.h"
6 
7 struct FEATURES {
8   unsigned long long features;
9 };
10 
11 extern struct FEATURES __aarch64_cpu_features;
12 
13 #if __GNUC__ >= 9
14 #pragma GCC diagnostic ignored "-Wprio-ctor-dtor"
15 #endif
16 __attribute__((constructor(90))) static void get_aarch64_cpu_features(void) {
17   if (__atomic_load_n(&__aarch64_cpu_features.features, __ATOMIC_RELAXED))
18     return;
19 
20   __init_cpu_features();
21 }
22