Changes between Initial Version and Version 2 of Ticket #8195


Ignore:
Timestamp:
Aug 29, 2013 1:11:49 PM (2 years ago)
Author:
jstolarek
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8195 – Description

    initial v2  
    1 I noticed strange behaviour of `Conversions` test on 32bit machines. Here's the code of this test:
     1I noticed strange behaviour of `Conversions` test on 32bit machines. Here's a slightly reduced version of that test:
    22
    33{{{
     
    1111
    1212-- Repeatedly convert Words to Doubles
    13 loop :: Floating a => Word -> a
     13loop :: Word -> Float
    1414loop n = go 0 0.0
    1515  where
    1616    go i !acc | i < n = go (i+1) (acc + fromIntegral i)
    1717              | otherwise = acc
    18 {-# SPECIALISE loop :: Word -> Float #-}
    19 {-# SPECIALISE loop :: Word -> Double #-}
    2018
    2119main :: IO ()
    2220main = do
    2321    print (loop 1000000 :: Float)
    24     print (loop 1000000 :: Double)
    2522}}}
    2623This test is expected to produce:
     
    3128[t-jastol@cam-05-unx : /5playpen/t-jastol/ghc-validate] ./testsuite/tests/perf/should_run/Conversions
    32294.9994036e11
    33 4.999995e11
    3430}}}
    35 My optimization of self-recursive tail loops (d61c3ac186c94021c851f7a2a6d20631e35fc1ba) broke that and now both `Float` and `Double` results are identical:
     31My optimization of self-recursive tail loops (d61c3ac186c94021c851f7a2a6d20631e35fc1ba) change results of that program to be slightly different:
    3632{{{
    37 4.999995e11
    38334.999995e11
    3934}}}
     
    4338{{{
    44394.9994036e11
    45 4.999995e11
    4640}}}
    4741I'm not sure if we should get different results for different instruction sets. I'm putting it up as a ticket so perhaps we could investigate this more one day if we consider it relevant.