4 ms·
Putting aside most of your earlier comment, > the question is how many exceptions would arise, and what the speed penalty would be to fall back to the next slo
by loeg 7y ago
Putting aside most of your earlier comment,
> the question is how many exceptions would arise, and what the speed penalty would be to fall back to the next slower implementation.
This can be done for essentially free with ifuncs.
Here's a crummy example from the GCC docs: https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.html#index-_005f_005fbuiltin_005fcpu_005finit-1 https://gcc.gnu.org/onlinedocs/gcc/x86-Built-in-Functions.ht...
Here's a more thorough and (IMO) intelligible treatise on the subject: https://lwn.net/Articles/691932/ https://lwn.net/Articles/691932/
- arthur2e5 7y agoThe FMV (4.8) and clone (6.0) features are intended to be easier-to-use wrappers around ifunc. FMV-4.8 (C++) generates the ifunc dispatching code for the programmer, and FMV-6.0 (C/C++) moves on to do the code duplication for the programmer too. It is added with the assumption that GCC's optimization / vectorization magic is good enough to gain significant performance gains by just changing -march options on the exact same piece of code.