First Last Prev Next    No search results available
Details
: [x86] X86 backend code generates -0.0 as +0.0
Bug#: 219
: libraries
: Backend: X86
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: normal
: 1.2

:
: miscompilation
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Chris Lattner <sabre@nondot.org>
Assigned To: Chris Lattner <sabre@nondot.org>

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2004-02-02 13:01
Testcase here:
test/Programs/SingleSource/UnitTests/2004-02-02-NegativeZero.c
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040202/011067.html

The problem is that the X86 backend emits the fldz instruction to produce a -0.0
value, but fldz pushes +0.0 on the stack!

-Chris
------- Comment #1 From Chris Lattner 2004-02-02 13:35:14 -------
This patch fixes the bug (do not trust == to compare FP values!):
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040202/011066.html

While I was at it, I also added this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040202/011074.html

which causes the X86 code generator to generate the 'fchs' instruction to negate
FP numbers efficiently.

-Chris

First Last Prev Next    No search results available