* src/pic/ralloc.c (debugLogRegType): Removed some old types to get it to compile.
[fw/sdcc] / src / z80 / peeph.def
1 replace restart {
2         ld (hl),(hl)
3 } by {
4         ERROR - peephole - caught (hl),(hl)
5 }
6 replace restart {
7         ld %1,%1
8 } by {
9         ; Rule 1: Removed redundent load
10 }
11 replace restart {
12         xor a,a
13         or a,%1
14         or a,a
15         jp %2,%3
16 } by {
17         xor     a,a
18         or      a,%1
19         jp      %2,%3
20 }
21 replace restart {
22         cp a,#0x00
23         jp nz,%1
24 } by {
25         ; Rule 3: Changed cp #0 to or
26         or      a,a
27         jp      nz,%1
28 }
29 replace restart {
30         jp nz,%1
31         jp      %2
32 %1:
33         jp      %3
34 %2:
35 } by {
36         ; Rule 4: Changed jp order
37         jp      z,%2
38 %1:
39         jp      %3
40 %2:
41 }
42 replace restart {
43         jp      nz,%1
44         jp      %2
45 %1:
46 } by {
47         ; Rule 5: Changed jump logic
48         jp      z,%2
49 %1:
50 }
51 replace restart {
52         jp      z,%1
53         jp      %2
54 %1:
55 } by {
56         ; Rule 6: Changed jump logic
57         jp      nz,%2
58 %1:
59 }
60 replace restart {
61         or      a,%1
62         or      a,a
63 } by {
64         ; Rule 7: Removed redundent or
65         or      a,%1
66 }
67 replace restart {
68         or      a,%1)
69         or      a,a
70 } by {
71         ; Rule 8: Removed redundent or for (ix)
72         or      a,%1)
73 }
74 replace restart {
75         xor     a,a
76         or      a,%1
77         jp      nz,%2
78         xor     a,a
79         or      a,%3
80         jp      z,%2
81 } by {
82         xor     a,a
83         or      a,%1
84         jp      nz,%2
85         or      a,%3
86         jp      z,%2
87 }
88 replace restart {
89         jp      nz,%1
90         inc     %3)
91 %1:
92         jp      %2
93 } by {
94         jp      nz,%2
95         inc     %3)
96 %1:
97         jp      %2
98 }
99 replace restart {
100         xor     a,a
101         ld      a,#0x00
102 } by {
103         xor     a,a
104 }
105 replace restart {
106         ld      e,#0x00
107         ld      d,#0x00
108 } by {
109         ld      de,#0x0000
110 }
111 replace restart {
112         ld      %1,a
113         ld      a,%1
114 } by {
115         ld      %1,a
116 }