1. 28 Aug, 2014 24 commits
  2. 27 Aug, 2014 2 commits
  3. 26 Aug, 2014 1 commit
    • Sergei Trofimovich's avatar
      UNREG: fix emission of large Integer literals in C codegen · 43f1b2ec
      Sergei Trofimovich authored
      On amd64/UNREG build there is many failing tests trying
      to deal with 'Integer' types.
      Looking at 'integerConversions' test I've observed
      invalid C code generated by GHC.
      Cmm code
          CInt a = -1; (a == -1)
      yields 'False' with optimisations enabled via the following C code:
          StgWord64 a = (StgWord32)0xFFFFffffFFFFffffu; (a == 0xFFFFffffFFFFffffu)
      The patch fixes it by shrinking emitted literals to required sizes:
          StgWord64 a = (StgWord32)0xFFFFffffu; (a == 0xFFFFffffu)
      Thanks to Reid Barton for tracking down and fixing the issue.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      Test Plan: validate on UNREG build (amd64, x86)
      Reviewers: simonmar, rwbarton, austin
      Subscribers: hvr, simonmar, ezyang, carter
      Differential Revision: https://phabricator.haskell.org/D173
  4. 25 Aug, 2014 10 commits
  5. 24 Aug, 2014 1 commit
  6. 23 Aug, 2014 2 commits
    • rwbarton's avatar
      Add MO_AddIntC, MO_SubIntC MachOps and implement in X86 backend · cfd08a99
      rwbarton authored
      These MachOps are used by addIntC# and subIntC#, which in turn are
      used in integer-gmp when adding or subtracting small Integers. The
      following benchmark shows a ~6% speedup after this commit on x86_64
      (building GHC with BuildFlavour=perf).
          {-# LANGUAGE MagicHash #-}
          import GHC.Exts
          import Criterion.Main
          count :: Int -> Integer
          count (I# n#) = go n# 0
            where go :: Int# -> Integer -> Integer
                  go 0# acc = acc
                  go n# acc = go (n# -# 1#) $! acc + 1
          main = defaultMain [bgroup "count"
                                [bench "100" $ whnf count 100]]
      Differential Revision: https://phabricator.haskell.org/D140
    • Sergei Trofimovich's avatar
      rts/Linker.c: declare 'deRefStablePtr' as an exported 'rts' symbol · 104a66a4
      Sergei Trofimovich authored
          $ inplace/bin/ghc-stage2 -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -optc-fno-builtin -fno-ghci-history \
              testsuite/tests/ffi/should_run/T4038.hs --interactive -v0 -ignore-dot-ghci +RTS -I0.1 -RTS
          *Main> main
          <interactive>: /tmp/ghc16668_0/ghc16668_5.o: unknown symbol `deRefStablePtr'
      The reference to 'deRefStablePtr' is generated by 'compiler/deSugar/DsForeign.lhs':
             = case maybe_target of
                Nothing    -> text "(StgClosure*)deRefStablePtr(the_stableptr)"
                Just hs_fn -> char '&' <> ppr hs_fn <> text "_closure"
      Patch fixes all broken tests using 'import wrapper':
          TEST="ffi013 ffi010 ffi011 ffi005 ffi020 ffi006 ffi019 fed001 T1679 T4038"
      Tests manifested as broken only in DYNAMIC_GHC_PROGRAMS=NO builds,
      where GHCi's custom linker is used instead of system's linker.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>