4 ms·
In my understanding when you use intrinsics and build for a processor without support for the intrinsics then GCC for example will replace it with equivalent co
by why_only_15 8y ago
In my understanding when you use intrinsics and build for a processor without support for the intrinsics then GCC for example will replace it with equivalent code.
- eesmith 8y agoThat is true. Here's a couple of negatives. First, you still need to build once for each architecture, either as different executables, or as different object files, and provide some dispatch mechanism to use the right one based on what hardware is available. Second, if the intrinsics aren't built-in then there may be faster alternatives than using the GCC emulated version.
- mcbain 8y agoUnfortunately, no. That is the case with GCCs __builtin functions. With a few exceptions, intrinsics are basically macros for inline asm that the compiler can reason about. If on x86-64 you use a _mm256* intrinsic and compile without AVX support you just get a compile error, not a pair of equivalent SSE instructions.
- rurban 8y agoEven worse. You mostly get run-time errors when the built machine supported that feature, your machine doesn't, and the features aren't separated into multiversioning or loading different shared libs.