Edit AtomicPrimops authored by tibbe's avatar tibbe
...@@ -10,11 +10,11 @@ The new primops are modeled after those provided by C11, C++11, GCC, and LLVM. ...@@ -10,11 +10,11 @@ The new primops are modeled after those provided by C11, C++11, GCC, and LLVM.
``` ```
atomicReadIntArray#::MutableByteArray# s ->Int#->State# s ->(#State# s,Int##)atomicWriteIntArray#::MutableByteArray# s ->Int#->Int#->State# s ->State# s atomicReadIntArray#::MutableByteArray# s ->Int#->State# s ->(#State# s,Int##)atomicWriteIntArray#::MutableByteArray# s ->Int#->Int#->State# s ->State# s
atomicFetchAddIntArray#::MutableByteArray#-- Array to modify->Int#-- Index, in words->Int#-- Amount to add->State# s fetchAddIntArray#::MutableByteArray#-- Array to modify->Int#-- Index, in words->Int#-- Amount to add->State# s
->(#State# s,Int##)-- Value held previouslyatomicFetchSubIntArray#::MutableByteArray#->Int#->Int#->State# s ->(#State# s,Int##)atomicFetchOrIntArray#::MutableByteArray#->Int#->Int#->State# s ->(#State# s,Int##)atomicFetchXorIntArray#::MutableByteArray#->Int#->Int#->State# s ->(#State# s,Int##)atomicFetchAndIntArray#::MutableByteArray#->Int#->Int#->State# s ->(#State# s,Int##)casIntArray#::MutableByteArray# s ->Int#->Int#->Int#->State# s ->(#State# s,Int##) ->(#State# s,Int##)-- Value held previouslyfetchSubIntArray#::MutableByteArray#->Int#->Int#->State# s ->(#State# s,Int##)fetchOrIntArray#::MutableByteArray#->Int#->Int#->State# s ->(#State# s,Int##)fetchXorIntArray#::MutableByteArray#->Int#->Int#->State# s ->(#State# s,Int##)fetchAndIntArray#::MutableByteArray#->Int#->Int#->State# s ->(#State# s,Int##)casIntArray#::MutableByteArray# s ->Int#->Int#->Int#->State# s ->(#State# s,Int##)
``` ```
`atomicFetchAddIntArray#` and `casIntArray#` already exist (but are implemented as out-of-line primops.) `fetchAddIntArray#` and `casIntArray#` already exist (but are implemented as out-of-line primops.)
## Implementation ## Implementation
... ...
......