Add more primops for atomic ops on byte arrays
authorJohan Tibell <johan.tibell@gmail.com>
Mon, 9 Jun 2014 09:43:21 +0000 (11:43 +0200)
committerJohan Tibell <johan.tibell@gmail.com>
Tue, 24 Jun 2014 17:06:53 +0000 (19:06 +0200)
commitd8abf85f8ca176854e9d5d0b12371c4bc402aac3
tree9542f2b8a7ee9b9759396e4172ad5fc4ce1d2f3c
parenta4a79b5a04658ac542b1e07a6975b488fd589441
Add more primops for atomic ops on byte arrays

Summary:
Add more primops for atomic ops on byte arrays

Adds the following primops:

 * atomicReadIntArray#
 * atomicWriteIntArray#
 * fetchSubIntArray#
 * fetchOrIntArray#
 * fetchXorIntArray#
 * fetchAndIntArray#

Makes these pre-existing out-of-line primops inline:

 * fetchAddIntArray#
 * casIntArray#
23 files changed:
compiler/cmm/CmmMachOp.hs
compiler/cmm/CmmSink.hs
compiler/cmm/PprC.hs
compiler/codeGen/StgCmmPrim.hs
compiler/llvmGen/Llvm/AbsSyn.hs
compiler/llvmGen/Llvm/PpLlvm.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/nativeGen/CPrim.hs
compiler/nativeGen/PPC/CodeGen.hs
compiler/nativeGen/SPARC/CodeGen.hs
compiler/nativeGen/X86/CodeGen.hs
compiler/nativeGen/X86/Instr.hs
compiler/nativeGen/X86/Ppr.hs
compiler/prelude/primops.txt.pp
includes/stg/MiscClosures.h
libraries/ghc-prim/cbits/atomic.c [new file with mode: 0644]
libraries/ghc-prim/ghc-prim.cabal
rts/Linker.c
rts/PrimOps.cmm
testsuite/tests/concurrent/should_run/.gitignore
testsuite/tests/concurrent/should_run/AtomicPrimops.hs [new file with mode: 0644]
testsuite/tests/concurrent/should_run/AtomicPrimops.stdout [new file with mode: 0644]
testsuite/tests/concurrent/should_run/all.T