mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-25 12:11:10 +00:00
9cd30491dd
These macros are used to implement ifunc selection in C. To implement an ifunc function, foo, which returns the address of __foo_sse2 or __foo_avx2: __foo_avx2: #define foo __redirect_foo #define __foo __redirect___foo #include <foo.h> #undef foo #undef __foo #define SYMBOL_NAME foo #include <init-arch.h> extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden; extern __typeof (REDIRECT_NAME) OPTIMIZE (avx2) attribute_hidden; static inline void * foo_selector (void) { if (use AVX2) return OPTIMIZE (avx2); return OPTIMIZE (sse2); } libc_ifunc_redirected (__redirect_foo, foo, foo_selector ()); * sysdeps/x86/init-arch.h (PASTER1): New. (EVALUATOR1): Likewise. (PASTER2): Likewise. (EVALUATOR2): Likewise. (REDIRECT_NAME): Likewise. (OPTIMIZE): Likewise. (IFUNC_SELECTOR): Likewise. |
||
---|---|---|
.. | ||
bits | ||
fpu | ||
nptl/bits | ||
cacheinfo.c | ||
cpu-features-offsets.sym | ||
cpu-features.c | ||
cpu-features.h | ||
dl-get-cpu-features.c | ||
dl-hwcap.h | ||
dl-procinfo.c | ||
dl-procinfo.h | ||
elide.h | ||
fpu_control.h | ||
init-arch.h | ||
libc-start.c | ||
linkmap.h | ||
Makefile | ||
string_private.h | ||
tininess.h | ||
tst-get-cpu-features-static.c | ||
tst-get-cpu-features.c | ||
Versions |