IEEE 754 and fused-madd (was: Re: patch: rs6000 specific)

David Edelsohn dje@watson.ibm.com
Thu Dec 6 18:52:00 GMT 2001


>>>>> Brad Lucier writes:

>> Any transformations to utilize FMA which are allowed by GCC
>> with the -ffath-math option are not allowed by default.

Brad> How about: Transformations that do not change the results of IEEE 754
Brad> arithmetic are allowed by default (presumably, some of these could help
Brad> the MD file to recognize opportunities for FMA use); transformations that
Brad> can possibly change the results of IEEE 754 arithmetic are not allowed by
Brad> default (even when FMA is allowed), but are allowed with
Brad> -funsafe-math-optimizations.

>> Only expressions
>> matching the various FMA instructions can be in the PowerPC MD.

Brad> This is the part of the discussion I don't understand; perhaps I don't
Brad> have to understand, or I might understand if given some examples.

	If there are transformations (either safe or unsafe) which are not
applied even with -ffast-math, I definitely would support adding them.
However, my belief is that they should be included as part of the rest of
the target-independent transformations that GCC tries (bracketed by
unsafe_math_optimizations, as appropriate) instead of in the MD file.

	The MD file describes the canonical form of the instructions.  GCC
has rules about the canonical form of RTL.  If there are any mathetmatical
transformations to be done when trying to match the canonical form of the
instruction, GCC should be doing that in the common part of the compiler,
not by creating that redundancy in the MD file which complicates port
maintenance.

David



More information about the Gcc-patches mailing list