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
362
Merge Requests
362
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
4b357e2a
Commit
4b357e2a
authored
Feb 09, 2010
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate slightly better code for ccall argument-pushing on x86
parent
92907d5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
compiler/nativeGen/X86/CodeGen.hs
compiler/nativeGen/X86/CodeGen.hs
+14
-16
No files found.
compiler/nativeGen/X86/CodeGen.hs
View file @
4b357e2a
...
...
@@ -1575,7 +1575,7 @@ genCCall target dest_regs args = do
return
(
unitOL
(
CALL
(
Left
fn_imm
)
[]
),
conv
)
where
fn_imm
=
ImmCLbl
lbl
CmmCallee
expr
conv
->
do
{
(
dyn_
c
,
dyn_r
)
<-
get_op
expr
->
do
{
(
dyn_
r
,
dyn_c
)
<-
getSomeReg
expr
;
ASSERT
(
isWord32
(
cmmExprType
expr
)
)
return
(
dyn_c
`
snocOL
`
CALL
(
Right
dyn_r
)
[]
,
conv
)
}
...
...
@@ -1655,13 +1655,11 @@ genCCall target dest_regs args = do
DELTA
(
delta
-
8
)]
)
|
otherwise
=
do
(
code
,
reg
)
<-
get_op
arg
|
isFloatType
arg_ty
=
do
(
reg
,
code
)
<-
getSomeReg
arg
delta
<-
getDeltaNat
let
size
=
arg_size
arg_ty
-- Byte size
setDeltaNat
(
delta
-
size
)
if
(
isFloatType
arg_ty
)
then
return
(
code
`
appOL
`
return
(
code
`
appOL
`
toOL
[
SUB
II32
(
OpImm
(
ImmInt
size
))
(
OpReg
esp
),
DELTA
(
delta
-
size
),
let
addr
=
AddrBaseIndex
(
EABaseReg
esp
)
...
...
@@ -1674,18 +1672,18 @@ genCCall target dest_regs args = do
else
GST
size
reg
addr
]
)
else
return
(
code
`
snocOL
`
PUSH
II32
(
OpReg
reg
)
`
snocOL
`
DELTA
(
delta
-
size
)
)
|
otherwise
=
do
(
operand
,
code
)
<-
getOperand
arg
delta
<-
getDeltaNat
setDeltaNat
(
delta
-
size
)
return
(
code
`
snocOL
`
PUSH
II32
operand
`
snocOL
`
DELTA
(
delta
-
size
))
where
arg_ty
=
cmmExprType
arg
------------
get_op
::
CmmExpr
->
NatM
(
InstrBlock
,
Reg
)
-- code, reg
get_op
op
=
do
(
reg
,
code
)
<-
getSomeReg
op
return
(
code
,
reg
)
size
=
arg_size
arg_ty
-- Byte size
#
elif
x86_64_TARGET_ARCH
...
...
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