struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / src / z80 / peeph-z80.def
blob411bcdf96fc79404b0a63c243449f909552e28f9
1 // peeph-z80.def - Z80 peephole rules
2 //
3 // Some of these peepholes could be potentially moved to peeph.def, but a
4 // GBZ80 expert should have a look at them before.
5 //
6 // (c) Philipp Klaus Krause (pkk@spth.de, philipp@colecovision.eu) 2006 - 2020
7 //
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 2, or (at your option) any
11 // later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 replace restart {
23 xor a, a
24 ld %1 (%2), a
25 } by {
26 ld %1 (%2), #0
27 ; peephole 178 direct load zero constant to memory addressed by index register
28 } if notUsed('a'), canAssign(%1 %2 '#0')