Stale, not applicable to current cygwin
[fw/sdcc] / src / z80 / peeph.def
index 9fd073d688f13fdb31038f39d1442acba74e4943..a866d187b1063c0e27d2afac7f4f08e0ff271dab 100644 (file)
@@ -1,5 +1,69 @@
+replace restart {
+       ld (hl),(hl)
+} by {
+       ERROR - peephole - caught (hl),(hl)
+}
 replace restart {
        ld %1,%1
 } by {
        ; Removed redundent load
 }
+replace restart {
+       xor a,a
+       or a,%1
+       or a,a
+       jp %2,%3
+} by {
+       ; Removed redundent or a,a
+       xor     a,a
+       or      a,%1
+       jp      %2,%3
+}
+replace restart {
+       cp a,#0x00
+       jp nz,%1
+} by {
+       ; Rule 3
+       or      a,a
+       jp      nz,%1
+}
+replace restart {
+       jp nz,%1
+       jp      %2
+%1:
+       jp      %3
+%2:
+} by {
+       ; Rule 4
+       jp      z,%2
+%1:
+       jp      %3
+%2:
+}
+replace restart {
+       jp      nz,%1
+       jp      %2
+%1:
+} by {
+       ; Rule 5
+       jp      z,%2
+%1:
+}
+replace restart {
+       jp      z,%1
+       jp      %2
+%1:
+} by {
+       ; Rule 6
+       jp      nz,%2
+%1:
+}
+replace restart {
+       ld      a,%1
+       or      a,%2
+       or      a,a
+} by {
+       ; Rule 8
+       ld      a,%1
+       or      a,%2
+}