Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Haley Sapphie Owsianko
ACC-project
Commits
e9c08c8d
Commit
e9c08c8d
authored
Mar 24, 2021
by
Sapphie
Browse files
Minor fixes
parent
1cd050ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/src/l3/CPSValueRepresenter.scala
View file @
e9c08c8d
...
...
@@ -31,7 +31,7 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
case
_
=>
throw
new
Exception
(
"Unimplemented: "
+
tree
.
getClass
.
toString
)
}
private
def
transformIf
(
cond
:
L3
,
args
:
Seq
[
H.Atom
],
thenC
:
H.Name
,
elseC
:
H.Name
)
:
L.Tree
=
{
private
def
transformIf
(
cond
:
L3
TestPrimitive
,
args
:
Seq
[
H.Atom
],
thenC
:
H.Name
,
elseC
:
H.Name
)
:
L.Tree
=
{
def
maskAndCheck
(
numBits
:
Int
,
target
:
Bits32
)
:
L.LetP
=
{
val
Seq
(
x
)
=
args
tempLetP
(
CPS
.
And
,
Seq
(
Left
(
x
),
getMaskR
(
numBits
)))
{
x1
=>
...
...
@@ -52,6 +52,9 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
maskAndCheck
(
3
,
0x6
)
case
L3
.
Eq
=>
L
.
If
(
CPST
.
Eq
,
args
.
map
(
rewrite
),
thenC
,
elseC
)
case
L3
.
IntLe
=>
???
case
L3
.
IntLt
=>
???
}
}
...
...
@@ -60,6 +63,7 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
private
def
getMaskR
(
numBits
:
Int
)
:
Either
[
H.Atom
,
L.Atom
]
=
Right
(
L
.
AtomL
((
1
<<
numBits
)
-
1
))
/*
// Only to be used in cases where you can be reasonably sure you're
// dealing with integers
private def lit2Int(l: CL3Literal): Int = {
...
...
@@ -69,7 +73,6 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
}
}
/*
private def addrConv(x: H.Atom): L.Atom = {
x match {
case H.AtomL(l) => L.AtomL(lit2Int(l))
...
...
@@ -122,6 +125,7 @@ object CPSValueRepresenter extends (H.Tree => L.Tree) {
}
}
}
prim
match
{
case
L3
.
BlockGet
=>
// In theory, x has to be a name, since there cannot be pointer literals
...
...
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