[commit: ghc] master: Add MO_AddIntC, MO_SubIntC MachOps and implement in X86 backend (cfd08a9)

git at git.haskell.org git at git.haskell.org
Sat Aug 23 18:56:14 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/cfd08a992c91c0a9c629912a5d7234610256121e/ghc

>---------------------------------------------------------------

commit cfd08a992c91c0a9c629912a5d7234610256121e
Author: Reid Barton <rwbarton at gmail.com>
Date:   Fri Aug 22 18:57:50 2014 -0400

    Add MO_AddIntC, MO_SubIntC MachOps and implement in X86 backend
    
    Summary:
    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


>---------------------------------------------------------------

cfd08a992c91c0a9c629912a5d7234610256121e
 compiler/cmm/CmmMachOp.hs               |  2 ++
 compiler/cmm/PprC.hs                    |  2 ++
 compiler/codeGen/StgCmmPrim.hs          |  6 ++++--
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs |  2 ++
 compiler/nativeGen/PPC/CodeGen.hs       |  2 ++
 compiler/nativeGen/SPARC/CodeGen.hs     |  2 ++
 compiler/nativeGen/X86/CodeGen.hs       | 20 ++++++++++++++++++++
 compiler/nativeGen/X86/Instr.hs         |  3 +++
 compiler/nativeGen/X86/Ppr.hs           |  2 ++
 9 files changed, 39 insertions(+), 2 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cfd08a992c91c0a9c629912a5d7234610256121e


More information about the ghc-commits mailing list