summaryrefslogtreecommitdiff
path: root/rts/PrimOps.cmm
diff options
context:
space:
mode:
authorRyan Newton <rrnewton@gmail.com>2013-08-02 13:25:15 -0400
committerRyan Newton <rrnewton@gmail.com>2013-08-21 00:02:30 -0400
commit4b4c944b8b7b9f98a2bbd35c7b6811a9cdb847ee (patch)
tree0260759e1ed69f4e65db29a0c7e9018de460e3a0 /rts/PrimOps.cmm
parent1c45d05d1a4808767fd921988495346f22290e23 (diff)
downloadhaskell-4b4c944b8b7b9f98a2bbd35c7b6811a9cdb847ee.tar.gz
Update stg_casArrayzh to conform to new CMM conventions.
Diffstat (limited to 'rts/PrimOps.cmm')
-rw-r--r--rts/PrimOps.cmm15
1 files changed, 6 insertions, 9 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm
index b13e05ce87..710330714e 100644
--- a/rts/PrimOps.cmm
+++ b/rts/PrimOps.cmm
@@ -206,28 +206,25 @@ stg_unsafeThawArrayzh ( gcptr arr )
}
}
-stg_casArrayzh
+stg_casArrayzh ( gcptr arr, W_ ind, gcptr old, gcptr new )
/* MutableArray# s a -> Int# -> a -> a -> State# s -> (# State# s, Int#, a #) */
{
- W_ arr, p, ind, old, new, h, len;
- arr = R1; // anything else?
- ind = R2;
- old = R3;
- new = R4;
+ gcptr p, h;
+ W_ len;
p = arr + SIZEOF_StgMutArrPtrs + WDS(ind);
- (h) = foreign "C" cas(p, old, new) [];
+ (h) = ccall cas(p, old, new);
if (h != old) {
// Failure, return what was there instead of 'old':
- RET_NP(1,h);
+ return (1,h);
} else {
// Compare and Swap Succeeded:
SET_HDR(arr, stg_MUT_ARR_PTRS_DIRTY_info, CCCS);
len = StgMutArrPtrs_ptrs(arr);
// The write barrier. We must write a byte into the mark table:
I8[arr + SIZEOF_StgMutArrPtrs + WDS(len) + (ind >> MUT_ARR_PTRS_CARD_BITS )] = 1;
- RET_NP(0,h);
+ return (0,h);
}
}