1 IN: compiler.cfg.value-numbering.tests
2 USING: compiler.cfg.value-numbering compiler.cfg.instructions
3 compiler.cfg.registers compiler.cfg.debugger cpu.architecture
4 tools.test kernel math combinators.short-circuit accessors
7 : trim-temps ( insns -- insns )
13 } 1|| [ f >>temp ] when
18 T{ ##peek f V int-regs 45 D 1 }
19 T{ ##copy f V int-regs 48 V int-regs 45 }
20 T{ ##compare-imm-branch f V int-regs 45 7 cc/= }
24 T{ ##peek f V int-regs 45 D 1 }
25 T{ ##copy f V int-regs 48 V int-regs 45 }
26 T{ ##compare-imm-branch f V int-regs 48 7 cc/= }
32 T{ ##load-immediate f V int-regs 2 8 }
33 T{ ##peek f V int-regs 3 D 0 }
34 T{ ##slot-imm f V int-regs 4 V int-regs 3 1 3 }
35 T{ ##replace f V int-regs 4 D 0 }
39 T{ ##load-immediate f V int-regs 2 8 }
40 T{ ##peek f V int-regs 3 D 0 }
41 T{ ##slot-imm f V int-regs 4 V int-regs 3 1 3 }
42 T{ ##replace f V int-regs 4 D 0 }
48 T{ ##peek f V int-regs 1 D 0 }
49 T{ ##dispatch f V int-regs 1 V int-regs 2 0 }
50 } dup value-numbering =
55 T{ ##peek f V int-regs 16 D 0 }
56 T{ ##peek f V int-regs 17 D -1 }
57 T{ ##sar-imm f V int-regs 18 V int-regs 17 3 }
58 T{ ##add-imm f V int-regs 19 V int-regs 16 13 }
59 T{ ##add f V int-regs 21 V int-regs 18 V int-regs 19 }
60 T{ ##alien-unsigned-1 f V int-regs 22 V int-regs 21 }
61 T{ ##shl-imm f V int-regs 23 V int-regs 22 3 }
62 T{ ##replace f V int-regs 23 D 0 }
63 } dup value-numbering =
68 T{ ##peek f V int-regs 1 D 0 }
69 T{ ##shl-imm f V int-regs 2 V int-regs 1 3 }
70 T{ ##shr-imm f V int-regs 3 V int-regs 2 3 }
71 T{ ##replace f V int-regs 1 D 0 }
75 T{ ##peek f V int-regs 1 D 0 }
76 T{ ##mul-imm f V int-regs 2 V int-regs 1 8 }
77 T{ ##shr-imm f V int-regs 3 V int-regs 2 3 }
78 T{ ##replace f V int-regs 3 D 0 }
84 T{ ##load-indirect f V int-regs 1 + }
85 T{ ##peek f V int-regs 2 D 0 }
86 T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc> }
87 T{ ##compare f V int-regs 6 V int-regs 2 V int-regs 1 cc> }
88 T{ ##replace f V int-regs 4 D 0 }
92 T{ ##load-indirect f V int-regs 1 + }
93 T{ ##peek f V int-regs 2 D 0 }
94 T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc> }
95 T{ ##compare-imm f V int-regs 6 V int-regs 4 7 cc/= }
96 T{ ##replace f V int-regs 6 D 0 }
97 } value-numbering trim-temps
102 T{ ##load-indirect f V int-regs 1 + }
103 T{ ##peek f V int-regs 2 D 0 }
104 T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc<= }
105 T{ ##compare f V int-regs 6 V int-regs 2 V int-regs 1 cc> }
106 T{ ##replace f V int-regs 6 D 0 }
110 T{ ##load-indirect f V int-regs 1 + }
111 T{ ##peek f V int-regs 2 D 0 }
112 T{ ##compare f V int-regs 4 V int-regs 2 V int-regs 1 cc<= }
113 T{ ##compare-imm f V int-regs 6 V int-regs 4 7 cc= }
114 T{ ##replace f V int-regs 6 D 0 }
115 } value-numbering trim-temps
120 T{ ##peek f V int-regs 8 D 0 }
121 T{ ##peek f V int-regs 9 D -1 }
122 T{ ##unbox-float f V double-float-regs 10 V int-regs 8 }
123 T{ ##unbox-float f V double-float-regs 11 V int-regs 9 }
124 T{ ##compare-float f V int-regs 12 V double-float-regs 10 V double-float-regs 11 cc< }
125 T{ ##compare-float f V int-regs 14 V double-float-regs 10 V double-float-regs 11 cc>= }
126 T{ ##replace f V int-regs 14 D 0 }
130 T{ ##peek f V int-regs 8 D 0 }
131 T{ ##peek f V int-regs 9 D -1 }
132 T{ ##unbox-float f V double-float-regs 10 V int-regs 8 }
133 T{ ##unbox-float f V double-float-regs 11 V int-regs 9 }
134 T{ ##compare-float f V int-regs 12 V double-float-regs 10 V double-float-regs 11 cc< }
135 T{ ##compare-imm f V int-regs 14 V int-regs 12 7 cc= }
136 T{ ##replace f V int-regs 14 D 0 }
137 } value-numbering trim-temps
142 T{ ##peek f V int-regs 29 D -1 }
143 T{ ##peek f V int-regs 30 D -2 }
144 T{ ##compare f V int-regs 33 V int-regs 29 V int-regs 30 cc<= }
145 T{ ##compare-branch f V int-regs 29 V int-regs 30 cc<= }
149 T{ ##peek f V int-regs 29 D -1 }
150 T{ ##peek f V int-regs 30 D -2 }
151 T{ ##compare f V int-regs 33 V int-regs 29 V int-regs 30 cc<= }
152 T{ ##compare-imm-branch f V int-regs 33 7 cc/= }
153 } value-numbering trim-temps