summaryrefslogtreecommitdiff
path: root/rts/include
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2023-03-15 20:50:38 -0400
committerBen Gamari <ben@smart-cactus.org>2023-05-09 08:41:53 -0400
commit81cfefd2cfb9d97a19d8e543130f94248e667330 (patch)
treef2b2bc724572fbcaca8c5370c38214f7a5aeb649 /rts/include
parentb970e64fb2dd6d65e6e14a7e57bbc0e2eef663a7 (diff)
downloadhaskell-81cfefd2cfb9d97a19d8e543130f94248e667330.tar.gz
compiler: Implement atomicSwapIORef with xchg
As requested by @treeowl in CLC#139.
Diffstat (limited to 'rts/include')
-rw-r--r--rts/include/Cmm.h2
-rw-r--r--rts/include/stg/MiscClosures.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/rts/include/Cmm.h b/rts/include/Cmm.h
index 15df6d0df1..a1cf44c31b 100644
--- a/rts/include/Cmm.h
+++ b/rts/include/Cmm.h
@@ -193,8 +193,10 @@
#if SIZEOF_W == 4
#define cmpxchgW cmpxchg32
+#define xchgW xchg32
#elif SIZEOF_W == 8
#define cmpxchgW cmpxchg64
+#define xchgW xchg64
#endif
/* -----------------------------------------------------------------------------
diff --git a/rts/include/stg/MiscClosures.h b/rts/include/stg/MiscClosures.h
index 8e50336e4a..da556870f1 100644
--- a/rts/include/stg/MiscClosures.h
+++ b/rts/include/stg/MiscClosures.h
@@ -481,6 +481,7 @@ RTS_FUN_DECL(stg_copySmallMutableArrayzh);
RTS_FUN_DECL(stg_casSmallArrayzh);
RTS_FUN_DECL(stg_newMutVarzh);
+RTS_FUN_DECL(stg_atomicSwapMutVarzh);
RTS_FUN_DECL(stg_atomicModifyMutVar2zh);
RTS_FUN_DECL(stg_atomicModifyMutVarzuzh);
RTS_FUN_DECL(stg_casMutVarzh);