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#`.
Showing
- compiler/GHC/Builtin/primops.txt.pp 20 additions, 12 deletionscompiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/StgToCmm/Prim.hs 3 additions, 3 deletionscompiler/GHC/StgToCmm/Prim.hs
- libraries/base/GHC/Event/Internal.hs 1 addition, 1 deletionlibraries/base/GHC/Event/Internal.hs
- libraries/ghc-prim/changelog.md 8 additions, 3 deletionslibraries/ghc-prim/changelog.md
- testsuite/tests/codeGen/should_compile/cg011.hs 3 additions, 3 deletionstestsuite/tests/codeGen/should_compile/cg011.hs
- testsuite/tests/codeGen/should_run/cas_int.hs 11 additions, 11 deletionstestsuite/tests/codeGen/should_run/cas_int.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
Please register or sign in to comment