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)


> 
> All right, so I need to generate additional FMA patterns by modifying 
> combine.
> Our FP expert says all the required transformations are IEEE-compliant.
> Before I get too far into it, does anybody want to dispute this?  Here are
> the patterns.  The claim is that each of them can be transformed safely
> into the first one in its group.
> 
> fmadd:
>      A*C + B
>      B + A*C
> fnmsub:
>      -(A*C - B)
>      ((-A)*C) + B
>      -((-B) + A*C)
>      B - A*C
> fmsub:
>      A*C -B
>      -B + A*C
>      -(B - A*C)
>      -((-A)*C + B)
> fnmadd:
>      -(A*C + B)
>      ((-A)*C) -B
>      (-B) - A*C
>      -(B + A*C)

Maybe I'm being too pedantic, but is this the right place
to do this transformation?

For example, if you have:

B - A * C
B - A * D

then combine will convert these to:

-(A * C - B)
-(A * D - B)

but since CSE has already run, the negation of B will
occur twice...or is this already handled somehow?

Toshi


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