diff options
author | Tamar Christina <tamar@zhox.com> | 2019-06-01 11:20:39 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-14 09:07:44 -0400 |
commit | c0e6dee99242eff08420176a36d77b715972f1f2 (patch) | |
tree | 4899be6a2dc500f79b9f67300362ba8a702a6b7a /compiler/GHC/Builtin | |
parent | a31218f7737a65b6333ec7905e88dc094703f025 (diff) | |
download | haskell-c0e6dee99242eff08420176a36d77b715972f1f2.tar.gz |
winio: Add Atomic Exchange PrimOp and implement Atomic Ptr exchanges.
The initial version was rewritten by Tamar Christina.
It was rewritten in large parts by Andreas Klebinger.
Co-authored-by: Andreas Klebinger <klebinger.andreas@gmx.at>
Diffstat (limited to 'compiler/GHC/Builtin')
-rw-r--r-- | compiler/GHC/Builtin/primops.txt.pp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/GHC/Builtin/primops.txt.pp b/compiler/GHC/Builtin/primops.txt.pp index 859fb99ae7..ee7bdac29a 100644 --- a/compiler/GHC/Builtin/primops.txt.pp +++ b/compiler/GHC/Builtin/primops.txt.pp @@ -2473,6 +2473,18 @@ primop WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp with has_side_effects = True can_fail = True +primop InterlockedExchange_Addr "interlockedExchangeAddr#" GenPrimOp + Addr# -> Addr# -> State# s -> (# State# s, Addr# #) + {The atomic exchange operation. Atomically exchanges the value at the first address + with the Addr# given as second argument. Implies a read barrier.} + with has_side_effects = True + +primop InterlockedExchange_Int "interlockedExchangeInt#" GenPrimOp + Addr# -> Int# -> State# s -> (# State# s, Int# #) + {The atomic exchange operation. Atomically exchanges the value at the address + with the given value. Returns the old value. Implies a read barrier.} + with has_side_effects = True + ------------------------------------------------------------------------ section "Mutable variables" {Operations on MutVar\#s.} |