[PATCH] CodeGen: Emit sqrt intrinsic from __builtin_sqrt
thomas.stellard at amd.com
Thu Mar 19 15:38:59 PDT 2015
In http://reviews.llvm.org/D8468#143776, @hfinkel wrote:
> To play devil's advocate: I don't understand what you're trying to fix here. So the intrinsic has undefined behavior if x < -0.0; that's the definition of our intrinsic.
The check is there to avoid the undefined behavior. My understanding is that __builtin_sqrtf is supposed to return NaN for x < -0.0, so we need to handle that case specially if we emit the intrinsic.
> Regardless, you don't need to insert the extra code if we're in NoNaNs mode.
More information about the cfe-commits