1 // peeph
-r2k.def
- Rabbit
2000 (derived from Z80 peephole rules
)
3 // Some of these peepholes could be potentially moved to peeph.def
, but a
4 // GBZ80 expert should have a look at them before.
6 // (c
) Philipp Klaus
Krause (pkk@spth.de
, philipp@colecovision.eu
) 2006 - 2020
7 // *** modified by Leland Morrison for rabbit
2000 processor
2011
9 // This program is free software
; you can redistribute it and
/or modify it
10 // under the terms of the GNU General Public License as published by the
11 // Free Software Foundation
; either version
2, or (at your option
) any
14 // This program is distributed in the hope that it will be useful
,
15 // but WITHOUT ANY WARRANTY
; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License
20 // along with this program
; if not
, write to the Free Software
21 // Foundation
, 59 Temple Place
- Suite
330, Boston
, MA
02111-1307, USA.
32 ; peephole
65rab used hl instead of iy.
33 } if
notUsed('iy'), notUsed('hl')
40 ; peephole
68rab
used (hl
) directly instead of going through
%1.
41 } if
notUsed(%1), notSame(%1 'a')
48 ; peephole
73 removed redundant or after or.
56 ; peephole
74 removed redundant or after or.
64 ; peephole
75 removed redundant or after and.
72 ; peephole
76 removed redundant or after xor.
80 ; peephole
77 removed redundant or after xor.
91 ; common peephole
102c removed redundant or after sbc.
102 ; common peephole
102d removed redundant or after sbc.
112 ; peephole
93a incremented in
%2 (%3) instead of going through
%1.
113 } if
notSame(%3 'sp')
122 ; peephole
129rab moved increment of hl to constant.
132 ; peephole
129rab
' moved decrement of hl to constant.
140 ; peephole 129rab'' moved increment of iy to offset.
152 ; peephole 138rab loaded %6 from a directly instead of going through %1.
166 ; peephole 138rab' loaded
%6 from a directly instead of going through
%1.
167 } if
notUsed(%1), notSame(%5 %1), notSame(%5 '(hl)' '(de)' '(bc)'), notSame(%5 %6), notSame(%6 '(hl)' '(de)' '(bc)'), notSame(%5 'a'), notSame(%6 'a')
173 ; peephole
142rab used
0(sp
) to move hl onto the stack.
175 } if
notUsed('a'), notUsed('hl')
183 ; peephole
143rab used
0(sp
) to move hl onto the stack.
185 } if
notUsed('a'), notUsed('hl')
195 ; peephole
145rab used
0(sp
) to move #
%1 onto the stack.
197 } if
notUsed('a'), notUsed('hl')
207 ; peephole
146rab used
0(sp
) to move #
%1 onto the stack.
209 } if
notUsed('a'), notUsed('hl')
211 // those are not in z80
219 ; peephole
140 used sign flag instead of testing bit
7.
229 ; peephole
141 used sign flag instead of testing bit
7.
238 ; peephole
141a removed redundant transfer and flag setting in a