Bug 1098 - [i386] inconsistent fp behavior i386 vs. most others
Summary: [i386] inconsistent fp behavior i386 vs. most others
Status: RESOLVED DUPLICATE of bug 323
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: unknown
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 9736 (view as bug list)
Depends on:
Blocks:
 
Reported: 2000-12-19 16:06 UTC by Anthony Green
Modified: 2005-06-19 12:18 UTC (History)
3 users (show)

See Also:
Host: i386-redhat-linux
Target: i386-redhat-linux
Build: i386-redhat-linux
Known to work:
Known to fail:
Last reconfirmed: 2005-06-18 01:44:50


Attachments
test.c (259 bytes, text/plain)
2003-05-21 15:17 UTC, Anthony Green
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Green 2000-12-19 16:06:00 UTC
On most systems ( alpha, mips for example ) floating
point binary operations are performed at the
highest precision of the operands.  For example,
a float * float is performed at 32 bits.  On i386,
the precision of the operands is ignored and the
operation is performed according to the current
setting of the control word.  This makes it extremely
difficult to create exact matches within programs
that use both float and double types.

A compiler option that forces operation precision
to match the highest precision of the operands
would be very helpful.

Release:
egcs-2.91.66

Environment:
i386-redhat-linux

How-To-Repeat:
On alpha or mips systems the attached test program
should produce the following output:

0x3d733334
0x3d733333


the first number is the correct 32 bit answer,
the second is the correct 64 bit answer.

on i386 the output will be:

0x3d733333
0x3d733333

I.e. the operation is performed according to the
setting of the control word.

Setting the control word to single precision will
produce the single precision answer in both cases
Comment 1 Richard Henderson 2002-03-28 23:57:19 UTC
State-Changed-From-To: open->suspended
State-Changed-Why: Yes, that would be nice.  One can get that on P4 machines with
    gcc 3.1 with -mfpmath=sse, but that's not quite the same thing.
Comment 2 Andrew Pinski 2004-04-01 19:18:54 UTC
*** Bug 9736 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Pinski 2004-07-01 03:44:02 UTC
Isn't this a dup of bug 323 really.
Comment 4 Andrew Pinski 2005-06-19 12:18:50 UTC

*** This bug has been marked as a duplicate of 323 ***