Hi, The GCC documentation (http://gcc.gnu.org/onlinedocs/gcc/X86-Built_002din-Functions.html) claims there should be such an intrinsic, added in gcc 4.7: unsigned long long _bzhi_u64 (unsigned long long, unsigned long long) Yet, with gcc 4.8.1 (Debian 4.8.1-2), nothing of the sort exists: sesse@gruessi:~$ gcc-4.8 -Wall -O2 -mbmi2 -c bzhi-test.c bzhi-test.c: In function ‘func’: bzhi-test.c:5:2: warning: implicit declaration of function ‘_bzhi_u64’ [-Wimplicit-function-declaration] return _bzhi_u64(x, y); ^ A function call is generated instead, which was obviously not what I intended. :-) I thought this was maybe just a documentation error, but __builtin_ia32_bzhi_u64 also does not exist.
If you forget to include #include <x86intrin.h> then don't be surprised.
Shouldn't really the documentation say so, then? The entire GCC manual seems to make no note of this header at all, as far as I can see.