[Git][ghc/ghc][master] Add unaligned Addr# primops

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sun Jan 7 04:03:44 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
eaf72479 by brian at 2024-01-06T23:03:09-05:00
Add unaligned Addr# primops

Implements CLC proposal #154:
  https://github.com/haskell/core-libraries-committee/issues/154

* add unaligned addr primops

* add tests

* accept tests

* add documentation

* fix js primops

* uncomment in access ops

* use Word64 in tests

* apply suggestions

* remove extra file

* move docs

* remove random options

* use setByteArray# primop

* better naming

* update base-exports test

* add base-exports for other architectures

- - - - -


12 changed files:

- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToJS/Prim.hs
- docs/users_guide/9.10.1-notes.rst
- libraries/ghc-prim/changelog.md
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- + testsuite/tests/primops/should_run/UnalignedAddrPrimOps.hs
- + testsuite/tests/primops/should_run/UnalignedAddrPrimOps.stdout
- testsuite/tests/primops/should_run/all.T
- utils/genprimopcode/AccessOps.hs


Changes:

=====================================
compiler/GHC/StgToCmm/Prim.hs
=====================================
@@ -471,6 +471,98 @@ emitPrimOp cfg primop =
   ReadOffAddrOp_Word64 -> \args -> opIntoRegs $ \res ->
     doIndexOffAddrOp   Nothing b64 res args
 
+-- IndexWord8OffAddrAsXXX
+
+  IndexOffAddrOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   (Just (mo_u_8ToWord platform)) b8 b8 res args
+  IndexOffAddrOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   (Just (mo_u_32ToWord platform)) b32 b8 res args
+  IndexOffAddrOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing (bWord platform) b8 res args
+  IndexOffAddrOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing (bWord platform) b8 res args
+  IndexOffAddrOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing (bWord platform) b8 res args
+  IndexOffAddrOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing f32 b8 res args
+  IndexOffAddrOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing f64 b8 res args
+  IndexOffAddrOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing (bWord platform) b8 res args
+  IndexOffAddrOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b16 b8 res args
+  IndexOffAddrOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b32 b8 res args
+  IndexOffAddrOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b64 b8 res args
+  IndexOffAddrOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b16 b8 res args
+  IndexOffAddrOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b32 b8 res args
+  IndexOffAddrOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b64 b8 res args
+
+-- ReadWord8OffAddrAsXXX, identical to IndexWord8OffAddrAsXXX
+
+  ReadOffAddrOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   (Just (mo_u_8ToWord platform)) b8 b8 res args
+  ReadOffAddrOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   (Just (mo_u_32ToWord platform)) b32 b8 res args
+  ReadOffAddrOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing (bWord platform) b8 res args
+  ReadOffAddrOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing (bWord platform) b8 res args
+  ReadOffAddrOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing (bWord platform) b8 res args
+  ReadOffAddrOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing f32 b8 res args
+  ReadOffAddrOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing f64 b8 res args
+  ReadOffAddrOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing (bWord platform) b8 res args
+  ReadOffAddrOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b16 b8 res args
+  ReadOffAddrOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b32 b8 res args
+  ReadOffAddrOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b64 b8 res args
+  ReadOffAddrOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b16 b8 res args
+  ReadOffAddrOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b32 b8 res args
+  ReadOffAddrOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
+    doIndexOffAddrOpAs   Nothing b64 b8 res args
+
+-- WriteWord8ArrayAsXXX
+  WriteOffAddrOp_Word8AsChar -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp (Just (mo_WordTo8 platform))  b8 res args
+  WriteOffAddrOp_Word8AsWideChar -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp (Just (mo_WordTo32 platform)) b8 res args
+  WriteOffAddrOp_Word8AsInt -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsWord -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsAddr -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsFloat -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsDouble -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsStablePtr -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsInt16 -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsInt32 -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsInt64 -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsWord16 -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsWord32 -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+  WriteOffAddrOp_Word8AsWord64 -> \args -> opIntoRegs $ \res ->
+    doWriteOffAddrOp Nothing b8 res args
+
 -- IndexXXXArray
 
   IndexByteArrayOp_Char -> \args -> opIntoRegs $ \res ->


=====================================
compiler/GHC/StgToJS/Prim.hs
=====================================
@@ -832,6 +832,51 @@ genPrim prof bound ty op = case op of
   WriteOffAddrOp_Word32    -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_u32 a (off32 o i) v
   WriteOffAddrOp_Word64    -> \[] [a,o,i,h,l]   -> pure $ PrimInline $ write_boff_u64 a (off64 o i) h l
 
+  IndexOffAddrOp_Word8AsChar      -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_u8  a (off8  o i)
+  IndexOffAddrOp_Word8AsWideChar  -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_i32 a (off8 o i)
+  IndexOffAddrOp_Word8AsInt       -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_i32 a (off8 o i)
+  IndexOffAddrOp_Word8AsWord      -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_u32 a (off8 o i)
+  IndexOffAddrOp_Word8AsAddr      -> \[ra,ro] [a,o,i] -> pure $ PrimInline $ read_boff_addr a (off8 o i) ra ro
+  IndexOffAddrOp_Word8AsFloat     -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_f32 a (off8 o i)
+  IndexOffAddrOp_Word8AsDouble    -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_f64 a (off8 o i)
+  IndexOffAddrOp_Word8AsStablePtr -> \[ra,ro] [a,o,i] -> pure $ PrimInline $ read_boff_stableptr a (off8 o i) ra ro
+  IndexOffAddrOp_Word8AsInt16     -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_i16 a (off8 o i)
+  IndexOffAddrOp_Word8AsInt32     -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_i32 a (off8 o i)
+  IndexOffAddrOp_Word8AsInt64     -> \[h,l]   [a,o,i] -> pure $ PrimInline $ read_boff_i64 a (off8 o i) h l
+  IndexOffAddrOp_Word8AsWord16    -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_u16 a (off8 o i)
+  IndexOffAddrOp_Word8AsWord32    -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_u32 a (off8 o i)
+  IndexOffAddrOp_Word8AsWord64    -> \[h,l]   [a,o,i] -> pure $ PrimInline $ read_boff_u64 a (off8 o i) h l
+
+  ReadOffAddrOp_Word8AsChar       -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_u8  a (off8  o i)
+  ReadOffAddrOp_Word8AsWideChar   -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_i32 a (off8 o i)
+  ReadOffAddrOp_Word8AsInt        -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_i32 a (off8 o i)
+  ReadOffAddrOp_Word8AsWord       -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_u32 a (off8 o i)
+  ReadOffAddrOp_Word8AsAddr       -> \[ra,ro] [a,o,i] -> pure $ PrimInline $ read_boff_addr a (off8 o i) ra ro
+  ReadOffAddrOp_Word8AsFloat      -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_f32 a (off8 o i)
+  ReadOffAddrOp_Word8AsDouble     -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_f64 a (off8 o i)
+  ReadOffAddrOp_Word8AsStablePtr  -> \[ra,ro] [a,o,i] -> pure $ PrimInline $ read_boff_stableptr a (off8 o i) ra ro
+  ReadOffAddrOp_Word8AsInt16      -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_i16 a (off8 o i)
+  ReadOffAddrOp_Word8AsInt32      -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_i32 a (off8 o i)
+  ReadOffAddrOp_Word8AsInt64      -> \[h,l]   [a,o,i] -> pure $ PrimInline $ read_boff_i64 a (off8 o i) h l
+  ReadOffAddrOp_Word8AsWord16     -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_u16 a (off8 o i)
+  ReadOffAddrOp_Word8AsWord32     -> \[r]     [a,o,i] -> pure $ PrimInline $ r |= read_boff_u32 a (off8 o i)
+  ReadOffAddrOp_Word8AsWord64     -> \[h,l]   [a,o,i] -> pure $ PrimInline $ read_boff_u64 a (off8 o i) h l
+
+  WriteOffAddrOp_Word8AsChar      -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_u8  a (off8  o i) v
+  WriteOffAddrOp_Word8AsWideChar  -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_i32 a (off8 o i) v
+  WriteOffAddrOp_Word8AsInt       -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_i32 a (off8 o i) v
+  WriteOffAddrOp_Word8AsWord      -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_u32 a (off8 o i) v
+  WriteOffAddrOp_Word8AsAddr      -> \[] [a,o,i,va,vo] -> pure $ PrimInline $ write_boff_addr a (off8 o i) va vo
+  WriteOffAddrOp_Word8AsFloat     -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_f32 a (off8 o i) v
+  WriteOffAddrOp_Word8AsDouble    -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_f64 a (off8 o i) v
+  WriteOffAddrOp_Word8AsStablePtr -> \[] [a,o,i,va,vo] -> pure $ PrimInline $ write_boff_stableptr a (off8 o i) va vo
+  WriteOffAddrOp_Word8AsInt16     -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_i16 a (off8 o i) v
+  WriteOffAddrOp_Word8AsInt32     -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_i32 a (off8 o i) v
+  WriteOffAddrOp_Word8AsInt64     -> \[] [a,o,i,h,l]   -> pure $ PrimInline $ write_boff_i64 a (off8 o i) h l
+  WriteOffAddrOp_Word8AsWord16    -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_u16 a (off8 o i) v
+  WriteOffAddrOp_Word8AsWord32    -> \[] [a,o,i,v]     -> pure $ PrimInline $ write_boff_u32 a (off8 o i) v
+  WriteOffAddrOp_Word8AsWord64    -> \[] [a,o,i,h,l]   -> pure $ PrimInline $ write_boff_u64 a (off8 o i) h l
+
 ------------------------------- Mutable variables --------------------------------------
   NewMutVarOp           -> \[r] [x]       -> pure $ PrimInline $ r |= New (app "h$MutVar" [x])
   ReadMutVarOp          -> \[r] [m]       -> pure $ PrimInline $ r |= m .^ "val"


=====================================
docs/users_guide/9.10.1-notes.rst
=====================================
@@ -169,6 +169,29 @@ Runtime system
   exported by ``GHC.Exts``, but with a different type, as described in
   the notes for ``base`` above.
 
+- New primops for unaligned ``Addr#`` access.
+  These primops will be emulated on platforms that don't support unaligned access.
+  These primops take the form
+
+  .. code-block:: haskell
+
+     indexWord8OffAddrAs<ty> :: Addr# -> Int# -> <ty>#
+     readWord8OffAddrAs<ty> :: Addr# -> Int# -> State# s -> (# State# s, <ty># #)
+     writeWord8OffAddrAs<ty> :: Addr# -> Int# -> <ty># -> State# s -> State# s
+
+  where ``<ty>`` is one of:
+
+  - ``Word``
+  - ``Word{16,32,64}``
+  - ``Int``
+  - ``Int{16,32,64,}``
+  - ``Char``
+  - ``WideChar``
+  - ``Addr``
+  - ``Float``
+  - ``Double``
+  - ``StablePtr``
+
 ``ghc`` library
 ~~~~~~~~~~~~~~~
 


=====================================
libraries/ghc-prim/changelog.md
=====================================
@@ -2,6 +2,54 @@
 
 - Shipped with GHC 9.10.1
 
+- Add unaligned addr access primops. These primops will be emulated on platforms that don't support unaligned access.
+
+         readWord8OffAddrAsChar# :: Addr# -> Int# -> State# s -> (# State# s, Char# #)
+         readWord8OffAddrAsAddr# :: Addr# -> Int# -> State# s -> (# State# s, Addr# #)
+         readWord8OffAddrAsFloat# :: Addr# -> Int# -> State# s -> (# State# s, Float# #)
+         readWord8OffAddrAsDouble# :: Addr# -> Int# -> State# s -> (# State# s, Double# #)
+         readWord8OffAddrAsStablePtr# :: Addr# -> Int# -> State# s -> (# State# s, StablePtr# #)
+         readWord8OffAddrAsInt16# :: Addr# -> Int# -> State# s -> (# State# s, Int16# #)
+         readWord8OffAddrAsInt32# :: Addr# -> Int# -> State# s -> (# State# s, Int32# #)
+         readWord8OffAddrAsInt64# :: Addr# -> Int# -> State# s -> (# State# s, Int64# #)
+         readWord8OffAddrAsInt# :: Addr# -> Int# -> State# s -> (# State# s, Int# #)
+
+         readWord8OffAddrAsWord16# :: Addr# -> Int# -> State# s -> (# State# s, Word16# #)
+         readWord8OffAddrAsWord32# :: Addr# -> Int# -> State# s -> (# State# s, Word32# #)
+         readWord8OffAddrAsWord64# :: Addr# -> Int# -> State# s -> (# State# s, Word64# #)
+         readWord8OffAddrAsWord# :: Addr# -> Int# -> State# s -> (# State# s, Word# #)
+
+         indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+         indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+         indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+         indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+         indexWord8OffAddrAsStablePtr# :: Addr# -> Int# -> StablePtr#
+         indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+         indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+         indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+         indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+
+         indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+         indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+         indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
+         indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+
+         writeWord8OffAddrAsChar# :: Addr# -> Int# -> Char# -> State# s -> State# s
+         writeWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr# -> State# s -> State# s
+         writeWord8OffAddrAsFloat# :: Addr# -> Int# -> Float# -> State# s -> State# s
+         writeWord8OffAddrAsDouble# :: Addr# -> Int# -> Double# -> State# s -> State# s
+         writeWord8OffAddrAsStablePtr# :: Addr# -> Int# -> StablePtr# -> State# s -> State# s
+
+         writeWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16# -> State# s -> State# s
+         writeWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32# -> State# s -> State# s
+         writeWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64# -> State# s -> State# s
+         writeWord8OffAddrAsInt# :: Addr# -> Int# -> Int# -> State# s -> State# s
+
+         writeWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16# -> State# s -> State# s
+         writeWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32# -> State# s -> State# s
+         writeWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64# -> State# s -> State# s
+         writeWord8OffAddrAsWord# :: Addr# -> Int# -> Word# -> State# s -> State# s
+
 - The `unsafeThawByteArray#` primop was added, serving as a inverse to the existing
   `unsafeFreezeByteArray#` primop (see #22710).
 


=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -3883,6 +3883,20 @@ module GHC.Base where
   indexWord8ArrayAsWord8X32# :: ByteArray# -> Int# -> Word8X32#
   indexWord8ArrayAsWord8X64# :: ByteArray# -> Int# -> Word8X64#
   indexWord8OffAddr# :: Addr# -> Int# -> Word8#
+  indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+  indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+  indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+  indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+  indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+  indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+  indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+  indexWord8OffAddrAsStablePtr# :: forall a. Addr# -> Int# -> StablePtr# a
+  indexWord8OffAddrAsWideChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+  indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+  indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+  indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
   indexWord8OffAddrAsWord8X16# :: Addr# -> Int# -> Word8X16#
   indexWord8OffAddrAsWord8X32# :: Addr# -> Int# -> Word8X32#
   indexWord8OffAddrAsWord8X64# :: Addr# -> Int# -> Word8X64#
@@ -4443,6 +4457,20 @@ module GHC.Base where
   readWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X64# #)
   readWord8OffAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8# #)
+  readWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Addr# #)
+  readWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
+  readWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Float# #)
+  readWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int# #)
+  readWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int16# #)
+  readWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int32# #)
+  readWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int64# #)
+  readWord8OffAddrAsStablePtr# :: forall d a. Addr# -> Int# -> State# d -> (# State# d, StablePtr# a #)
+  readWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word# #)
+  readWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word16# #)
+  readWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word32# #)
+  readWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word64# #)
   readWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X16# #)
   readWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X64# #)
@@ -4860,6 +4888,20 @@ module GHC.Base where
   writeWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> Word8X64# -> State# d -> State# d
   writeWord8OffAddr# :: forall d. Addr# -> Int# -> Word8# -> State# d -> State# d
+  writeWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> Addr# -> State# d -> State# d
+  writeWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> Double# -> State# d -> State# d
+  writeWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> Float# -> State# d -> State# d
+  writeWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> Int# -> State# d -> State# d
+  writeWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> Int16# -> State# d -> State# d
+  writeWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> Int32# -> State# d -> State# d
+  writeWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> Int64# -> State# d -> State# d
+  writeWord8OffAddrAsStablePtr# :: forall a d. Addr# -> Int# -> StablePtr# a -> State# d -> State# d
+  writeWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> Word# -> State# d -> State# d
+  writeWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> Word16# -> State# d -> State# d
+  writeWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> Word32# -> State# d -> State# d
+  writeWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> Word64# -> State# d -> State# d
   writeWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> Word8X16# -> State# d -> State# d
   writeWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> Word8X64# -> State# d -> State# d
@@ -5964,6 +6006,20 @@ module GHC.Exts where
   indexWord8ArrayAsWord8X32# :: ByteArray# -> Int# -> Word8X32#
   indexWord8ArrayAsWord8X64# :: ByteArray# -> Int# -> Word8X64#
   indexWord8OffAddr# :: Addr# -> Int# -> Word8#
+  indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+  indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+  indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+  indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+  indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+  indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+  indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+  indexWord8OffAddrAsStablePtr# :: forall a. Addr# -> Int# -> StablePtr# a
+  indexWord8OffAddrAsWideChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+  indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+  indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+  indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
   indexWord8OffAddrAsWord8X16# :: Addr# -> Int# -> Word8X16#
   indexWord8OffAddrAsWord8X32# :: Addr# -> Int# -> Word8X32#
   indexWord8OffAddrAsWord8X64# :: Addr# -> Int# -> Word8X64#
@@ -6500,6 +6556,20 @@ module GHC.Exts where
   readWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X64# #)
   readWord8OffAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8# #)
+  readWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Addr# #)
+  readWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
+  readWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Float# #)
+  readWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int# #)
+  readWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int16# #)
+  readWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int32# #)
+  readWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int64# #)
+  readWord8OffAddrAsStablePtr# :: forall d a. Addr# -> Int# -> State# d -> (# State# d, StablePtr# a #)
+  readWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word# #)
+  readWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word16# #)
+  readWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word32# #)
+  readWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word64# #)
   readWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X16# #)
   readWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X64# #)
@@ -6918,6 +6988,20 @@ module GHC.Exts where
   writeWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> Word8X64# -> State# d -> State# d
   writeWord8OffAddr# :: forall d. Addr# -> Int# -> Word8# -> State# d -> State# d
+  writeWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> Addr# -> State# d -> State# d
+  writeWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> Double# -> State# d -> State# d
+  writeWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> Float# -> State# d -> State# d
+  writeWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> Int# -> State# d -> State# d
+  writeWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> Int16# -> State# d -> State# d
+  writeWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> Int32# -> State# d -> State# d
+  writeWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> Int64# -> State# d -> State# d
+  writeWord8OffAddrAsStablePtr# :: forall a d. Addr# -> Int# -> StablePtr# a -> State# d -> State# d
+  writeWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> Word# -> State# d -> State# d
+  writeWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> Word16# -> State# d -> State# d
+  writeWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> Word32# -> State# d -> State# d
+  writeWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> Word64# -> State# d -> State# d
   writeWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> Word8X16# -> State# d -> State# d
   writeWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> Word8X64# -> State# d -> State# d


=====================================
testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
=====================================
@@ -3883,6 +3883,20 @@ module GHC.Base where
   indexWord8ArrayAsWord8X32# :: ByteArray# -> Int# -> Word8X32#
   indexWord8ArrayAsWord8X64# :: ByteArray# -> Int# -> Word8X64#
   indexWord8OffAddr# :: Addr# -> Int# -> Word8#
+  indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+  indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+  indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+  indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+  indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+  indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+  indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+  indexWord8OffAddrAsStablePtr# :: forall a. Addr# -> Int# -> StablePtr# a
+  indexWord8OffAddrAsWideChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+  indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+  indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+  indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
   indexWord8OffAddrAsWord8X16# :: Addr# -> Int# -> Word8X16#
   indexWord8OffAddrAsWord8X32# :: Addr# -> Int# -> Word8X32#
   indexWord8OffAddrAsWord8X64# :: Addr# -> Int# -> Word8X64#
@@ -4443,6 +4457,20 @@ module GHC.Base where
   readWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X64# #)
   readWord8OffAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8# #)
+  readWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Addr# #)
+  readWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
+  readWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Float# #)
+  readWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int# #)
+  readWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int16# #)
+  readWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int32# #)
+  readWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int64# #)
+  readWord8OffAddrAsStablePtr# :: forall d a. Addr# -> Int# -> State# d -> (# State# d, StablePtr# a #)
+  readWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word# #)
+  readWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word16# #)
+  readWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word32# #)
+  readWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word64# #)
   readWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X16# #)
   readWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X64# #)
@@ -4860,6 +4888,20 @@ module GHC.Base where
   writeWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> Word8X64# -> State# d -> State# d
   writeWord8OffAddr# :: forall d. Addr# -> Int# -> Word8# -> State# d -> State# d
+  writeWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> Addr# -> State# d -> State# d
+  writeWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> Double# -> State# d -> State# d
+  writeWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> Float# -> State# d -> State# d
+  writeWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> Int# -> State# d -> State# d
+  writeWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> Int16# -> State# d -> State# d
+  writeWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> Int32# -> State# d -> State# d
+  writeWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> Int64# -> State# d -> State# d
+  writeWord8OffAddrAsStablePtr# :: forall a d. Addr# -> Int# -> StablePtr# a -> State# d -> State# d
+  writeWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> Word# -> State# d -> State# d
+  writeWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> Word16# -> State# d -> State# d
+  writeWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> Word32# -> State# d -> State# d
+  writeWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> Word64# -> State# d -> State# d
   writeWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> Word8X16# -> State# d -> State# d
   writeWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> Word8X64# -> State# d -> State# d
@@ -5933,6 +5975,20 @@ module GHC.Exts where
   indexWord8ArrayAsWord8X32# :: ByteArray# -> Int# -> Word8X32#
   indexWord8ArrayAsWord8X64# :: ByteArray# -> Int# -> Word8X64#
   indexWord8OffAddr# :: Addr# -> Int# -> Word8#
+  indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+  indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+  indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+  indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+  indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+  indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+  indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+  indexWord8OffAddrAsStablePtr# :: forall a. Addr# -> Int# -> StablePtr# a
+  indexWord8OffAddrAsWideChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+  indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+  indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+  indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
   indexWord8OffAddrAsWord8X16# :: Addr# -> Int# -> Word8X16#
   indexWord8OffAddrAsWord8X32# :: Addr# -> Int# -> Word8X32#
   indexWord8OffAddrAsWord8X64# :: Addr# -> Int# -> Word8X64#
@@ -6469,6 +6525,20 @@ module GHC.Exts where
   readWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X64# #)
   readWord8OffAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8# #)
+  readWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Addr# #)
+  readWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
+  readWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Float# #)
+  readWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int# #)
+  readWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int16# #)
+  readWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int32# #)
+  readWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int64# #)
+  readWord8OffAddrAsStablePtr# :: forall d a. Addr# -> Int# -> State# d -> (# State# d, StablePtr# a #)
+  readWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word# #)
+  readWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word16# #)
+  readWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word32# #)
+  readWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word64# #)
   readWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X16# #)
   readWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X64# #)
@@ -6887,6 +6957,20 @@ module GHC.Exts where
   writeWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> Word8X64# -> State# d -> State# d
   writeWord8OffAddr# :: forall d. Addr# -> Int# -> Word8# -> State# d -> State# d
+  writeWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> Addr# -> State# d -> State# d
+  writeWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> Double# -> State# d -> State# d
+  writeWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> Float# -> State# d -> State# d
+  writeWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> Int# -> State# d -> State# d
+  writeWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> Int16# -> State# d -> State# d
+  writeWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> Int32# -> State# d -> State# d
+  writeWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> Int64# -> State# d -> State# d
+  writeWord8OffAddrAsStablePtr# :: forall a d. Addr# -> Int# -> StablePtr# a -> State# d -> State# d
+  writeWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> Word# -> State# d -> State# d
+  writeWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> Word16# -> State# d -> State# d
+  writeWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> Word32# -> State# d -> State# d
+  writeWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> Word64# -> State# d -> State# d
   writeWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> Word8X16# -> State# d -> State# d
   writeWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> Word8X64# -> State# d -> State# d


=====================================
testsuite/tests/interface-stability/base-exports.stdout-mingw32
=====================================
@@ -3886,6 +3886,20 @@ module GHC.Base where
   indexWord8ArrayAsWord8X32# :: ByteArray# -> Int# -> Word8X32#
   indexWord8ArrayAsWord8X64# :: ByteArray# -> Int# -> Word8X64#
   indexWord8OffAddr# :: Addr# -> Int# -> Word8#
+  indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+  indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+  indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+  indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+  indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+  indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+  indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+  indexWord8OffAddrAsStablePtr# :: forall a. Addr# -> Int# -> StablePtr# a
+  indexWord8OffAddrAsWideChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+  indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+  indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+  indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
   indexWord8OffAddrAsWord8X16# :: Addr# -> Int# -> Word8X16#
   indexWord8OffAddrAsWord8X32# :: Addr# -> Int# -> Word8X32#
   indexWord8OffAddrAsWord8X64# :: Addr# -> Int# -> Word8X64#
@@ -4446,6 +4460,20 @@ module GHC.Base where
   readWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X64# #)
   readWord8OffAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8# #)
+  readWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Addr# #)
+  readWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
+  readWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Float# #)
+  readWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int# #)
+  readWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int16# #)
+  readWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int32# #)
+  readWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int64# #)
+  readWord8OffAddrAsStablePtr# :: forall d a. Addr# -> Int# -> State# d -> (# State# d, StablePtr# a #)
+  readWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word# #)
+  readWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word16# #)
+  readWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word32# #)
+  readWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word64# #)
   readWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X16# #)
   readWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X64# #)
@@ -4863,6 +4891,20 @@ module GHC.Base where
   writeWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> Word8X64# -> State# d -> State# d
   writeWord8OffAddr# :: forall d. Addr# -> Int# -> Word8# -> State# d -> State# d
+  writeWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> Addr# -> State# d -> State# d
+  writeWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> Double# -> State# d -> State# d
+  writeWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> Float# -> State# d -> State# d
+  writeWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> Int# -> State# d -> State# d
+  writeWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> Int16# -> State# d -> State# d
+  writeWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> Int32# -> State# d -> State# d
+  writeWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> Int64# -> State# d -> State# d
+  writeWord8OffAddrAsStablePtr# :: forall a d. Addr# -> Int# -> StablePtr# a -> State# d -> State# d
+  writeWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> Word# -> State# d -> State# d
+  writeWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> Word16# -> State# d -> State# d
+  writeWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> Word32# -> State# d -> State# d
+  writeWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> Word64# -> State# d -> State# d
   writeWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> Word8X16# -> State# d -> State# d
   writeWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> Word8X64# -> State# d -> State# d
@@ -6113,6 +6155,20 @@ module GHC.Exts where
   indexWord8ArrayAsWord8X32# :: ByteArray# -> Int# -> Word8X32#
   indexWord8ArrayAsWord8X64# :: ByteArray# -> Int# -> Word8X64#
   indexWord8OffAddr# :: Addr# -> Int# -> Word8#
+  indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+  indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+  indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+  indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+  indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+  indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+  indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+  indexWord8OffAddrAsStablePtr# :: forall a. Addr# -> Int# -> StablePtr# a
+  indexWord8OffAddrAsWideChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+  indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+  indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+  indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
   indexWord8OffAddrAsWord8X16# :: Addr# -> Int# -> Word8X16#
   indexWord8OffAddrAsWord8X32# :: Addr# -> Int# -> Word8X32#
   indexWord8OffAddrAsWord8X64# :: Addr# -> Int# -> Word8X64#
@@ -6649,6 +6705,20 @@ module GHC.Exts where
   readWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X64# #)
   readWord8OffAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8# #)
+  readWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Addr# #)
+  readWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
+  readWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Float# #)
+  readWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int# #)
+  readWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int16# #)
+  readWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int32# #)
+  readWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int64# #)
+  readWord8OffAddrAsStablePtr# :: forall d a. Addr# -> Int# -> State# d -> (# State# d, StablePtr# a #)
+  readWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word# #)
+  readWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word16# #)
+  readWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word32# #)
+  readWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word64# #)
   readWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X16# #)
   readWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X64# #)
@@ -7067,6 +7137,20 @@ module GHC.Exts where
   writeWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> Word8X64# -> State# d -> State# d
   writeWord8OffAddr# :: forall d. Addr# -> Int# -> Word8# -> State# d -> State# d
+  writeWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> Addr# -> State# d -> State# d
+  writeWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> Double# -> State# d -> State# d
+  writeWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> Float# -> State# d -> State# d
+  writeWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> Int# -> State# d -> State# d
+  writeWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> Int16# -> State# d -> State# d
+  writeWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> Int32# -> State# d -> State# d
+  writeWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> Int64# -> State# d -> State# d
+  writeWord8OffAddrAsStablePtr# :: forall a d. Addr# -> Int# -> StablePtr# a -> State# d -> State# d
+  writeWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> Word# -> State# d -> State# d
+  writeWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> Word16# -> State# d -> State# d
+  writeWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> Word32# -> State# d -> State# d
+  writeWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> Word64# -> State# d -> State# d
   writeWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> Word8X16# -> State# d -> State# d
   writeWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> Word8X64# -> State# d -> State# d


=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32
=====================================
@@ -3883,6 +3883,20 @@ module GHC.Base where
   indexWord8ArrayAsWord8X32# :: ByteArray# -> Int# -> Word8X32#
   indexWord8ArrayAsWord8X64# :: ByteArray# -> Int# -> Word8X64#
   indexWord8OffAddr# :: Addr# -> Int# -> Word8#
+  indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+  indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+  indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+  indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+  indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+  indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+  indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+  indexWord8OffAddrAsStablePtr# :: forall a. Addr# -> Int# -> StablePtr# a
+  indexWord8OffAddrAsWideChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+  indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+  indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+  indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
   indexWord8OffAddrAsWord8X16# :: Addr# -> Int# -> Word8X16#
   indexWord8OffAddrAsWord8X32# :: Addr# -> Int# -> Word8X32#
   indexWord8OffAddrAsWord8X64# :: Addr# -> Int# -> Word8X64#
@@ -4443,6 +4457,20 @@ module GHC.Base where
   readWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X64# #)
   readWord8OffAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8# #)
+  readWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Addr# #)
+  readWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
+  readWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Float# #)
+  readWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int# #)
+  readWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int16# #)
+  readWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int32# #)
+  readWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int64# #)
+  readWord8OffAddrAsStablePtr# :: forall d a. Addr# -> Int# -> State# d -> (# State# d, StablePtr# a #)
+  readWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word# #)
+  readWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word16# #)
+  readWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word32# #)
+  readWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word64# #)
   readWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X16# #)
   readWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X64# #)
@@ -4860,6 +4888,20 @@ module GHC.Base where
   writeWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> Word8X64# -> State# d -> State# d
   writeWord8OffAddr# :: forall d. Addr# -> Int# -> Word8# -> State# d -> State# d
+  writeWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> Addr# -> State# d -> State# d
+  writeWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> Double# -> State# d -> State# d
+  writeWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> Float# -> State# d -> State# d
+  writeWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> Int# -> State# d -> State# d
+  writeWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> Int16# -> State# d -> State# d
+  writeWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> Int32# -> State# d -> State# d
+  writeWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> Int64# -> State# d -> State# d
+  writeWord8OffAddrAsStablePtr# :: forall a d. Addr# -> Int# -> StablePtr# a -> State# d -> State# d
+  writeWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> Word# -> State# d -> State# d
+  writeWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> Word16# -> State# d -> State# d
+  writeWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> Word32# -> State# d -> State# d
+  writeWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> Word64# -> State# d -> State# d
   writeWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> Word8X16# -> State# d -> State# d
   writeWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> Word8X64# -> State# d -> State# d
@@ -5964,6 +6006,20 @@ module GHC.Exts where
   indexWord8ArrayAsWord8X32# :: ByteArray# -> Int# -> Word8X32#
   indexWord8ArrayAsWord8X64# :: ByteArray# -> Int# -> Word8X64#
   indexWord8OffAddr# :: Addr# -> Int# -> Word8#
+  indexWord8OffAddrAsAddr# :: Addr# -> Int# -> Addr#
+  indexWord8OffAddrAsChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsDouble# :: Addr# -> Int# -> Double#
+  indexWord8OffAddrAsFloat# :: Addr# -> Int# -> Float#
+  indexWord8OffAddrAsInt# :: Addr# -> Int# -> Int#
+  indexWord8OffAddrAsInt16# :: Addr# -> Int# -> Int16#
+  indexWord8OffAddrAsInt32# :: Addr# -> Int# -> Int32#
+  indexWord8OffAddrAsInt64# :: Addr# -> Int# -> Int64#
+  indexWord8OffAddrAsStablePtr# :: forall a. Addr# -> Int# -> StablePtr# a
+  indexWord8OffAddrAsWideChar# :: Addr# -> Int# -> Char#
+  indexWord8OffAddrAsWord# :: Addr# -> Int# -> Word#
+  indexWord8OffAddrAsWord16# :: Addr# -> Int# -> Word16#
+  indexWord8OffAddrAsWord32# :: Addr# -> Int# -> Word32#
+  indexWord8OffAddrAsWord64# :: Addr# -> Int# -> Word64#
   indexWord8OffAddrAsWord8X16# :: Addr# -> Int# -> Word8X16#
   indexWord8OffAddrAsWord8X32# :: Addr# -> Int# -> Word8X32#
   indexWord8OffAddrAsWord8X64# :: Addr# -> Int# -> Word8X64#
@@ -6500,6 +6556,20 @@ module GHC.Exts where
   readWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> State# d -> (# State# d, Word8X64# #)
   readWord8OffAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8# #)
+  readWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Addr# #)
+  readWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Double# #)
+  readWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Float# #)
+  readWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int# #)
+  readWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int16# #)
+  readWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int32# #)
+  readWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Int64# #)
+  readWord8OffAddrAsStablePtr# :: forall d a. Addr# -> Int# -> State# d -> (# State# d, StablePtr# a #)
+  readWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Char# #)
+  readWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word# #)
+  readWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word16# #)
+  readWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word32# #)
+  readWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word64# #)
   readWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X16# #)
   readWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X32# #)
   readWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> State# d -> (# State# d, Word8X64# #)
@@ -6918,6 +6988,20 @@ module GHC.Exts where
   writeWord8ArrayAsWord8X32# :: forall d. MutableByteArray# d -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8ArrayAsWord8X64# :: forall d. MutableByteArray# d -> Int# -> Word8X64# -> State# d -> State# d
   writeWord8OffAddr# :: forall d. Addr# -> Int# -> Word8# -> State# d -> State# d
+  writeWord8OffAddrAsAddr# :: forall d. Addr# -> Int# -> Addr# -> State# d -> State# d
+  writeWord8OffAddrAsChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsDouble# :: forall d. Addr# -> Int# -> Double# -> State# d -> State# d
+  writeWord8OffAddrAsFloat# :: forall d. Addr# -> Int# -> Float# -> State# d -> State# d
+  writeWord8OffAddrAsInt# :: forall d. Addr# -> Int# -> Int# -> State# d -> State# d
+  writeWord8OffAddrAsInt16# :: forall d. Addr# -> Int# -> Int16# -> State# d -> State# d
+  writeWord8OffAddrAsInt32# :: forall d. Addr# -> Int# -> Int32# -> State# d -> State# d
+  writeWord8OffAddrAsInt64# :: forall d. Addr# -> Int# -> Int64# -> State# d -> State# d
+  writeWord8OffAddrAsStablePtr# :: forall a d. Addr# -> Int# -> StablePtr# a -> State# d -> State# d
+  writeWord8OffAddrAsWideChar# :: forall d. Addr# -> Int# -> Char# -> State# d -> State# d
+  writeWord8OffAddrAsWord# :: forall d. Addr# -> Int# -> Word# -> State# d -> State# d
+  writeWord8OffAddrAsWord16# :: forall d. Addr# -> Int# -> Word16# -> State# d -> State# d
+  writeWord8OffAddrAsWord32# :: forall d. Addr# -> Int# -> Word32# -> State# d -> State# d
+  writeWord8OffAddrAsWord64# :: forall d. Addr# -> Int# -> Word64# -> State# d -> State# d
   writeWord8OffAddrAsWord8X16# :: forall d. Addr# -> Int# -> Word8X16# -> State# d -> State# d
   writeWord8OffAddrAsWord8X32# :: forall d. Addr# -> Int# -> Word8X32# -> State# d -> State# d
   writeWord8OffAddrAsWord8X64# :: forall d. Addr# -> Int# -> Word8X64# -> State# d -> State# d


=====================================
testsuite/tests/primops/should_run/UnalignedAddrPrimOps.hs
=====================================
@@ -0,0 +1,271 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE MagicHash #-}
+{-# LANGUAGE UnboxedTuples #-}
+module Main where
+
+#include "MachDeps.h"
+
+import GHC.Ptr(Ptr(..), nullPtr, plusPtr, minusPtr)
+import GHC.Stable(
+  StablePtr(..), castStablePtrToPtr, castPtrToStablePtr, newStablePtr)
+import GHC.Exts
+import Data.Char(ord)
+import GHC.Int
+import GHC.Word
+import GHC.IO
+
+assertEqual :: (Show a, Eq a) => String -> a -> a -> IO ()
+assertEqual msg a b
+  | a /= b = putStrLn (msg ++ " " ++ show a ++ " /= " ++ show b)
+  | otherwise = return ()
+
+readBytes :: MutableByteArray# s -> State# s -> Int# -> (# State# s, [Word8] #)
+readBytes marr s0 len = go s0 len []
+ where
+  go s 0# bs = (# s, bs #)
+  go s i  bs = case readWord8Array# marr (i -# 1#) s of
+    (# s', b #) -> go s' (i -# 1#) (W8# b : bs)
+
+indexBytes :: Addr# -> Int# -> [Word8]
+indexBytes arr len =
+  [W8# (indexWord8OffAddr# arr i) | I# i <- [0..I# len - 1]]
+
+test :: (Eq a, Show a)
+  => String
+  -> (Addr# -> Int# -> a)
+  -> (Addr# -> Int# -> State# RealWorld
+      -> (# State# RealWorld, a #))
+  -> (Addr# -> Int# -> a -> State# RealWorld
+      -> State# RealWorld)
+  -> a
+  -> [Word8]
+  -> Int
+  -> IO ()
+test name index read write val valBytes len = do
+  putStrLn name
+  mapM_ testAtOffset [0..16]
+ where
+  arrLen :: Int#
+  arrLen = 24#
+
+  fillerByte :: Word8
+  fillerByte = 0x34
+
+  expectedArrayBytes :: Int -> [Word8]
+  expectedArrayBytes offset =
+       replicate offset fillerByte
+    ++ valBytes
+    ++ replicate (fromIntegral $ I# arrLen - len - offset) fillerByte
+
+  testAtOffset :: Int -> IO ()
+  testAtOffset offset@(I# offset#) = IO (\s0 -> let
+    !(# s1, marr #) = newPinnedByteArray# arrLen s0
+    !s2 = setByteArray# marr 0# arrLen (case fromIntegral fillerByte of I# i# -> i#) s1
+    !addr = mutableByteArrayContents# marr
+   in keepAlive# marr s2 (\s2 -> let
+      !s3 = write addr offset# val s2
+      !(# s4, readOpResult #) = read addr offset# s3
+      !(# s5, bytesAfterWrite #) = readBytes marr s4 arrLen
+      !(# s6, arr #) = unsafeFreezeByteArray# marr s5
+      -- we want to tie the index operations to the State# token so that they happen after the mutations
+      !addrFrozen = byteArrayContents# arr
+      bytesViaAddrAfterWrite = indexBytes addrFrozen arrLen
+      indexOpResult = index addrFrozen offset#
+     in
+        unIO (do
+           assertEqual "readOpResult" readOpResult val
+           assertEqual "indexOpResult" indexOpResult val
+           assertEqual "bytesAfterWrite indexed" bytesAfterWrite (expectedArrayBytes offset)
+           assertEqual "bytesViaAddrAfterWrite indexed" bytesViaAddrAfterWrite (expectedArrayBytes offset)) s6
+        )
+    )
+
+intToBytes :: Word64 -> Int -> [Word8]
+intToBytes (W64# val0) (I# len0) = let
+    result = go val0 len0
+    go v 0# = []
+    go v len =
+      W8# (wordToWord8# (word64ToWord# v)) : go (v `uncheckedShiftRL64#` 8#) (len -# 1#)
+  in
+#if defined(WORDS_BIGENDIAN)
+    reverse result
+#else
+    result
+#endif
+
+testIntArray :: (Eq a, Show a, Integral a, Num a)
+  => String
+  -> (Addr# -> Int# -> a)
+  -> (Addr# -> Int# -> State# RealWorld
+      -> (# State# RealWorld, a #))
+  -> (Addr# -> Int# -> a -> State# RealWorld
+      -> State# RealWorld)
+  -> a
+  -> Int
+  -> IO ()
+testIntArray name0 index read write val0 len = do
+  doOne (name0 ++ " positive") val0
+  doOne (name0 ++ " negative") (negate val0)
+ where
+  doOne name val = test name index read write
+    val (intToBytes (fromIntegral val) len) len
+
+testWordArray :: (Eq a, Show a, Integral a)
+  => String
+  -> (Addr# -> Int# -> a)
+  -> (Addr# -> Int# -> State# RealWorld
+        -> (# State# RealWorld, a #))
+  -> (Addr# -> Int# -> a -> State# RealWorld
+        -> State# RealWorld)
+  -> a
+  -> Int
+  -> IO ()
+testWordArray name index read write val len =
+  test name index read write
+    val (intToBytes (fromIntegral val) len) len
+
+wordSizeInBytes :: Int
+wordSizeInBytes = WORD_SIZE_IN_BITS `div` 8
+
+int :: Int
+int
+  | WORD_SIZE_IN_BITS == 32 = 12345678
+  | otherwise = 1234567890123
+
+word :: Word
+word = fromIntegral int
+
+float :: Float
+float = 123.456789
+
+-- Test pattern generated by this python code:
+-- >>> import struct
+-- >>> import binascii
+-- >>> binascii.hexlify(struct.pack('>f', 123.456789))
+floatBytes :: Word64
+floatBytes = 0x42f6e9e0
+
+double :: Double
+double = 123.45678901234
+
+-- Test pattern generated by this python code:
+-- >>> import struct
+-- >>> import binascii
+-- >>> binascii.hexlify(struct.pack('>d', 123.45678901234))
+doubleBytes :: Word64
+doubleBytes = 0x405edd3c07fb4b09
+
+main :: IO ()
+main = do
+  testIntArray "Int8#"
+    (\arr i -> I8# (indexInt8OffAddr# arr i))
+    (\arr i s -> case readInt8OffAddr# arr i s of (# s', a #) -> (# s', I8# a #))
+    (\arr i (I8# a) s -> writeInt8OffAddr# arr i a s)
+    123 1
+  testIntArray "Int16#"
+    (\arr i -> I16# (indexWord8OffAddrAsInt16# arr i))
+    (\arr i s -> case readWord8OffAddrAsInt16# arr i s of (# s', a #) -> (# s', I16# a #))
+    (\arr i (I16# a) s -> writeWord8OffAddrAsInt16# arr i a s)
+    12345 2
+  testIntArray "Int32#"
+    (\arr i -> I32# (indexWord8OffAddrAsInt32# arr i))
+    (\arr i s -> case readWord8OffAddrAsInt32# arr i s of (# s', a #) -> (# s', I32# a #))
+    (\arr i (I32# a) s -> writeWord8OffAddrAsInt32# arr i a s)
+    12345678 4
+  testIntArray "Int64#"
+    (\arr i -> I64# (indexWord8OffAddrAsInt64# arr i))
+    (\arr i s -> case readWord8OffAddrAsInt64# arr i s of (# s', a #) -> (# s', I64# a #))
+    (\arr i (I64# a) s -> writeWord8OffAddrAsInt64# arr i a s)
+    1234567890123 8
+  testIntArray "Int#"
+    (\arr i -> I# (indexWord8OffAddrAsInt# arr i))
+    (\arr i s -> case readWord8OffAddrAsInt# arr i s of (# s', a #) -> (# s', I# a #))
+    (\arr i (I# a) s -> writeWord8OffAddrAsInt# arr i a s)
+    int wordSizeInBytes
+
+  testWordArray "Word8#"
+    (\arr i -> W8# (indexWord8OffAddr# arr i))
+    (\arr i s -> case readWord8OffAddr# arr i s of (# s', a #) -> (# s', W8# a #))
+    (\arr i (W8# a) s -> writeWord8OffAddr# arr i a s)
+    123 1
+  testWordArray "Word16#"
+    (\arr i -> W16# (indexWord8OffAddrAsWord16# arr i))
+    (\arr i s -> case readWord8OffAddrAsWord16# arr i s of (# s', a #) -> (# s', W16# a #))
+    (\arr i (W16# a) s -> writeWord8OffAddrAsWord16# arr i a s)
+    12345 2
+  testWordArray "Word32#"
+    (\arr i -> W32# (indexWord8OffAddrAsWord32# arr i))
+    (\arr i s -> case readWord8OffAddrAsWord32# arr i s of (# s', a #) -> (# s', W32# a #))
+    (\arr i (W32# a) s -> writeWord8OffAddrAsWord32# arr i a s)
+    12345678 4
+  testWordArray "Word64#"
+    (\arr i -> W64# (indexWord8OffAddrAsWord64# arr i))
+    (\arr i s -> case readWord8OffAddrAsWord64# arr i s of (# s', a #) -> (# s', W64# a #))
+    (\arr i (W64# a) s -> writeWord8OffAddrAsWord64# arr i a s)
+    1234567890123 8
+  testWordArray "Word#"
+    (\arr i -> W# (indexWord8OffAddrAsWord# arr i))
+    (\arr i s -> case readWord8OffAddrAsWord# arr i s of (# s', a #) -> (# s', W# a #))
+    (\arr i (W# a) s -> writeWord8OffAddrAsWord# arr i a s)
+    word wordSizeInBytes
+
+  test
+    "Char#"
+    (\arr i -> C# (indexWord8OffAddrAsChar# arr i))
+    (\arr i s ->
+        case readWord8OffAddrAsChar# arr i s of (# s', a #) -> (# s', C# a #))
+    (\arr i (C# a) s -> writeWord8OffAddrAsChar# arr i a s)
+    'z'
+    [fromIntegral $ ord 'z']
+    1
+  test
+    "WideChar#"
+    (\arr i -> C# (indexWord8OffAddrAsWideChar# arr i))
+    (\arr i s ->
+        case readWord8OffAddrAsWideChar# arr i s of (# s', a #) -> (# s', C# a #))
+    (\arr i (C# a) s -> writeWord8OffAddrAsWideChar# arr i a s)
+    '𠜎'  -- See http://www.i18nguy.com/unicode/supplementary-test.html
+    (intToBytes (fromIntegral $ ord '𠜎') 4)
+    4
+  test
+    "Addr#"
+    (\arr i -> Ptr (indexWord8OffAddrAsAddr# arr i))
+    (\arr i s ->
+        case readWord8OffAddrAsAddr# arr i s of (# s', a #) -> (# s', Ptr a #))
+    (\arr i (Ptr a) s -> writeWord8OffAddrAsAddr# arr i a s)
+    (nullPtr `plusPtr` int)
+    (intToBytes (fromIntegral word) wordSizeInBytes)
+    wordSizeInBytes
+
+  stablePtr <- newStablePtr ()
+  test
+    "StablePtr#"
+    (\arr i ->
+        castStablePtrToPtr (StablePtr (indexWord8OffAddrAsStablePtr# arr i)))
+    (\arr i s -> case readWord8OffAddrAsStablePtr# arr i s of
+                   (# s', a #) -> (# s', castStablePtrToPtr (StablePtr a) #))
+    (\arr i p s -> case castPtrToStablePtr p of
+                     (StablePtr a) -> writeWord8OffAddrAsStablePtr# arr i a s)
+    (castStablePtrToPtr stablePtr)
+    (intToBytes (fromIntegral $ castStablePtrToPtr stablePtr `minusPtr` nullPtr)
+                wordSizeInBytes)
+    wordSizeInBytes
+
+  test
+    "Float#"
+    (\arr i -> F# (indexWord8OffAddrAsFloat# arr i))
+    (\arr i s ->
+        case readWord8OffAddrAsFloat# arr i s of (# s', a #) -> (# s', F# a #))
+    (\arr i (F# a) s -> writeWord8OffAddrAsFloat# arr i a s)
+    float
+    (intToBytes floatBytes 4)
+    4
+  test
+    "Double#"
+    (\arr i -> D# (indexWord8OffAddrAsDouble# arr i))
+    (\arr i s ->
+        case readWord8OffAddrAsDouble# arr i s of (# s', a #) -> (# s', D# a #))
+    (\arr i (D# a) s -> writeWord8OffAddrAsDouble# arr i a s)
+    double
+    (intToBytes doubleBytes 8)
+    8


=====================================
testsuite/tests/primops/should_run/UnalignedAddrPrimOps.stdout
=====================================
@@ -0,0 +1,21 @@
+Int8# positive
+Int8# negative
+Int16# positive
+Int16# negative
+Int32# positive
+Int32# negative
+Int64# positive
+Int64# negative
+Int# positive
+Int# negative
+Word8#
+Word16#
+Word32#
+Word64#
+Word#
+Char#
+WideChar#
+Addr#
+StablePtr#
+Float#
+Double#


=====================================
testsuite/tests/primops/should_run/all.T
=====================================
@@ -5,6 +5,7 @@ test('T4442',
      [when(wordsize(32), expect_broken(15184))],
      compile_and_run, [''])
 test('T10481', exit_code(1), compile_and_run, [''])
+test('UnalignedAddrPrimOps', normal, compile_and_run, [''])
 test('T10678',
      [ collect_stats('bytes allocated',5),
        only_ways(['normal']),


=====================================
utils/genprimopcode/AccessOps.hs
=====================================
@@ -171,7 +171,6 @@ mkIndexOffAddrOp e = PrimOpSpec
   , opts = [OptionEffect CanFail]
   }
 
-{-
 mkUnalignedIndexOffAddrOp :: ElementType -> Entry
 mkUnalignedIndexOffAddrOp e = PrimOpSpec
   { cons = "IndexOffAddrOp_Word8As" ++ elt_name e
@@ -183,7 +182,6 @@ mkUnalignedIndexOffAddrOp e = PrimOpSpec
   , desc = "Read " ++ elt_desc e ++ "; offset in bytes."
   , opts = [OptionEffect CanFail]
   }
--}
 
 mkReadOffAddrOp :: ElementType -> Entry
 mkReadOffAddrOp e = PrimOpSpec
@@ -198,7 +196,6 @@ mkReadOffAddrOp e = PrimOpSpec
   , opts = [OptionEffect ReadWriteEffect, OptionCanFailWarnFlag YesWarnCanFail]
   }
 
-{-
 mkUnalignedReadOffAddrOp :: ElementType -> Entry
 mkUnalignedReadOffAddrOp e = PrimOpSpec
   { cons = "ReadOffAddrOp_Word8As" ++ elt_name e
@@ -210,7 +207,6 @@ mkUnalignedReadOffAddrOp e = PrimOpSpec
   , desc = "Read " ++ elt_desc e ++ "; offset in bytes."
   , opts = [OptionEffect ReadWriteEffect, OptionCanFailWarnFlag YesWarnCanFail]
   }
--}
 
 mkWriteOffAddrOp :: ElementType -> Entry
 mkWriteOffAddrOp e = PrimOpSpec
@@ -225,7 +221,6 @@ mkWriteOffAddrOp e = PrimOpSpec
   , opts = [OptionEffect ReadWriteEffect, OptionCanFailWarnFlag YesWarnCanFail]
   }
 
-{-
 mkUnalignedWriteOffAddrOp :: ElementType -> Entry
 mkUnalignedWriteOffAddrOp e = PrimOpSpec
   { cons = "WriteOffAddrOp_Word8As" ++ elt_name e
@@ -237,14 +232,13 @@ mkUnalignedWriteOffAddrOp e = PrimOpSpec
   , desc = "Write " ++ elt_desc e ++ "; offset in bytes."
   , opts = [OptionEffect ReadWriteEffect, OptionCanFailWarnFlag YesWarnCanFail]
   }
--}
 
 
 addrAccessOps :: [Entry]
 addrAccessOps
   =  map mkIndexOffAddrOp elementTypes
---  ++ map mkUnalignedIndexOffAddrOp unalignedElementTypes
+  ++ map mkUnalignedIndexOffAddrOp unalignedElementTypes
   ++ map mkReadOffAddrOp elementTypes
---  ++ map mkUnalignedReadOffAddrOp unalignedElementTypes
+  ++ map mkUnalignedReadOffAddrOp unalignedElementTypes
   ++ map mkWriteOffAddrOp elementTypes
---  ++ map mkUnalignedWriteOffAddrOp unalignedElementTypes
+  ++ map mkUnalignedWriteOffAddrOp unalignedElementTypes



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eaf72479eacaa092e87accd6780ea9c048f1dfcb

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/eaf72479eacaa092e87accd6780ea9c048f1dfcb
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240106/58ae1fb6/attachment-0001.html>


More information about the ghc-commits mailing list