News for hackers. Stuff that matters.
Re:The cpu_features library by CapacitorSet on Wednesday February 07, 2018 @04:22PM (#16328126)
To add on the other comments, not only the machine where you compile is not the same as the one where you run your software, but consider the case where you want a software to run on as many CPUs as possible while still making use of advanced features where supported.

You'd tell the compiler "target a machine with <basic instruction set>", so it's not allowed to use advanced features like FMA because it can't assume they're supported. With this library, you'd check at run-time if FMA is supported, and then change functions accordingly.

Re:The cpu_features library by saagarjha on Wednesday February 07, 2018 @04:37PM (#16328243)
Yes, I realized that I didn't take that into account. A follow up though: could a executable loader find and "trim" implementations that aren't optimize for the processor it's using, if it's properly marked in the binary?
Re:The cpu_features library by mmozeiko on Wednesday February 07, 2018 @06:18PM (#16328868)