Add inputs that generate larger error bounds
[glibc.git] / sysdeps / x86 / dl-get-cpu-features.c
blob839803c746f408edffaadbe250a8f52abaccc7db
1 /* Initialize CPU feature data via IFUNC relocation.
2 Copyright (C) 2015-2021 Free Software Foundation, Inc.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <https://www.gnu.org/licenses/>. */
19 #include <ldsodefs.h>
21 #ifdef SHARED
22 # include <cpu-features.c>
24 /* NB: Normally, DL_PLATFORM_INIT calls init_cpu_features to initialize
25 CPU features in dynamic executable. But when loading ld.so inside of
26 static executable, DL_PLATFORM_INIT isn't called and IFUNC relocation
27 is used to call init_cpu_features. In static executable, it is called
28 once by IFUNC relocation. In dynamic executable, it is called twice
29 by DL_PLATFORM_INIT and by IFUNC relocation. */
30 extern void __x86_cpu_features (void) attribute_hidden;
31 void (*const __x86_cpu_features_p) (void) attribute_hidden
32 = __x86_cpu_features;
34 void
35 _dl_x86_init_cpu_features (void)
37 struct cpu_features *cpu_features = __get_cpu_features ();
38 if (cpu_features->basic.kind == arch_kind_unknown)
39 init_cpu_features (cpu_features);
42 __ifunc (__x86_cpu_features, __x86_cpu_features, NULL, void,
43 _dl_x86_init_cpu_features);
44 #endif
46 #undef _dl_x86_get_cpu_features
48 const struct cpu_features *
49 _dl_x86_get_cpu_features (void)
51 return &GLRO(dl_x86_cpu_features);