This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: IEEE 754 and fused-madd (was: Re: patch: rs6000 specific)
- From: Brad Lucier <lucier at math dot purdue dot edu>
- To: dalej at apple dot com (Dale Johannesen)
- Cc: dalej at apple dot com (Dale Johannesen), shebs at apple dot com (Stan Shebs), lucier at math dot purdue dot edu, gcc-patches at gcc dot gnu dot org, dje at watson dot ibm dot com (David Edelsohn)
- Date: Fri, 7 Dec 2001 16:27:18 -0500 (EST)
- Subject: Re: IEEE 754 and fused-madd (was: Re: patch: rs6000 specific)
> fmadd:
> A*C + B
> B + A*C
These are OK, addition is commutative.
> fnmsub:
> -(A*C - B)
> ((-A)*C) + B
This one is not, let A=B=C=+0., first gives -0., second gives 0.
> -((-B) + A*C)
This one is OK.
> B - A*C
This one is not, let A=B=C=+0., first expression gives -0., second gives 0.
> fmsub:
> A*C -B
> -B + A*C
These two are equivalent.
> -(B - A*C)
This one is not,
-(0. - (0. * 0.))=-(0.-0.)=-(0.)=-0.
while
(0.*0.) - 0. = 0. - 0. = 0.
> -((-A)*C + B)
No,
-((-(0.))*0. + 0.) = -((-0.)*0. + 0.)=-((-0.)+0.)=-(0.)=-0.
> fnmadd:
> -(A*C + B)
> ((-A)*C) -B
No, let A=C=0., B=-0., first gives
-(0. * 0. +(-0.))=-(0. + (-0.))=-(0.)=-0.
second gives
(-(0.))* 0. -(-0.) = (-0.)*0.- (-0.)=-0. - (-0.)= 0.
> (-B) - A*C
No, let A=C=0., B=-0., first gives -0., second gives 0.
> -(B + A*C)
OK
Brad