From 8d6de0e10358fc197490cdacb10cbcedc18bb4f6 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 23 Mar 2025 15:59:23 -0700 Subject: Coalesacing Fix bug IFG adding interference to from 1 reg live range, even if success in clearing reg Fix bug LRG merging when both masks have already been trimmed. Missing ARM stack adjust --- .../src/test/java/com/seaofnodes/simple/BrainFuckTest.java | 2 +- .../src/test/java/com/seaofnodes/simple/Chapter20Test.java | 12 ++++++------ .../src/test/java/com/seaofnodes/simple/Chapter21Test.java | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'chapter21/src/test/java/com') diff --git a/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java b/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java index 28111697..eb88ecc1 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/BrainFuckTest.java @@ -65,7 +65,7 @@ return output; """; Chapter21Test.testCPU(src,"x86_64_v2", "SystemV",40,null); Chapter21Test.testCPU(src,"riscv" , "SystemV",30,null); - Chapter21Test.testCPU(src,"arm" , "SystemV",30,null); + Chapter21Test.testCPU(src,"arm" , "SystemV",26,null); //assertEquals("Hello World!\n", Eval2.eval(code, 0, 10000)); } } diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java index 1a08d6ee..b83db0d1 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java @@ -40,8 +40,8 @@ public class Chapter20Test { @Test public void testAlloc0() { testCPU("return new u8[arg];","x86_64_v2", "SystemV",3,"return [u8];"); - testCPU("return new u8[arg];","riscv" , "SystemV",7,"return [u8];"); - testCPU("return new u8[arg];","arm" , "SystemV",7,"return [u8];"); + testCPU("return new u8[arg];","riscv" , "SystemV",5,"return [u8];"); + testCPU("return new u8[arg];","arm" , "SystemV",5,"return [u8];"); } @Test public void testBasic1() { @@ -66,9 +66,9 @@ val sqrt = { int x -> }; return sqrt(arg) + sqrt(arg+2); """; - testCPU(src,"x86_64_v2", "SystemV",26,null); + testCPU(src,"x86_64_v2", "SystemV",23,null); testCPU(src,"riscv" , "SystemV",19,null); - testCPU(src,"arm" , "SystemV",17,null); + testCPU(src,"arm" , "SystemV",19,null); } @Test @@ -85,7 +85,7 @@ return sqrt(arg) + sqrt(arg+2); String src = "int[] !xs = new int[3]; xs[arg]=1; return xs[arg&1];"; testCPU(src,"x86_64_v2", "SystemV",3,"return .[];"); testCPU(src,"riscv" , "SystemV",6,"return .[];"); - testCPU(src,"arm" , "SystemV",6,"return .[];"); + testCPU(src,"arm" , "SystemV",4,"return .[];"); } @@ -103,7 +103,7 @@ return sqrt(arg) + sqrt(arg+2); public void testString() throws IOException { String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/stringHash.smp")); testCPU(src,"x86_64_v2", "SystemV",18,null); - testCPU(src,"riscv" , "SystemV",17,null); + testCPU(src,"riscv" , "SystemV",20,null); testCPU(src,"arm" , "SystemV",16,null); } diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java index cb55c033..e3b69593 100644 --- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java +++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java @@ -48,9 +48,9 @@ public class Chapter21Test { public void testNewtonFloat() throws IOException { String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/newtonFloat.smp")) + "flt farg = arg; return sqrt(farg) + sqrt(farg+2.0);"; - testCPU(src,"x86_64_v2", "SystemV",25,null); - testCPU(src,"riscv" , "SystemV",17,null); - testCPU(src,"arm" , "SystemV",18,null); + testCPU(src,"x86_64_v2", "SystemV",23,null); + testCPU(src,"riscv" , "SystemV",18,null); + testCPU(src,"arm" , "SystemV",19,null); } @Test @@ -65,7 +65,7 @@ public class Chapter21Test { public void testArray1() throws IOException { String src = Files.readString(Path.of("src/test/java/com/seaofnodes/simple/progs/array1.smp")); testCPU(src,"x86_64_v2", "SystemV",7,"return .[];"); - testCPU(src,"riscv" , "SystemV",9,"return (add,.[],(mul,.[],1000));"); + testCPU(src,"riscv" , "SystemV",7,"return (add,.[],(mul,.[],1000));"); testCPU(src,"arm" , "SystemV",5,"return (add,.[],(mul,.[],1000));"); } -- cgit v1.2.3