summaryrefslogtreecommitdiff
path: root/rts/PrimOps.cmm
diff options
context:
space:
mode:
authorJohan Tibell <johan.tibell@gmail.com>2014-06-26 14:31:37 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2014-06-26 14:58:45 +0200
commit950fcae46a82569e7cd1fba1637a23b419e00ecd (patch)
treec0cfda4ad4fb473c588d517e89ae2b47598457fd /rts/PrimOps.cmm
parent84d7845063c974a9437a29f4f0b5094392d04a29 (diff)
downloadhaskell-950fcae46a82569e7cd1fba1637a23b419e00ecd.tar.gz
Revert "Add more primops for atomic ops on byte arrays"
This commit caused the register allocator to fail on i386. This reverts commit d8abf85f8ca176854e9d5d0b12371c4bc402aac3 and 04dd7cb3423f1940242fdfe2ea2e3b8abd68a177 (the second being a fix to the first).
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r--rts/PrimOps.cmm12
1 files changed, 12 insertions, 0 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index 5f04a6d732..4d7baca824 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -151,6 +151,18 @@ stg_casIntArrayzh( gcptr arr, W_ ind, W_ old, W_ new )
}
+stg_fetchAddIntArrayzh( gcptr arr, W_ ind, W_ incr )
+/* MutableByteArray# s -> Int# -> Int# -> State# s -> (# State# s, Int# #) */
+{
+ W_ p, h;
+
+ p = arr + SIZEOF_StgArrWords + WDS(ind);
+ (h) = ccall atomic_inc(p, incr);
+
+ return(h);
+}
+
+
stg_newArrayzh ( W_ n /* words */, gcptr init )
{
W_ words, size, p;