Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
3c765019
Commit
3c765019
authored
Sep 24, 2005
by
wolfgang
Browse files
[project @ 2005-09-24 02:15:32 by wolfgang]
PowerPC: track changes in the rest of the register allocator
parent
4d5a0088
Changes
1
Hide whitespace changes
Inline
Side-by-side
ghc/compiler/nativeGen/RegisterAlloc.hs
View file @
3c765019
...
...
@@ -157,7 +157,10 @@ allocateReg f r = filter (/= r) f
data
FreeRegs
=
FreeRegs
!
Word32
!
Word32
noFreeRegs
::
FreeRegs
noFreeRegs
=
FreeRegs
0
0
releaseReg
::
RegNo
->
FreeRegs
->
FreeRegs
releaseReg
r
(
FreeRegs
g
f
)
|
r
>
31
=
FreeRegs
g
(
f
.|.
(
1
`
shiftL
`
(
fromIntegral
r
-
32
)))
|
otherwise
=
FreeRegs
(
g
.|.
(
1
`
shiftL
`
fromIntegral
r
))
f
...
...
@@ -165,6 +168,7 @@ releaseReg r (FreeRegs g f)
initFreeRegs
::
FreeRegs
initFreeRegs
=
foldr
releaseReg
noFreeRegs
allocatableRegs
getFreeRegs
::
RegClass
->
FreeRegs
->
[
RegNo
]
-- lazilly
getFreeRegs
cls
(
FreeRegs
g
f
)
|
RcDouble
<-
cls
=
go
f
(
0x80000000
)
63
|
RcInteger
<-
cls
=
go
g
(
0x80000000
)
31
...
...
@@ -173,7 +177,8 @@ getFreeRegs cls (FreeRegs g f)
go
x
m
i
|
x
.&.
m
/=
0
=
i
:
(
go
x
(
m
`
shiftR
`
1
)
$!
i
-
1
)
|
otherwise
=
go
x
(
m
`
shiftR
`
1
)
$!
i
-
1
allocateReg
(
FreeRegs
g
f
)
r
allocateReg
::
RegNo
->
FreeRegs
->
FreeRegs
allocateReg
r
(
FreeRegs
g
f
)
|
r
>
31
=
FreeRegs
g
(
f
.&.
complement
(
1
`
shiftL
`
(
fromIntegral
r
-
32
)))
|
otherwise
=
FreeRegs
(
g
.&.
complement
(
1
`
shiftL
`
fromIntegral
r
))
f
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment