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
For a library I think it should just be a single file, and you can include it as many times as you want with different #define's. That way the user can choose which of these they want, or none.
-
-
Or, if it turns out that they effectively share no code (which they well might!), then there's just 3 .h's - meow_aesni, meow_avx2, and meow_avx512, or something like that.
-
My suspicion is, for Meow, basically the entire thing will be ASM-like, so probably just one .h file per platform is the best solution, with an example file that shows how to build them all and switch if you so desire.
- 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.