Quick question: How do you tell a C compiler to use an instruction set extension only within specific code blocks, like:
if(processor_has_instruction)
//use instruction
else
//fallback code that won't be optimised to use instruction
Poke: @cmuratori
-
-
[4/4] Compile the majority of the code with the minimum platform, but make separate versions of specific routines and decorate them with a compiler-specific prefix like "__attribute__ ((__target__("avx2")))" (CLANG).
-
Of course I'm asking because I wonder what we should do in Meow. Neither of the two first options seem particularly user-friendly for a library, third one should take care of GCC and Clang. Are there any good options in MSVC?
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.