[llvm-commits] [llvm-gcc-4.2] r82640 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Chris Lattner clattner at apple.com
Thu Sep 24 11:47:09 PDT 2009


On Sep 24, 2009, at 8:46 AM, Dale Johannesen wrote:

> OK, I'll do all this.

Thanks Dale!

> May I ask what good llvm.sqrt is when defined this way?  It can't be  
> used by any language that follows IEEE754.
> And gcc produces NaN for sqrt(-3) even with -ffast-math or -ffinite- 
> math-only, so I don't think there is any flag setting where it would  
> be appropriate to use llvm.sqrt.


I don't know, maybe nothing.  The fact that GCC folds -3 -> NaN isn't  
required with -ffinite-math-only though, it may do less obvious  
optimizations assuming that sqrt doesn't produce a nan for example.

The two reasons we have llvm.sqrt are that 1) it allows vectors, and  
2) it's undefined on invalid input.  I don't have a good reason to  
care about llvm.sqrt personally.

-Chris



More information about the llvm-commits mailing list