News for hackers. Stuff that matters.
Re:The cpu_features library by dbaupp on Wednesday February 07, 2018 @04:30PM (#16328187)
> 3. When developing SIMD related libraries which need to be portable across multiple CPU versions you may set up a CPUID mask (so trap, then hide features) to ensure compatibility on legacy computers.

Huh? My impression was CPUID was exactly the opposite: using it properly allows ensuring compatibility on older computers while still getting maximum performance, since one can dynamically dispatch to an implementation that uses only what is supported. (E.g. switch between an SSE2 version and an AVX version.)

Re:The cpu_features library by haberman on Wednesday February 07, 2018 @04:56PM (#16328385)
I think GP is saying that unit tests for such dynamically-dispatching code will want to be able to inject older CPUIDs, so the compatibility fallbacks have test coverage. If CPUID is a native instruction, it's harder to inject a fake value.

I'm not sure I find this compelling though. It's easy to make your own CPUID function that doesn't actually call "CPUID" in a test build.

Re:The cpu_features library by jcranmer on Wednesday February 07, 2018 @04:49PM (#16328337)
Your impression is correct.