4 ms·
The way the author is using it to generate both AVX and non-AVX code is such a hack that I find it hard to believe it even worked. It is literally a ticking tim
by flamedoge 10y ago
The way the author is using it to generate both AVX and non-AVX code is such a hack that I find it hard to believe it even worked. It is literally a ticking time bomb that depends on compiler's inliner heuristics to trigger. Compilers and linkers should be able to generate and optimize different code paths -- it shouldn't have to take hacking and tinkering with tools to do something. To make it sound worse, that something isn't even guaranteed to be safe even with hacky build.
Literally the only two things it takes to do this are a conditional check based on CPUID result and CodeGen support for generating multiple Arch paths. If you have those two, multi-version function is very likely to work with safety.
Edit: oh, you are the author. I hope you weren't offended. I meant none.