Hi,
I am trying to use the BMI2 instructions with gcc built-ins. According to the documentation I can find, there should be a function _pdep_u64 if I am compiling with -mbmi2, but whatever I try, the compiler complains that it doesn't know that function.
I have gcc version 5.3.0.
Any ideas?
Thanks!
Álvaro.
BMI2 intrinsics in gcc
Moderators: hgm, Rebel, chrisw
-
- Posts: 931
- Joined: Tue Mar 09, 2010 3:46 pm
- Location: New York
- Full name: Álvaro Begué (RuyDos)
-
- Posts: 778
- Joined: Sat Jul 01, 2006 7:11 am
Re: BMI2 intrinsics in gcc
I am no gcc expert, but I can use _pdep_u64 . I compile on gcc 5.3 withAlvaroBegue wrote:Hi,
I am trying to use the BMI2 instructions with gcc built-ins. According to the documentation I can find, there should be a function _pdep_u64 if I am compiling with -mbmi2, but whatever I try, the compiler complains that it doesn't know that function.
I have gcc version 5.3.0.
Any ideas?
Thanks!
Álvaro.
g++ -O3 -m64 -D _WIN32_WINNT=0x0600 -march=native -Wno-write-strings -Wno-narrowing
Did you #include <immintrin.h> ?
-
- Posts: 931
- Joined: Tue Mar 09, 2010 3:46 pm
- Location: New York
- Full name: Álvaro Begué (RuyDos)
Re: BMI2 intrinsics in gcc
That was it. Thanks!jwes wrote: Did you #include <immintrin.h> ?
But why is that header file not mentioned in the documentation?
These would have been good places to put it:
https://gcc.gnu.org/onlinedocs/gcc-4.9. ... tions.html
https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
-
- Posts: 1334
- Joined: Sun Jul 17, 2011 11:14 am
Re: BMI2 intrinsics in gcc
Because that header is an Intel-provided system header that would probably be in the glibc documentation. The intrinsics GCC uses on x86 are described here.
Some believe in the almighty dollar.
I believe in the almighty printf statement.
I believe in the almighty printf statement.