Naming, value types and tests for Addr# atomics
The atomic Exchange and CAS operations on integral types are updated to take and return more natural `Word#` rather than `Int#` values. These are bit-block not arithmetic operations, and the sign bit plays no special role. Standardises the names to `atomic<OpType><ValType>Addr#`, where `OpType` is one of `Cas` or `Exchange` and `ValType` is presently either `Word` or `Addr`. Eventually, variants for `Word32` and `Word64` can and should be added, once #11953 and related issues (e.g. #13825) are resolved. Adds tests for `Addr#` CAS that mirror existing tests for `MutableByteArray#`.
parent
51b09fe4
No related branches found
No related tags found
Pipeline #26712 failed
Stage: lint
Stage: quick-build
Stage: build
Stage: full-build
Stage: cleanup
Stage: packaging
Stage: testing
Showing
- compiler/GHC/Builtin/primops.txt.pp 33 additions, 3 deletionscompiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/StgToCmm/Prim.hs 6 additions, 1 deletioncompiler/GHC/StgToCmm/Prim.hs
- libraries/base/GHC/Ptr.hs 1 addition, 1 deletionlibraries/base/GHC/Ptr.hs
- libraries/ghc-prim/changelog.md 7 additions, 2 deletionslibraries/ghc-prim/changelog.md
- testsuite/tests/codeGen/should_compile/cg011.hs 4 additions, 4 deletionstestsuite/tests/codeGen/should_compile/cg011.hs
- testsuite/tests/codeGen/should_run/cgrun080.hs 7 additions, 8 deletionstestsuite/tests/codeGen/should_run/cgrun080.hs
- testsuite/tests/concurrent/should_run/AtomicPrimops.hs 69 additions, 11 deletionstestsuite/tests/concurrent/should_run/AtomicPrimops.hs
- testsuite/tests/concurrent/should_run/AtomicPrimops.stdout 1 addition, 0 deletionstestsuite/tests/concurrent/should_run/AtomicPrimops.stdout
Loading
-
mentioned in issue #18496 (closed)
-
mentioned in merge request !4226 (closed)
Please register or sign in to comment