Does the C standard define exactly how floating-point comparisons
should work? Sections 6.5.8 Relational operators and 6.5.9 Equality
operators in C99 doesn't spell out any details.
In particular, would it be acceptable for a GCC back end to compare
two doubles by subtracting them, converting the result to float, and
then compare the result against zero?
I don't quite remember what PDP10 doubles were like, but if you don't
have NANs, then using subtraction is probably a viable approach. You
might look at how this is implemented in the softfloat libraries. It
is probably reasonable to check the signs, check the exponents and
then as a last resort check the magnitudes. The problem with using
subtract is that you may trigger underflow exceptions or have an
undetected underflow interpreted as equality when it isn't.