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
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
sheaf
GHC
Commits
738e2f12
Commit
738e2f12
authored
11 years ago
by
Jan Stolarek
Browse files
Options
Downloads
Patches
Plain Diff
Trailing whitespaces
parent
94125c97
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/cmm/CmmOpt.hs
+4
-5
4 additions, 5 deletions
compiler/cmm/CmmOpt.hs
with
4 additions
and
5 deletions
compiler/cmm/CmmOpt.hs
+
4
−
5
View file @
738e2f12
...
...
@@ -51,7 +51,7 @@ cmmMachOpFoldM _ op [CmmLit (CmmInt x rep)]
MO_S_Neg
_
->
CmmLit
(
CmmInt
(
-
x
)
rep
)
MO_Not
_
->
CmmLit
(
CmmInt
(
complement
x
)
rep
)
-- these are interesting: we must first narrow to the
-- these are interesting: we must first narrow to the
-- "from" type, in order to truncate to the correct size.
-- The final narrow/widen to the destination type
-- is implicit in the CmmLit.
...
...
@@ -87,7 +87,7 @@ cmmMachOpFoldM dflags conv_outer [CmmMachOp conv_inner [x]]
|
otherwise
->
Nothing
where
isIntConversion
(
MO_UU_Conv
rep1
rep2
)
isIntConversion
(
MO_UU_Conv
rep1
rep2
)
=
Just
(
rep1
,
rep2
,
False
)
isIntConversion
(
MO_SS_Conv
rep1
rep2
)
=
Just
(
rep1
,
rep2
,
True
)
...
...
@@ -318,7 +318,7 @@ cmmMachOpFoldM dflags mop [x, (CmmLit (CmmInt n _))]
|
Just
p
<-
exactLog2
n
->
Just
(
cmmMachOpFold
dflags
(
MO_U_Shr
rep
)
[
x
,
CmmLit
(
CmmInt
p
rep
)])
MO_S_Quot
rep
|
Just
p
<-
exactLog2
n
,
|
Just
p
<-
exactLog2
n
,
CmmReg
_
<-
x
->
-- We duplicate x below, hence require
-- it is a reg. FIXME: remove this restriction.
-- shift right is not the same as quot, because it rounds
...
...
@@ -362,7 +362,7 @@ cmmMachOpFoldM _ _ _ = Nothing
-- This algorithm for determining the $\log_2$ of exact powers of 2 comes
-- from GCC. It requires bit manipulation primitives, and we use GHC
-- extensions. Tough.
--
--
-- Used to be in MachInstrs --SDM.
-- ToDo: remove use of unboxery --SDM.
...
...
@@ -449,4 +449,3 @@ isComparisonExpr _ = False
isPicReg
::
CmmExpr
->
Bool
isPicReg
(
CmmReg
(
CmmGlobal
PicBaseReg
))
=
True
isPicReg
_
=
False
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