Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
test-primops
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Glasgow Haskell Compiler
test-primops
Merge requests
!14
Draft: Fix RunGhc for i386 and GHC >=9.4
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: Fix RunGhc for i386 and GHC >=9.4
i386
into
master
Overview
1
Commits
2
Pipelines
3
Changes
2
Closed
Jaro Reinders
requested to merge
i386
into
master
1 year ago
Overview
1
Commits
2
Pipelines
3
Changes
2
Expand
0
0
Merge request reports
Compare
master
version 2
895cdbc7
1 year ago
version 1
b660dd25
1 year ago
master (base)
and
latest version
latest version
e631cf6b
2 commits,
1 year ago
version 2
895cdbc7
2 commits,
1 year ago
version 1
b660dd25
1 commit,
1 year ago
2 files
+
5
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/RunGhc.hs
+
5
−
9
Options
@@ -80,8 +80,8 @@ mkStaticWrapper comp width = do
,
"{-# LANGUAGE UnliftedFFITypes #-}"
,
"{-# LANGUAGE MagicHash #-}"
,
"module Main where"
,
"import Data.Word"
,
"import GHC.Exts"
,
"import GHC.Word"
,
"import GHC.Ptr (Ptr(Ptr))"
,
"import qualified Data.ByteString as BS"
,
"import qualified Data.ByteString.Unsafe as BS"
@@ -89,21 +89,17 @@ mkStaticWrapper comp width = do
,
"main :: IO ()"
,
"main = do"
,
" buf <- BS.readFile
\"
test
\"
"
,
" BS.unsafeUseAsCString buf $
\\
(Ptr p) -> print $ "
<>
to
Hs
Word
width
"test p"
,
" BS.unsafeUseAsCString buf $
\\
(Ptr p) -> print $ "
<>
to
Boxed
Word
width
"test p"
]
hsType
::
Width
->
String
hsType
W8
=
"Word8#"
hsType
W16
=
"Word16#"
hsType
W32
=
"Word32#"
hsType
W64
=
"Word#"
hsType
W64
=
"Word
64
#"
toHsWord
::
Width
->
String
->
String
toHsWord
w
x
=
"W# "
<>
parens
(
extendFn
<>
" "
<>
parens
x
)
where
extendFn
|
w
==
W64
=
""
|
otherwise
=
"extendWord"
<>
show
(
widthBits
w
)
<>
"#"
toBoxedWord
::
Width
->
String
->
String
toBoxedWord
w
x
=
"W"
<>
show
(
widthBits
w
)
<>
"#"
<>
parens
x
evalCmm
::
EvalMethod
->
Cmm
->
IO
Natural
evalCmm
em
cmm
=
do
Loading