This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: where to discuss problems with IEEE 754 standard on x86 architecture?
- From: Nick Maclaren <nmm1 at cus dot cam dot ac dot uk>
- To: gcc-help at gcc dot gnu dot org
- Cc: Petr Savicky <savicky at cs dot cas dot cz>
- Date: Wed, 23 May 2007 08:44:01 +0100
- Subject: Re: where to discuss problems with IEEE 754 standard on x86 architecture?
> > You were using -mfpmath=387 (possible as the default), and that uses
> > Intel native arithmetic, which is NOT standard IEEE 754 double, but
> > an extended format.
> >
> > If you use -mfpmath=sse, you will get what you expect.
>
> Thank you for your reply. This explains the problem.
>
> However, solving the problem seems to be harder.
> I tried "gcc -mfpmath=sse", but obtained the warning:
> SSE instruction set disabled, using 387 arithmetics.
I have never discovered a gcc switch to enable 'proper' IEEE 754
arithmetic. -ffloat-store does something, at the expense of slowing
down code.
There are reasons for this. IEEE 754 is a hardware specification and,
in over 20 years, has neve been supported by programming languages.
The IEEE 754 fanatics claim that it is the language and compiler
people being uncooperative, but it really is due to the fact that
the IEEE 754 standard is very unsuitable for implementing in any
high-level language I know of. It also has major numerical RAS
flaws, but that's another matter.
C99 has taken in on board, but is a complete crock, and only Sun
(and POSSIBLY some Microsoft-only compilers) support that aspect.
You should learn how to write numeric code that is independent of
the arithmetic, which will also usually make it more robust. That
is what we used to do 30+ years ago, when there was a LOT more
variation than there is today.
Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email: nmm1@cam.ac.uk
Tel.: +44 1223 334761 Fax: +44 1223 334679