Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,321
Issues
4,321
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
366
Merge Requests
366
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
3cc8487e
Commit
3cc8487e
authored
Jan 24, 2006
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the par# primop actually do something
parent
33482c15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
ghc/compiler/codeGen/CgPrimOp.hs
ghc/compiler/codeGen/CgPrimOp.hs
+18
-2
No files found.
ghc/compiler/codeGen/CgPrimOp.hs
View file @
3cc8487e
...
...
@@ -10,21 +10,25 @@ module CgPrimOp (
cgPrimOp
)
where
#
include
"HsVersions.h"
import
ForeignCall
(
CCallConv
(
CCallConv
)
)
import
StgSyn
(
StgLiveVars
,
StgArg
)
import
CgBindery
(
getVolatileRegs
,
getArgAmodes
)
import
CgMonad
import
CgInfoTbls
(
getConstrTag
)
import
CgUtils
(
cmmOffsetW
,
cmmOffsetB
,
cmmLoadIndexW
)
import
ForeignCall
import
Cmm
import
CLabel
(
mkMAP_FROZEN_infoLabel
,
mkMAP_DIRTY_infoLabel
,
mkDirty_MUT_VAR_Label
)
mkDirty_MUT_VAR_Label
,
mkRtsCodeLabel
)
import
CmmUtils
import
MachOp
import
SMRep
import
PrimOp
(
PrimOp
(
..
)
)
import
SMRep
(
tablesNextToCode
)
import
Constants
(
wORD_SIZE
,
wORD_SIZE_IN_BITS
)
import
StaticFlags
(
opt_Parallel
,
opt_SMP
)
import
Outputable
-- ---------------------------------------------------------------------------
...
...
@@ -109,7 +113,19 @@ emitPrimOp [res_r,res_c] IntSubCOp [aa,bb] live
emitPrimOp
[
res
]
ParOp
[
arg
]
live
=
stmtC
(
CmmAssign
res
(
CmmLit
(
mkIntCLit
1
)))
|
not
(
opt_Parallel
||
opt_SMP
)
=
stmtC
(
CmmAssign
res
(
CmmLit
(
mkIntCLit
1
)))
|
otherwise
=
do
-- for now, just implement this in a C function
-- later, we might want to inline it.
vols
<-
getVolatileRegs
live
stmtC
(
CmmCall
(
CmmForeignCall
newspark
CCallConv
)
[(
res
,
NoHint
)]
[(
CmmReg
(
CmmGlobal
BaseReg
),
PtrHint
),
(
arg
,
PtrHint
)]
(
Just
vols
))
where
newspark
=
CmmLit
(
CmmLabel
(
mkRtsCodeLabel
SLIT
(
"newSpark"
)))
emitPrimOp
[
res
]
ReadMutVarOp
[
mutv
]
live
=
stmtC
(
CmmAssign
res
(
cmmLoadIndexW
mutv
fixedHdrSize
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment