]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/compiler/cfg/linear-scan/resolve/resolve-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / compiler / cfg / linear-scan / resolve / resolve-tests.factor
index 3e98d6c9f09abca261d9f2449ec2fd311dac86e9..47c1f0ae76e673c6bc0b211708494cd933bf33e7 100644 (file)
@@ -1,65 +1,67 @@
-USING: accessors arrays compiler.cfg compiler.cfg.instructions
-compiler.cfg.linear-scan.debugger
-compiler.cfg.linear-scan.live-intervals
-compiler.cfg.linear-scan.numbering
-compiler.cfg.linear-scan.resolve compiler.cfg.predecessors
-compiler.cfg.registers compiler.cfg.rpo cpu.architecture kernel
-namespaces tools.test vectors ;
+USING: compiler.cfg.linear-scan.resolve tools.test kernel namespaces
+accessors
+compiler.cfg
+compiler.cfg.instructions cpu.architecture make sequences
+compiler.cfg.linear-scan.allocation.state ;
 IN: compiler.cfg.linear-scan.resolve.tests
 
-[ { 1 2 3 4 5 6 } ] [
-    { 3 4 } V{ 1 2 } clone [ { 5 6 } 3append-here ] keep >array
+[
+    {
+        { { T{ spill-slot f 0 } int-rep } { 1 int-rep } }
+    }
+] [
+    [
+        0 <spill-slot> 1 int-rep add-mapping
+    ] { } make
 ] unit-test
 
-V{
-    T{ ##peek f V int-regs 0 D 0 }
-    T{ ##branch }
-} 0 test-bb
-
-V{
-    T{ ##replace f V int-regs 0 D 1 }
-    T{ ##return }
-} 1 test-bb
-
-1 get 1vector 0 get (>>successors)
-
-cfg new 0 get >>entry
-compute-predecessors
-dup reverse-post-order number-instructions
-drop
-
-CONSTANT: test-live-interval-1
-T{ live-interval
-   { start 0 }
-   { end 6 }
-   { uses V{ 0 6 } }
-   { ranges V{ T{ live-range f 0 2 } T{ live-range f 4 6 } } }
-   { spill-to 0 }
-   { vreg V int-regs 0 }
-}
+[
+    {
+        T{ _reload { dst 1 } { rep int-rep } { n 0 } }
+    }
+] [
+    [
+        { T{ spill-slot f 0 } int-rep } { 1 int-rep } >insn
+    ] { } make
+] unit-test
 
-[ f ] [
-    0 get test-live-interval-1 spill-to
+[
+    {
+        T{ _spill { src 1 } { rep int-rep } { n 0 } }
+    }
+] [
+    [
+        { 1 int-rep } { T{ spill-slot f 0 } int-rep } >insn
+    ] { } make
 ] unit-test
 
-[ 0 ] [
-    1 get test-live-interval-1 spill-to
+[
+    {
+        T{ ##copy { src 1 } { dst 2 } { rep int-rep } }
+    }
+] [
+    [
+        { 1 int-rep } { 2 int-rep } >insn
+    ] { } make
 ] unit-test
 
-CONSTANT: test-live-interval-2
-T{ live-interval
-   { start 0 }
-   { end 6 }
-   { uses V{ 0 6 } }
-   { ranges V{ T{ live-range f 0 2 } T{ live-range f 4 6 } } }
-   { reload-from 0 }
-   { vreg V int-regs 0 }
-}
+cfg new 8 >>spill-area-size cfg set
+H{ } clone spill-temps set
 
-[ 0 ] [
-    0 get test-live-interval-2 reload-from
+[
+    t
+] [
+    { { { 0 int-rep } { 1 int-rep } } { { 1 int-rep } { 0 int-rep } } }
+    mapping-instructions {
+        {
+            T{ _spill { src 0 } { rep int-rep } { n 8 } }
+            T{ ##copy { dst 0 } { src 1 } { rep int-rep } }
+            T{ _reload { dst 1 } { rep int-rep } { n 8 } }
+        }
+        {
+            T{ _spill { src 1 } { rep int-rep } { n 8 } }
+            T{ ##copy { dst 1 } { src 0 } { rep int-rep } }
+            T{ _reload { dst 0 } { rep int-rep } { n 8 } }
+        }
+    } member?
 ] unit-test
-
-[ f ] [
-    1 get test-live-interval-2 reload-from
-] unit-test
\ No newline at end of file