[Llvm-bgq-discuss] rint() with -ffast-math

Hal Finkel hfinkel at anl.gov
Wed Jun 19 10:12:44 CDT 2013


----- Original Message -----
> 
> 
> 
> The function rint() is supposed to round to the nearest integer,
> breaking ties to even. With -ffast-math, it breaks ties away from
> zero. That is, in corner cases the result is incorrectly rounded.
> 
> 
> Is this intended? This (BGQ with Clang) is the first system that does
> so. (I understand why one would do this given the machine
> instructions available.)

Yes, this is the intended behavior (and LLVM will currently do this on all PPC systems). It is a function of the (odd) way in which the PPC frin instruction is defined. The upside is that it is much faster than the libc function call. That having been said, I put this optimization in, and I can take it out again ;) [or make it require some other flag]. Is the behavior too different for you?

Thanks again,
Hal

> 
> 
> -erik
> 
> 
> --
> Erik Schnetter < schnetter at cct.lsu.edu >
> http://www.perimeterinstitute.ca/personal/eschnetter/
> _______________________________________________
> llvm-bgq-discuss mailing list
> llvm-bgq-discuss at lists.alcf.anl.gov
> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-bgq-discuss mailing list