3 ms·
GCC has the __builtin_cpu_supports() function on some architectures, so you may want to use that instead. It's supported: * on x86 since GCC 4.8 * on PowerPC
by jwilk 9y ago
GCC has the __builtin_cpu_supports() function on some architectures, so you may want to use that instead.
It's supported:
* on x86 since GCC 4.8
* on PowerPC since GCC 6 (you will also need glibc ≥ 2.23)
Documentation:
https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.html https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.ht...
https://gcc.gnu.org/onlinedocs/gcc/PowerPC-Built-in-Functions.html https://gcc.gnu.org/onlinedocs/gcc/PowerPC-Built-in-Function...
- bringtheaction 9y agoDoes clang have anything similar?
- jwilk 9y agoSince Clang 3.8 at least, it has __builtin_cpu_supports() too.