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
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
Alexander Kaznacheev
GHC
Commits
bee6f865
Commit
bee6f865
authored
13 years ago
by
Erik de Castro Lopo
Committed by
pcapriotti
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
PPC: Handle right shift of > 31 bits. Fix #5999.
MERGED from commit 42c8e80165bb087493b95a768bbbf276870c7056
parent
02b08d96
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/nativeGen/PPC/Ppr.hs
+10
-3
10 additions, 3 deletions
compiler/nativeGen/PPC/Ppr.hs
with
10 additions
and
3 deletions
compiler/nativeGen/PPC/Ppr.hs
+
10
−
3
View file @
bee6f865
...
@@ -587,7 +587,14 @@ pprInstr platform (NEG reg1 reg2) = pprUnary platform (sLit "neg") reg1 reg2
...
@@ -587,7 +587,14 @@ pprInstr platform (NEG reg1 reg2) = pprUnary platform (sLit "neg") reg1 reg2
pprInstr
platform
(
NOT
reg1
reg2
)
=
pprUnary
platform
(
sLit
"not"
)
reg1
reg2
pprInstr
platform
(
NOT
reg1
reg2
)
=
pprUnary
platform
(
sLit
"not"
)
reg1
reg2
pprInstr
platform
(
SLW
reg1
reg2
ri
)
=
pprLogic
platform
(
sLit
"slw"
)
reg1
reg2
(
limitShiftRI
ri
)
pprInstr
platform
(
SLW
reg1
reg2
ri
)
=
pprLogic
platform
(
sLit
"slw"
)
reg1
reg2
(
limitShiftRI
ri
)
pprInstr
platform
(
SRW
reg1
reg2
(
RIImm
(
ImmInt
i
)))
|
i
>
31
||
i
<
0
=
-- Handle the case where we are asked to shift a 32 bit register by
-- less than zero or more than 31 bits. We convert this into a clear
-- of the destination register.
pprInstr
platform
(
XOR
reg1
reg2
(
RIReg
reg2
))
pprInstr
platform
(
SRW
reg1
reg2
ri
)
=
pprLogic
platform
(
sLit
"srw"
)
reg1
reg2
(
limitShiftRI
ri
)
pprInstr
platform
(
SRW
reg1
reg2
ri
)
=
pprLogic
platform
(
sLit
"srw"
)
reg1
reg2
(
limitShiftRI
ri
)
pprInstr
platform
(
SRAW
reg1
reg2
ri
)
=
pprLogic
platform
(
sLit
"sraw"
)
reg1
reg2
(
limitShiftRI
ri
)
pprInstr
platform
(
SRAW
reg1
reg2
ri
)
=
pprLogic
platform
(
sLit
"sraw"
)
reg1
reg2
(
limitShiftRI
ri
)
pprInstr
platform
(
RLWINM
reg1
reg2
sh
mb
me
)
=
hcat
[
pprInstr
platform
(
RLWINM
reg1
reg2
sh
mb
me
)
=
hcat
[
ptext
(
sLit
"
\t
rlwinm
\t
"
),
ptext
(
sLit
"
\t
rlwinm
\t
"
),
...
@@ -705,9 +712,9 @@ pprFSize FF64 = empty
...
@@ -705,9 +712,9 @@ pprFSize FF64 = empty
pprFSize
FF32
=
char
's'
pprFSize
FF32
=
char
's'
pprFSize
_
=
panic
"PPC.Ppr.pprFSize: no match"
pprFSize
_
=
panic
"PPC.Ppr.pprFSize: no match"
-- limit immediate argument for shift instruction to range 0..32
-- limit immediate argument for shift instruction to range 0..31
-- (yes, the maximum is really 32, not 31)
limitShiftRI
::
RI
->
RI
limitShiftRI
::
RI
->
RI
limitShiftRI
(
RIImm
(
ImmInt
i
))
|
i
>
32
||
i
<
0
=
RIImm
(
ImmInt
32
)
limitShiftRI
(
RIImm
(
ImmInt
i
))
|
i
>
31
||
i
<
0
=
panic
$
"PPC.Ppr: Shift by "
++
show
i
++
" bits is not allowed."
limitShiftRI
x
=
x
limitShiftRI
x
=
x
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