Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
3a0af2b8
Commit
3a0af2b8
authored
26 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-03-02 20:10:17 by sof]
StgNat* --> StgWord*
parent
63c93617
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/lib/exts/Word.lhs
+15
-15
15 additions, 15 deletions
ghc/lib/exts/Word.lhs
with
15 additions
and
15 deletions
ghc/lib/exts/Word.lhs
+
15
−
15
View file @
3a0af2b8
...
...
@@ -1321,36 +1321,36 @@ Read words out of mutable memory:
\begin{code}
readWord8OffAddr :: Addr -> Int -> IO Word8
readWord8OffAddr a i = _casm_ `` %r=(
StgNat8)(((StgNat
8*)%0)[(StgInt)%1]
)
; '' a i
readWord8OffAddr a i = _casm_ `` %r=(
(StgWord
8*)%0)[(StgInt)%1]; '' a i
readWord16OffAddr :: Addr -> Int -> IO Word16
readWord16OffAddr a i = _casm_ `` %r=(
StgNat16)(((StgNat
16*)%0)[(StgInt)%1]
)
; '' a i
readWord16OffAddr a i = _casm_ `` %r=(
(StgWord
16*)%0)[(StgInt)%1]; '' a i
readWord32OffAddr :: Addr -> Int -> IO Word32
readWord32OffAddr a i = _casm_ `` %r=(
StgNat32)(((StgNat
32*)%0)[(StgInt)%1]
)
; '' a i
readWord32OffAddr a i = _casm_ `` %r=(
(StgWord
32*)%0)[(StgInt)%1]; '' a i
readWord64OffAddr :: Addr -> Int -> IO Word64
#if WORD_SIZE_IN_BYTES==8
readWord64OffAddr a i = _casm_ `` %r=(
StgWord)((
(StgWord*)%0)[(StgInt)%1]
)
; '' a i
readWord64OffAddr a i = _casm_ `` %r=((StgWord*)%0)[(StgInt)%1]; '' a i
#else
readWord64OffAddr a i = _casm_ `` %r=(
StgNat64)(((StgNat
64*)%0)[(StgInt)%1]
)
; '' a i
readWord64OffAddr a i = _casm_ `` %r=(
(StgWord
64*)%0)[(StgInt)%1]; '' a i
#endif
#ifndef __PARALLEL_HASKELL__
readWord8OffForeignObj :: ForeignObj -> Int -> IO Word8
readWord8OffForeignObj fo i = _casm_ `` %r=(
StgNat8)(((StgNat
8*)%0)[(StgInt)%1]
)
; '' fo i
readWord8OffForeignObj fo i = _casm_ `` %r=(
(StgWord
8*)%0)[(StgInt)%1]; '' fo i
readWord16OffForeignObj :: ForeignObj -> Int -> IO Word16
readWord16OffForeignObj fo i = _casm_ `` %r=(
StgNat16)(((StgNat
16*)%0)[(StgInt)%1]
)
; '' fo i
readWord16OffForeignObj fo i = _casm_ `` %r=(
(StgWord
16*)%0)[(StgInt)%1]; '' fo i
readWord32OffForeignObj :: ForeignObj -> Int -> IO Word32
readWord32OffForeignObj fo i = _casm_ `` %r=(
StgNat32)(((StgNat
32*)%0)[(StgInt)%1]
)
; '' fo i
readWord32OffForeignObj fo i = _casm_ `` %r=(
(StgWord
32*)%0)[(StgInt)%1]; '' fo i
readWord64OffForeignObj :: ForeignObj -> Int -> IO Word64
#if WORD_SIZE_IN_BYTES==8
readWord64OffForeignObj fo i = _casm_ `` %r=(
StgWord)((
(StgWord*)%0)[(StgInt)%1]
)
; '' fo i
readWord64OffForeignObj fo i = _casm_ `` %r=((StgWord*)%0)[(StgInt)%1]; '' fo i
#else
readWord64OffForeignObj fo i = _casm_ `` %r=(
StgNat64)(((StgNat
64*)%0)[(StgInt)%1]
)
; '' fo i
readWord64OffForeignObj fo i = _casm_ `` %r=(
(StgWord
64*)%0)[(StgInt)%1]; '' fo i
#endif
#endif
...
...
@@ -1366,7 +1366,7 @@ writeWord8OffAddr (A# a#) (I# i#) (W8# w#) = IO $ \ s# ->
case (writeCharOffAddr# a# i# (chr# (word2Int# w#)) s#) of s2# -> (# s2#, () #)
writeWord16OffAddr :: Addr -> Int -> Word16 -> IO ()
writeWord16OffAddr a i e = _casm_ `` (((Stg
Nat
16*)%0)[(StgInt)%1])=(Stg
Nat
16)%2; '' a i e
writeWord16OffAddr a i e = _casm_ `` (((Stg
Word
16*)%0)[(StgInt)%1])=(Stg
Word
16)%2; '' a i e
writeWord32OffAddr :: Addr -> Int -> Word32 -> IO ()
writeWord32OffAddr (A# a#) i (W32# w#) = IO $ \ s# ->
...
...
@@ -1392,13 +1392,13 @@ writeWord64OffAddr (A# a#) (I# i#) (W64# w#) = IO $ \ s# ->
#ifndef __PARALLEL_HASKELL__
writeWord8OffForeignObj :: ForeignObj -> Int -> Word8 -> IO ()
writeWord8OffForeignObj fo i w = _casm_ `` (((Stg
Nat16
*)%0)[(StgInt)%1])=(Stg
Nat16
)%2; '' fo i w
writeWord8OffForeignObj fo i w = _casm_ `` (((Stg
Word8
*)%0)[(StgInt)%1])=(Stg
Word8
)%2; '' fo i w
writeWord16OffForeignObj :: ForeignObj -> Int -> Word16 -> IO ()
writeWord16OffForeignObj fo i w = _casm_ `` (((Stg
Nat
16*)%0)[(StgInt)%1])=(Stg
Nat
16)%2; '' fo i w
writeWord16OffForeignObj fo i w = _casm_ `` (((Stg
Word
16*)%0)[(StgInt)%1])=(Stg
Word
16)%2; '' fo i w
writeWord32OffForeignObj :: ForeignObj -> Int -> Word32 -> IO ()
writeWord32OffForeignObj fo i w = _casm_ `` (((Stg
Nat16
*)%0)[(StgInt)%1])=(Stg
Nat16
)%2; '' fo i' w
writeWord32OffForeignObj fo i w = _casm_ `` (((Stg
Word32
*)%0)[(StgInt)%1])=(Stg
Word32
)%2; '' fo i' w
where
-- adjust index to be in Word units, not Word32 ones.
i'
...
...
@@ -1412,7 +1412,7 @@ writeWord64OffForeignObj :: ForeignObj -> Int -> Word64 -> IO ()
# if WORD_SIZE_IN_BYTES==8
writeWord64OffForeignObj fo i e = _casm_ `` (((StgWord*)%0)[(StgInt)%1])=(StgWord)%2; '' fo i e
# else
writeWord64OffForeignObj fo i e = _casm_ `` (((Stg
Nat
64*)%0)[(StgInt)%1])=(Stg
Nat
64)%2; '' fo i e
writeWord64OffForeignObj fo i e = _casm_ `` (((Stg
Word
64*)%0)[(StgInt)%1])=(Stg
Word
64)%2; '' fo i e
# endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment