[LLVMbugs] [Bug 467] NEW: [X86] Spill floating point stack values in 64-bits of precision instead of 80-bits

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Dec 1 21:07:53 PST 2004


           Summary: [X86] Spill floating point stack values in 64-bits of
                    precision instead of 80-bits
           Product: libraries
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: X86 Backend
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org

One significant way that LLVM differs from GCC is how it spills values from
floating point registers on the X86.  GCC always spills FP reg values to 64-bit
stack slots, where LLVM spills to 80-bit stack slots.

The reason LLVM does this is purity: we don't want to decisions made by the
register allocator to affect the behavior of the program, so we do not want to
implicitly introduce extraneous rounding.  GCC takes the position that X86
floating point is already hopeless: many optimizations (e.g. register
promotions, store-load forwarding, etc) hopelessly modify program semantics, so
why should regsiter allocation be any different.

The reason this is suddenly meaningful is that I found out that fld m80 has a
latency of 6 cycles vs 1 cycle for 'fld m64' on the P4, and fstp m80 is 8
cycles, vs 2-3 cycles.  Apparently 80-bit ops are "only" 2x slower than 64-bit
ones on the P3.  This is an ENORMOUS difference, particularly when we can't hold
FP values in registers across basic blocks. :)


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list