Commit e9c08c8d authored by Sapphie's avatar Sapphie
Browse files

Minor fixes

parent 1cd050ac
......@@ -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: L3TestPrimitive, 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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment