← Back to context

Comment by pabs3

20 hours ago

Thats correct, but usually compilers don't do that if you use the CPU baseline.

> but usually compilers don't do that if you use the CPU baseline

That's a problem that people are trying to solve by not using an ancient CPU baseline. Do you have a reasonable proposal for how else we should enable widespread use of hardware functionality that's less than two decades old?

  • The compiler could auto-enable function multi-versioning (FMV) for functions where auto-vectorisation gets triggered. At program start, FMV checks which instructions are available and updates function pointers to the right functions. Things like glibc use FMV to switch things like memcpy to SIMD-optimised versions.