1 /* x86 version of hardware capability information handling macros.
2 Copyright (C) 2017 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 <http://www.gnu.org/licenses/>. */
22 /* Since ldconfig processes both i386 and x86-64 libraries, it needs
23 to cover all platforms and hardware capabilities. */
24 # define HWCAP_PLATFORMS_START 0
25 # define HWCAP_PLATFORMS_COUNT 4
26 # define HWCAP_START 0
27 # define HWCAP_COUNT 2
28 # define HWCAP_IMPORTANT (HWCAP_X86_SSE2 | HWCAP_X86_AVX512_1)
29 #elif defined __x86_64__
30 /* For 64 bit, only cover x86-64 platforms and capabilities. */
31 # define HWCAP_PLATFORMS_START 2
32 # define HWCAP_PLATFORMS_COUNT 4
33 # define HWCAP_START 1
34 # define HWCAP_COUNT 2
35 # define HWCAP_IMPORTANT (HWCAP_X86_AVX512_1)
37 /* For 32 bit, only cover i586, i686 and SSE2. */
38 # define HWCAP_PLATFORMS_START 0
39 # define HWCAP_PLATFORMS_COUNT 2
40 # define HWCAP_START 0
41 # define HWCAP_COUNT 1
42 # define HWCAP_IMPORTANT (HWCAP_X86_SSE2)
47 HWCAP_X86_SSE2
= 1 << 0,
48 HWCAP_X86_AVX512_1
= 1 << 1
51 static inline const char *
52 __attribute__ ((unused
))
53 _dl_hwcap_string (int idx
)
55 return GLRO(dl_x86_hwcap_flags
)[idx
];
59 __attribute__ ((unused
, always_inline
))
60 _dl_string_hwcap (const char *str
)
64 for (i
= HWCAP_START
; i
< HWCAP_COUNT
; i
++)
66 if (strcmp (str
, GLRO(dl_x86_hwcap_flags
)[i
]) == 0)
72 /* We cannot provide a general printing function. */
73 #define _dl_procinfo(type, word) -1
75 #endif /* dl-hwcap.h */