12 |
|
|
13 |
(*#line 23.4 "x86Peephole.peep"*) |
(*#line 23.4 "x86Peephole.peep"*) |
14 |
structure C = I.C |
structure C = I.C |
15 |
|
structure CBase = CellsBasis |
16 |
|
|
17 |
(*#line 26.4 "x86Peephole.peep"*) |
(*#line 26.4 "x86Peephole.peep"*) |
18 |
fun peephole instrs = |
fun peephole instrs = |
19 |
let |
let |
20 |
(*#line 27.8 "x86Peephole.peep"*) |
(*#line 27.8 "x86Peephole.peep"*) |
21 |
fun isStackPtr (I.Direct r) = C.sameColor (r, C.esp) |
fun isStackPtr (I.Direct r) = CBase.sameColor (r, C.esp) |
22 |
| isStackPtr _ = false |
| isStackPtr _ = false |
23 |
|
|
24 |
(*#line 30.8 "x86Peephole.peep"*) |
(*#line 30.8 "x86Peephole.peep"*) |
91 |
and m = v_7 |
and m = v_7 |
92 |
and n = v_16 |
and n = v_16 |
93 |
and rest = v_4 |
and rest = v_4 |
94 |
in (if ((C.sameColor (d_i, C.esp)) andalso (C.sameColor (d_j, C.esp))) |
in (if ((CBase.sameColor (d_i, C.esp)) andalso (CBase.sameColor (d_j, C.esp))) |
95 |
then (if (m = n) |
then (if (m = n) |
96 |
then (loop (rest, instrs)) |
then (loop (rest, instrs)) |
97 |
else (if (m < n) |
else (if (m < n) |
145 |
and dst_i = v_25 |
and dst_i = v_25 |
146 |
and rest = v_4 |
and rest = v_4 |
147 |
and src = v_8 |
and src = v_8 |
148 |
in (if (((C.sameColor (base, C.esp)) andalso (C.sameColor (dst_i, C.esp))) andalso (not (isStackPtr src))) |
in (if (((CBase.sameColor (base, C.esp)) andalso (CBase.sameColor (dst_i, C.esp))) andalso (not (isStackPtr src))) |
149 |
then (loop (rest, (I.PUSHL src) :: instrs)) |
then (loop (rest, (I.PUSHL src) :: instrs)) |
150 |
else (state_9 (v_0, v_3))) |
else (state_9 (v_0, v_3))) |
151 |
end |
end |
187 |
and le = v_20 |
and le = v_20 |
188 |
and r32 = v_19 |
and r32 = v_19 |
189 |
and rest = v_3 |
and rest = v_3 |
190 |
in (if (((I.LabelExp.valueOf le) = 0) andalso (C.sameColor (r32, base))) |
in (if (((I.LabelExp.valueOf le) = 0) andalso (CBase.sameColor (r32, base))) |
191 |
then (loop (rest, instrs)) |
then (loop (rest, instrs)) |
192 |
else (state_9 (v_0, v_3))) |
else (state_9 (v_0, v_3))) |
193 |
end |
end |
230 |
and dst = v_1 |
and dst = v_1 |
231 |
and dst_i = v_5 |
and dst_i = v_5 |
232 |
and rest = v_4 |
and rest = v_4 |
233 |
in (if (((C.sameColor (base, C.esp)) andalso (C.sameColor (dst_i, C.esp))) andalso (not (isStackPtr dst))) |
in (if (((CBase.sameColor (base, C.esp)) andalso (CBase.sameColor (dst_i, C.esp))) andalso (not (isStackPtr dst))) |
234 |
then (loop (rest, (I.POP dst) :: instrs)) |
then (loop (rest, (I.POP dst) :: instrs)) |
235 |
else (state_49 (v_0, v_1, v_2, v_3))) |
else (state_49 (v_0, v_1, v_2, v_3))) |
236 |
end |
end |