[PATCH] The LoopVectorizer and libm sqrt

Arnold Schwaighofer aschwaighofer at apple.com
Thu Sep 12 11:47:27 PDT 2013


I did not write this code but I assume this was done on purpose because our llvm.sqrt intrinsics has a slightly different semantics:

The ‘llvm.sqrt‘ intrinsics return the sqrt of the specified operand, returning the same value as the libm ‘sqrt‘ functions would. Unlike sqrt in libm, however, llvm.sqrt has undefined behavior for negative numbers other than -0.0 (which allows for better optimization, because there is no need to worry about errno being set). llvm.sqrt(-0.0) is defined to return -0.0 like IEEE sort.

 
On Sep 12, 2013, at 1:39 PM, Hal Finkel <hfinkel at anl.gov> wrote:

> Nadav, Arnold, et al.,
> 
> It seems as though libm sqrt was accidentally omitted from the list of functions with associated vectorizable intrinsics. The attached patch fixes this. Please review.
> 
> Thanks again,
> Hal
> 
> -- 
> Hal Finkel
> Assistant Computational Scientist
> Leadership Computing Facility
> Argonne National Laboratory<lv-libm-sqrt.patch>





More information about the llvm-commits mailing list