This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/4487: -ffast-math fails to disable gradual underflow on Ultrasparc
- To: nobody at gcc dot gnu dot org
- Subject: Re: optimization/4487: -ffast-math fails to disable gradual underflow on Ultrasparc
- From: "Tim Prince" <tprince at computer dot org>
- Date: 5 Oct 2001 23:26:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: "Tim Prince" <tprince at computer dot org>
The following reply was made to PR optimization/4487; it has been noted by GNATS.
From: "Tim Prince" <tprince@computer.org>
To: "Peter van Hoof" <vanhoof@cita.utoronto.ca>, <gcc-gnats@gcc.gnu.org>
Cc:
Subject: Re: optimization/4487: -ffast-math fails to disable gradual underflow on Ultrasparc
Date: Fri, 5 Oct 2001 16:23:43 -0700
> Ultrasparc chips do not support gradual underflow in hardware,
> and therefore these instructions need to be emulated in
software.
> Since -ffast-math allows deviations from the IEEE-754 standard
> for the sake of increasing performance, it is my opinion that
> -ffast-math should flush denormalized numbers to zero (or at
least
> there should be some option for enabling this; to the best of
my
> knowledge no such flag exists for Sparc hardware). Needless to
> say that software emulation can lead to substantial performance
> degradation for certain programs. My machine has a 500MHz
> Ultrasparc IIe processor, but I think the problem is the same
> for all v9 hardware.
Current P4 chips have a relatively slow firmware code sequence
stored on-board in ROM for processing gradual underflows.
Apparently, AMD chips have a similar but less severe problem. I
think the attitude with gcc so far has been "let the run-time
library handle it" i.e. surely there is a Sun run-time call
which sets abrupt underflow, which could be emulated on other
targets. It's a little difficult to maintain the separation of
gcc from run-time and be able to handle this, but it could likely
be done by adding a function to libgcc2 which would be invoked
when main() is built with -ffast-math, or some more specific
flag, and the architecture is one of those for which it is wanted
(e.g. -msse2 in gcc-3.1).