This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]