https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90070
Segher Boessenkool <segher at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|powerpc64le-gnu-linux, |powerpc*-*-*
|powerpc64-gnu-linux |
Host|powerpc64le-gnu-linux, |
|powerpc64-gnu-linux |
Build|powerpc64le-gnu-linux, |
|powerpc64-gnu-linux |
--- Comment #4 from Segher Boessenkool <segher at gcc dot gnu.org> ---
You'll have a crossing anyway (it is y+5*x with x an integer and y a float),
but a single fma is faster than doing the mul as integer, almost everywhere.
When we write e.g.
float f(float x) { return 5.0 * x; }
GCC is smart enough to do the mul in single precision (although C says it is
double precision, and only later rounded to SP, the result is identical)"
addis 9,2,.LC0@toc@ha
lfs 0,.LC0@toc@l(9)
fmuls 1,1,0
blr
but for
float f(float x, float y) { return 5.0*x + y; }
it does not (and AFAICS it gives identical results here, too, even without
-ffast-math, which makes no difference currently):
addis 9,2,.LC1@toc@ha
lfd 0,.LC1@toc@l(9)
fmadd 1,1,0,2
frsp 1,1
blr