[commit: ghc] master: Re-add more primops for atomic ops on byte arrays (4ee4ab0)

git at git.haskell.org git at git.haskell.org
Mon Jun 30 20:13:38 UTC 2014


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

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

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

commit 4ee4ab01c1d97845aecb7707ad2f9a80933e7a49
Author: Johan Tibell <johan.tibell at gmail.com>
Date:   Fri Jun 27 13:48:24 2014 +0200

    Re-add more primops for atomic ops on byte arrays
    
    This is the second attempt to add this functionality. The first
    attempt was reverted in 950fcae46a82569e7cd1fba1637a23b419e00ecd, due
    to register allocator failure on x86. Given how the register
    allocator currently works, we don't have enough registers on x86 to
    support cmpxchg using complicated addressing modes. Instead we fall
    back to a simpler addressing mode on x86.
    
    Adds the following primops:
    
     * atomicReadIntArray#
     * atomicWriteIntArray#
     * fetchSubIntArray#
     * fetchOrIntArray#
     * fetchXorIntArray#
     * fetchAndIntArray#
    
    Makes these pre-existing out-of-line primops inline:
    
     * fetchAddIntArray#
     * casIntArray#


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

4ee4ab01c1d97845aecb7707ad2f9a80933e7a49
 compiler/cmm/CmmMachOp.hs                          |  19 ++
 compiler/cmm/CmmSink.hs                            |   4 +
 compiler/cmm/PprC.hs                               |   4 +
 compiler/codeGen/StgCmmPrim.hs                     |  94 +++++++
 compiler/llvmGen/Llvm/AbsSyn.hs                    |   7 +
 compiler/llvmGen/Llvm/PpLlvm.hs                    |  18 +-
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs            |  71 +++--
 compiler/nativeGen/CPrim.hs                        |  50 +++-
 compiler/nativeGen/PPC/CodeGen.hs                  |   4 +
 compiler/nativeGen/SPARC/CodeGen.hs                |   4 +
 compiler/nativeGen/X86/CodeGen.hs                  | 110 ++++++++
 compiler/nativeGen/X86/Instr.hs                    |  38 ++-
 compiler/nativeGen/X86/Ppr.hs                      |   8 +
 compiler/prelude/primops.txt.pp                    |  76 ++++-
 includes/stg/MiscClosures.h                        |   1 -
 libraries/ghc-prim/cbits/atomic.c                  | 306 +++++++++++++++++++++
 libraries/ghc-prim/ghc-prim.cabal                  |   1 +
 rts/Linker.c                                       |   1 -
 rts/PrimOps.cmm                                    |  12 -
 .../tests/concurrent/should_run/AtomicPrimops.hs   | 245 +++++++++++++++++
 .../concurrent/should_run/AtomicPrimops.stdout     |   7 +
 testsuite/tests/concurrent/should_run/all.T        |   1 +
 22 files changed, 1027 insertions(+), 54 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 4ee4ab01c1d97845aecb7707ad2f9a80933e7a49


More information about the ghc-commits mailing list