[GHC] #9304: Floating point woes; Different behavior on 32- vs 64-bit x86

GHC ghc-devs at haskell.org
Mon Jul 14 15:17:09 UTC 2014


#9304: Floating point woes; Different behavior on 32- vs 64-bit x86
-------------------------------------+------------------------------------
        Reporter:  lerkok            |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.8.3
      Resolution:                    |         Keywords:  floating point
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:  9276
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by rwbarton):

 Replying to [comment:26 simonpj]:
 > However I don't understand Reid's comment that "the optimiser is
 constant-folding the multiplication".  Which optimiser?

 I mean the rule
 {{{
 primOpRules nm DoubleMulOp   = mkPrimOpRule nm 2 [ binaryLit (doubleOp2
 (*)), ... ]
 }}}
 which we can see firing by compiling with `-ddump-rule-firings`:
 {{{
 ...
 Rule fired: *##
 ...
 }}}
 The constant folder represents literal Double values with Rational, but
 (unless excess precision is enabled) truncates the result of each
 operation by converting to Double and back, so it should match the answer
 obtained by using 64-bit Double throughout, as it does in this case.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9304#comment:28>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list