On Donnerstag, 8. Dezember 2022 16:25:41 CET Jan Engelhardt wrote:
On Thursday 2022-12-08 15:39, Stephan Kulow wrote:
Am 08.12.22 um 15:05 schrieb Neal Gompa:
Or FatELF: https://icculus.org/fatelf/
(We could only hope...)
That in general sounds like something gcc/binutils could do on a function level. Like compiling with v3, identifying cpu instructions used not fitting v1 and then creating a jump table based on cpu information. Patent pending :)
Just like https://gcc.gnu.org/onlinedocs/gcc/Function-Multiversioning.html , but have gcc do it automatically for every function without source code modification.
IIRC since GCC 6 it can do automatic clones for a specified list of instruction extensions. Clang gained the same with LLVM 14?/15?. Unfortunately, MSVC does not support this (yet [1]), so this is a big barrier for multiplatform projects, and the reason many projects still use their own home grown dispatcher. Regards, Stefan [1] https://www.youtube.com/watch?v=LTM1was1dTU -- Stefan Brüns / Bergstraße 21 / 52062 Aachen phone: +49 241 53809034 mobile: +49 151 50412019