To support different expectations, I suggest defining the following
floating-point options for GCC. This is a conceptual overview; once
there's a consensus the categories, I'll propose something more formal.

-ffp-correct

This option focuses code generation on mathematical correctness,
portability, and consistency. No 80-bit long doubles, no fsin/fcos,
making certain that comparison operators work within reason. Note that
this option can only go so far in ensuring portability, given that not
every system supports IEEE 754 floats.

-ffp-ieee754

To the best of our ability, assume and follow IEEE 754. Similar to the
above, but assuming IEEE floats and doubles. Note that IEEE 754 has been
undergoing some revision.

-ffp-balanced (default)

Balance correctness with speed, enabling performance optimizations that
may reduce portability or consistency, but which do not alter the
overall quality of results. Yeah, I know that's a bit fuzzy; formal
definition of such an option depends on categorizing existing FP code
generation (something I'm working on).

-ffp-damn-the-torpedoes-full-speed-ahead

Okay, maybe that should be something shorter, like -ffast-math or
-ffp-fast. This option enables dangerous hardware intrinsics, and
eschews all concerns about portability and consistency in the quest for
speed. The behavior is likely to be the same as the current -ffast-math.

Actually, I like *-ffp-damn-the-torpedoes-full-speed-ahead*. As
Stroustrup once said, if you're going to do somethimg ugly, it should
look ugly. ;)

..Scott

Reply via email to