Re:Std: Clamp generates less efficient assembly than std:min...
by borodi on Tuesday January 16, 2024 @10:41AM
(#39014527)
So it was a bit more pervasive than this, the issue was that flushing subnormals (values very close to 0) to 0 is a register that gets set, so if a library is built with the fastmath flags and it gets loaded, it sets the register, causing the whole process to flush it's subnormals. i.e https://github.com/llvm/llvm-project/issues/57589
Re:Std: Clamp generates less efficient assembly than std:min...
by jcranmer on Tuesday January 16, 2024 @11:14AM
(#39015025)
> This would only affect code that uses the old-school x87 floating point instructions, though?
Actually, no, the x87 FPU instructions are the only ones that won't be affected.
It sets the FTZ/DAZ bits, which exist for SSE instructions but not x87 instructions.
I would think practically all modern FPU code on x86-64 would be using the SIMD registers which have explicit widths.