summaryrefslogtreecommitdiff
path: root/chapter21/src/test/java/com
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2025-03-14 16:48:07 -0700
committerCliff Click <cliffc@acm.org>2025-03-14 16:48:07 -0700
commita36369843133a170718006600890d12ceb66a553 (patch)
tree9be3c5db0a6a2092ee398841fb6372a5b6455a4a /chapter21/src/test/java/com
parent3fa376db5d05d738b6e1b6d01680ca5bfd79962d (diff)
downloadSimple-a36369843133a170718006600890d12ceb66a553.tar.gz
Simple-a36369843133a170718006600890d12ceb66a553.zip
Buncha encoding related fixes.
RA cloning `CmpIxxx` stretches the input live range, new for cloning... and was making broken graph. Several cloning related bugs in RISC & ARM. Invariant around RA cloning vs InstSelect is too complex
Diffstat (limited to 'chapter21/src/test/java/com')
-rw-r--r--chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java9
-rw-r--r--chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java2
2 files changed, 6 insertions, 5 deletions
diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java
index bf2daf8f..7f5cabc4 100644
--- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java
+++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter20Test.java
@@ -23,6 +23,7 @@ public class Chapter20Test {
code.parse().opto().typeCheck().instSelect(PORTS,cpu,os).GCM().localSched().regAlloc();
int delta = spills>>3;
if( delta==0 ) delta = 1;
+ code.asm();
assertEquals("Expect spills:",spills,code._regAlloc._spillScaled,delta);
if( stop != null )
assertEquals(stop, code._stop.toString());
@@ -42,7 +43,7 @@ public class Chapter20Test {
String src = "return arg | 2;";
testCPU(src,"x86_64_v2", "SystemV",1,"return (ori,mov(arg));");
testCPU(src,"riscv" , "SystemV",0,"return ( arg | #2 );");
- testCPU(src,"arm" , "SystemV",0,"return (orr,arg,2);");
+ testCPU(src,"arm" , "SystemV",0,"return (or,arg,2);");
}
@Test
@@ -62,7 +63,7 @@ return sqrt(arg) + sqrt(arg+2);
""";
testCPU(src,"x86_64_v2", "SystemV",26,null);
testCPU(src,"riscv" , "SystemV",19,null);
- testCPU(src,"arm" , "SystemV",26,null);
+ testCPU(src,"arm" , "SystemV",17,null);
}
@Test
@@ -82,7 +83,7 @@ flt farg = arg;
return sqrt(farg) + sqrt(farg+2.0);
""";
testCPU(src,"x86_64_v2", "SystemV",25,null);
- testCPU(src,"riscv" , "SystemV",21,null);
+ testCPU(src,"riscv" , "SystemV",17,null);
testCPU(src,"arm" , "SystemV",18,null);
}
@@ -107,7 +108,7 @@ return ary[1] * 1000 + ary[3]; // 1 * 1000 + 6
""";
testCPU(src,"x86_64_v2", "SystemV",3,"return .[];");
testCPU(src,"riscv" , "SystemV",1,"return (add,.[],(mul,.[],1000));");
- testCPU(src,"arm" , "SystemV",1,"return (add,.[],(muli,.[]));");
+ testCPU(src,"arm" , "SystemV",1,"return (add,.[],(mul,.[],1000));");
}
@Test
diff --git a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
index b0596385..770c7165 100644
--- a/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
+++ b/chapter21/src/test/java/com/seaofnodes/simple/Chapter21Test.java
@@ -39,7 +39,7 @@ public class Chapter21Test {
String src = "return arg | 2;";
testCPU(src,"x86_64_v2", "SystemV",1,"return (ori,mov(arg));");
testCPU(src,"riscv" , "SystemV",0,"return ( arg | #2 );");
- testCPU(src,"arm" , "SystemV",0,"return (orr,arg,2);");
+ testCPU(src,"arm" , "SystemV",0,"return (or,arg,2);");
}
}