[commit: ghc] master: Add more primops for atomic ops on byte arrays (d8abf85)

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Wed Jun 25 05:26:28 UTC 2014


On 06/24/2014 07:47 PM, git at git.haskell.org wrote:
> Repository : ssh://git@git.haskell.org/ghc
> 
> On branch  : master
> Link       : http://ghc.haskell.org/trac/ghc/changeset/d8abf85f8ca176854e9d5d0b12371c4bc402aac3/ghc
> 
>> ---------------------------------------------------------------
> 
> commit d8abf85f8ca176854e9d5d0b12371c4bc402aac3
> Author: Johan Tibell <johan.tibell at gmail.com>
> Date:   Mon Jun 9 11:43:21 2014 +0200
> 
>     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#
> 
> 
>> ---------------------------------------------------------------
> 
> d8abf85f8ca176854e9d5d0b12371c4bc402aac3
>  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                  |  92 +++++++
>  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                  | 280 +++++++++++++++++++++
>  libraries/ghc-prim/ghc-prim.cabal                  |   1 +
>  rts/Linker.c                                       |   1 -
>  rts/PrimOps.cmm                                    |  12 -
>  testsuite/tests/concurrent/should_run/.gitignore   |   1 +
>  .../tests/concurrent/should_run/AtomicPrimops.hs   | 245 ++++++++++++++++++
>  .../concurrent/should_run/AtomicPrimops.stdout     |   7 +
>  testsuite/tests/concurrent/should_run/all.T        |   1 +
>  23 files changed, 984 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 d8abf85f8ca176854e9d5d0b12371c4bc402aac3
> _______________________________________________
> ghc-commits mailing list
> ghc-commits at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-commits
> 

I think the above killed compilation on 32-bit boxes. See the
usually-green boxes turn red at [1], specifically
validator1-linux-x86-head, freebsd-i386-head and solaris-x86-head. The
error looks like:

"inplace/bin/ghc-stage1" -hisuf hi -osuf  o -hcsuf hc -static  -H32m -O
   -package-name ghc-prim-0.3.1.0 -hide-all-packages -i
-ilibraries/ghc-prim/. -ilibraries/ghc-prim/dist-install/build
-ilibraries/ghc-prim/dist-install/build/autogen
-Ilibraries/ghc-prim/dist-install/build
-Ilibraries/ghc-prim/dist-install/build/autogen -Ilibraries/ghc-prim/.
  -optP-include
-optPlibraries/ghc-prim/dist-install/build/autogen/cabal_macros.h
-package rts-1.0 -package-name ghc-prim -XHaskell2010 -O2
-no-user-package-db -rtsopts      -odir
libraries/ghc-prim/dist-install/build -hidir
libraries/ghc-prim/dist-install/build -stubdir
libraries/ghc-prim/dist-install/build -split-objs -dynamic-too -c
libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs -o
libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.o -dyno
libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.dyn_o
ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 7.9.20140624 for i386-unknown-linux):
	RegAllocLinear.allocRegsAndSpill: no spill candidates
    allocating vreg:  VirtualRegI n1Q6
    assignment:       [(c1PV,InMem 2),(n1Q5,InBoth (RealRegSingle 3)
0),(n1Q6,InMem 1),(n1Q7,InMem 3),(n1Q9,InReg (RealRegSingle 2))]
    freeRegs:         FreeRegs 4282318848
    initFreeRegs:     FreeRegs 4282318861
Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
make[1]: ***
[libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.o] Error 1

It'd be great if the devs would look at [1] every day or so.

[1]: http://haskell.inf.elte.hu/builders/

-- 
Mateusz K.


More information about the ghc-devs mailing list