]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/parallel-copy/parallel-copy-tests.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / basis / compiler / cfg / parallel-copy / parallel-copy-tests.factor
1 USING: compiler.cfg.parallel-copy tools.test make arrays
2 compiler.cfg.registers namespaces compiler.cfg.instructions
3 cpu.architecture ;
4 IN: compiler.cfg.parallel-copy.tests
5
6 SYMBOL: temp
7
8 : test-parallel-copy ( mapping -- seq )
9     3 vreg-counter set-global
10     [ parallel-copy ] { } make ;
11
12 [
13     {
14         T{ ##copy f V int-regs 4 V int-regs 2 }
15         T{ ##copy f V int-regs 2 V int-regs 1 }
16         T{ ##copy f V int-regs 1 V int-regs 4 }
17     }
18 ] [
19     H{
20         { V int-regs 1 V int-regs 2 }
21         { V int-regs 2 V int-regs 1 }
22     } test-parallel-copy
23 ] unit-test
24
25 [
26     {
27         T{ ##copy f V int-regs 1 V int-regs 2 }
28         T{ ##copy f V int-regs 3 V int-regs 4 }
29     }
30 ] [
31     H{
32         { V int-regs 1 V int-regs 2 }
33         { V int-regs 3 V int-regs 4 }
34     } test-parallel-copy
35 ] unit-test
36
37 [
38     {
39         T{ ##copy f V int-regs 1 V int-regs 3 }
40         T{ ##copy f V int-regs 2 V int-regs 1 }
41     }
42 ] [
43     H{
44         { V int-regs 1 V int-regs 3 }
45         { V int-regs 2 V int-regs 3 }
46     } test-parallel-copy
47 ] unit-test
48
49 [
50     {
51         T{ ##copy f V int-regs 4 V int-regs 3 }
52         T{ ##copy f V int-regs 3 V int-regs 2 }
53         T{ ##copy f V int-regs 2 V int-regs 1 }
54         T{ ##copy f V int-regs 1 V int-regs 4 }
55     }
56 ] [
57     {
58         { V int-regs 2 V int-regs 1 }
59         { V int-regs 3 V int-regs 2 }
60         { V int-regs 1 V int-regs 3 }
61         { V int-regs 4 V int-regs 3 }
62     } test-parallel-copy
63 ] unit-test