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