[PATCH] CodeGen: Emit sqrt intrinsic from __builtin_sqrt

hfinkel at anl.gov hfinkel at anl.gov
Thu Mar 19 15:41:56 PDT 2015


In http://reviews.llvm.org/D8468#143819, @tstellarAMD wrote:

> 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.


Right, I just want to understand what "supposed to" means? (what GCC does?)

> 

> 

> > Regardless, you don't need to insert the extra code if we're in NoNaNs mode.

> 





REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8468

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list