X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fz80%2Fpeeph-z80.def;h=6c258c09e468168acb30678f188cdd59c628ab02;hb=f8ebe92b9c9264ea1e38ec65e754f970d95faec8;hp=ba83efff4dbc3e3fc7ac1c14559d66fa027cc948;hpb=715485a0de0655c91f6c24edb2b15c7abeb00965;p=fw%2Fsdcc diff --git a/src/z80/peeph-z80.def b/src/z80/peeph-z80.def index ba83efff..6c258c09 100644 --- a/src/z80/peeph-z80.def +++ b/src/z80/peeph-z80.def @@ -799,6 +799,36 @@ replace restart { //add %3, %4 } +replace restart { + ld l,%1 (ix) + ld h,%2 (ix) + ld a,(hl) + inc a + ld l,%1 (ix) + ld h,%2 (ix) + ld (hl),a +} by { + ld l,%1 (ix) + ld h,%2 (ix) + inc (hl) + ; peephole 42c incremented in (hl) instead of going through a. +} if notUsed('a') + +replace restart { + ld l,%1 (ix) + ld h,%2 (ix) + ld a,(hl) + dec a + ld l,%1 (ix) + ld h,%2 (ix) + ld (hl),a +} by { + ld l,%1 (ix) + ld h,%2 (ix) + dec (hl) + ; peephole 42d decremented in (hl) instead of going through a. +} if notUsed('a') + replace restart { ld %1,a ld a,%2