summaryrefslogtreecommitdiff
path: root/condense/CondenseVisitor.java
diff options
context:
space:
mode:
authorbd-912 <bdunahu@colostate.edu>2024-05-07 19:16:48 -0600
committerbd-912 <bdunahu@colostate.edu>2024-05-07 19:16:48 -0600
commite4f89099939c9f61818ecff2d3ca48580f461e61 (patch)
tree5bcaf7438f37bf14d860d55a56bc6049b4c6cdaf /condense/CondenseVisitor.java
parentaaafaee0d5f8eafff3680f5443e6e8a66d7a2545 (diff)
Condense all tests passed
Diffstat (limited to 'condense/CondenseVisitor.java')
-rw-r--r--condense/CondenseVisitor.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/condense/CondenseVisitor.java b/condense/CondenseVisitor.java
index 3ded2e8..436ddfa 100644
--- a/condense/CondenseVisitor.java
+++ b/condense/CondenseVisitor.java
@@ -178,15 +178,15 @@ public class CondenseVisitor extends VInstr.Visitor<RuntimeException>{
}
if (op.equals("Add"))
- ret += " add";
+ ret += " addu";
else if (op.equals("Sub"))
- ret += " sub";
+ ret += " subu";
else if (op.equals("MulS"))
ret += " mul";
else if (op.equals("Eq"))
- ret += " and";
+ ret += " seq";
else if (op.equals("Lt"))
- ret += " slt";
+ ret += " sltu";
else if (op.equals("LtS"))
ret += " slt";
else if (op.equals("PrintIntS")) {
@@ -287,9 +287,9 @@ public class CondenseVisitor extends VInstr.Visitor<RuntimeException>{
///////////////////////////////////////////////////////////////
String ret = " ";
if (n.positive)
- ret += "bnez ";
+ ret += "bgtz ";
else
- ret += "beqz ";
+ ret += "blez ";
ret += n.value.toString()
+ " ";