summaryrefslogtreecommitdiff
path: root/chapter22/src/main
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2025-05-10 10:10:24 -0700
committerCliff Click <cliffc@acm.org>2025-05-10 10:10:24 -0700
commitb4eb623979cc9566d2a22c718b4ba8ded3bca5a4 (patch)
tree7216d86a803d74b2d0a61f69d198a03bc0172b88 /chapter22/src/main
parent9112455cf661a2173edf11ef57e29935a1f4e9a8 (diff)
downloadSimple-b4eb623979cc9566d2a22c718b4ba8ded3bca5a4.tar.gz
Simple-b4eb623979cc9566d2a22c718b4ba8ded3bca5a4.zip
clean up tests
BubbleSort is complete but ugly risc5 encoding <= test EvalR5/Arm handles stdout/stderr.
Diffstat (limited to 'chapter22/src/main')
-rw-r--r--chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/XorIRISC.java1
-rw-r--r--chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/riscv.java2
2 files changed, 2 insertions, 1 deletions
diff --git a/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/XorIRISC.java b/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/XorIRISC.java
index 61f25be2..27098033 100644
--- a/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/XorIRISC.java
+++ b/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/XorIRISC.java
@@ -5,6 +5,7 @@ import com.seaofnodes.simple.node.Node;
public class XorIRISC extends ImmRISC {
public XorIRISC( Node and, int imm) { super(and,imm); }
+ public XorIRISC( Node and, int imm, boolean pop) { super(and,imm,pop); }
@Override int opcode() { return riscv.OP_IMM; }
@Override int func3() { return 4; }
@Override public String glabel() { return "^"; }
diff --git a/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/riscv.java b/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/riscv.java
index 8e722563..3b8ff100 100644
--- a/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/riscv.java
+++ b/chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/riscv.java
@@ -420,7 +420,7 @@ public class riscv extends Machine {
? new SetIRISC(bool, (int)ti.value(),false)
: new SetRISC(bool, false);
// x <= y - flip and negate; !(y < x); `slt tmp=y,x; xori dst=tmp,#1`
- case "<=" -> new XorIRISC(new SetRISC(bool.swap12(), false),1);
+ case "<=" -> new XorIRISC(new SetRISC(bool.swap12(), false),1,false);
// x == y - sub and vs0 == `sub tmp=x-y; sltu dst=tmp,#1`
case "==" -> new SetIRISC(new SubRISC(bool),1,true);
default -> throw Utils.TODO();