This is the mail archive of the
mailing list for the GCC project.
Re: [rfc] enable non-trivial complex division
On Sat, 19 Feb 2005, Richard Henderson wrote:
> I'm not sure that I agree that other languages want the, somewhat odd,
> behaviour wrt nans and infinities. Certainly there doesn't seem to be
> anything in the C++ or Fortran standards that specify this.
> The worst part of this, IMO, being that C99 considers (+inf, nan) to
> be an infinity and not a nan. This makes no sense to me.
> Anyway, I've enabled the new library routine for C99, made everyone
> else default to the more stable inline implementation. I do add the
> new option described above for C, and for C allow -ffast-math to
> change the default to the trivial inline implementation. I don't let
> other languages change to the trivial inline implementation with
> -fast-math, because of the lack of an option to change it back.
If we are to have three different implementations then long-term I think
they should be (a) trivial, (b) logarithmic reduction to avoid undue
overflow for both multiplication and division, (c) (b) plus special nan
and infinity handling. With -fcx-limited-range being a
language-independent switch to change from (b) to (a). We don't have (b)
at present, though flag_complex_method == 1 substitutes for it. That
suggests for now having -fcx-limited-range as a language-independent flag,
included in -ffast-math for all languages, which switches from the default
of 1 (2 for C99) to 0 (and -ffast-math -fno-cx-limited-range keeping the
default of 1 or 2) with C99 only changing the default from 1 to 2; and in
future adding logarithmic reduction for both 1 and 2.
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
email@example.com (personal mail)
firstname.lastname@example.org (CodeSourcery mail)
email@example.com (Bugzilla assignments and CCs)