diff options
| author | Cliff Click <cliffc@acm.org> | 2025-05-10 10:10:24 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-05-10 10:10:24 -0700 |
| commit | b4eb623979cc9566d2a22c718b4ba8ded3bca5a4 (patch) | |
| tree | 7216d86a803d74b2d0a61f69d198a03bc0172b88 /chapter22/src/main/java/com | |
| parent | 9112455cf661a2173edf11ef57e29935a1f4e9a8 (diff) | |
| download | Simple-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/java/com')
| -rw-r--r-- | chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/XorIRISC.java | 1 | ||||
| -rw-r--r-- | chapter22/src/main/java/com/seaofnodes/simple/node/cpus/riscv/riscv.java | 2 |
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(); |
