PIC Port - Indirection works better. instrumented pic/ralloc.c to dump
[fw/sdcc] / src / pic / peeph.def
1 // peep 1
2 replace restart {
3         movf    %1,w
4         movwf   %2
5         movf    %2,w
6 } by {
7         ; peep 1 - Removed redundant move
8         movf    %1,w
9         movwf   %2
10 }
11
12 // peep 2
13 replace restart {
14         decf    %1,f
15         movf    %1,w
16         btfss   status,z
17         goto    %2
18 } by {
19         ; peep 2 - decf/mov/skpz to decfsz
20         decfsz  %1,f
21          goto   %2
22 }
23
24 // peep 3
25 replace restart {
26         movwf   %1
27         movf    %1,w
28         xorlw   %2
29 } by {
30         ; peep 3 - redundant move
31         movwf   %1
32         xorlw   %2
33 }
34
35 // peep 4
36 replace restart {
37         btfsc   %1,%2
38         goto    %3
39         incf    %4,f
40 %3:
41 } by {
42         ;peep 4 - test/jump to test/skip
43         btfss   %1,%2
44         incf   %4,f
45 %3:
46 }
47
48
49 // peep 5
50 replace restart {
51         btfss   %1,%2
52         goto    %3
53         incf    %4,f
54 %3:
55 } by {
56         ;peep 5 - test/jump to test/skip
57         btfsc   %1,%2
58         incf   %4,f
59 %3:
60 }
61
62 // peep 6
63 replace restart {
64         btfss   %1,%2
65         goto    %3
66 %4:
67         incf    %5,f
68 %3:
69 } by {
70         ;peep 6 - test/jump to test/skip
71         btfsc   %1,%2
72 %4:
73         incf   %5,f
74 %3:
75 }
76
77 // peep 7
78 replace restart {
79         btfsc   %1,%2
80         goto    %3
81 %4:
82         incf    %5,f
83 %3:
84 } by {
85         ;peep 6 - test/jump to test/skip
86         btfss   %1,%2
87 %4:
88         incf   %5,f
89 %3:
90 }
91
92 replace restart {
93         movf    %1,w
94         movf    %1,w
95 } by {
96         ; peep 8 - Removed redundant move
97         movf    %1,w
98 }
99
100 replace restart {
101         movwf   %1
102         movf    %1,w
103 } by {
104         ; peep 9 - Removed redundant move
105         movwf   %1
106 }
107
108 replace restart {
109         movlw   %1
110         movwf   %2
111         movlw   %1
112 } by {
113         ; peep 10 - Removed redundant move
114         movlw   %1
115         movwf   %2
116 }
117
118 replace restart {
119         movwf   %1
120         movwf   %1
121 } by {
122         ; peep 11 - Removed redundant move
123         movwf   %1
124 }
125