X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fz80%2Fpeeph-z80.def;h=a1299d443ec0fccadfaf17907bf9ed36c4ef360f;hb=7b43aada0d2aa8d2f4a6a4be856e57b3fd8e32f6;hp=cf5a83d4f7d1ec66a522cb456f06b6a85c0f6447;hpb=d0d1319aba1a3ae007786c03c49f0ca82b480365;p=fw%2Fsdcc diff --git a/src/z80/peeph-z80.def b/src/z80/peeph-z80.def index cf5a83d4..a1299d44 100644 --- a/src/z80/peeph-z80.def +++ b/src/z80/peeph-z80.def @@ -62,9 +62,17 @@ replace restart { ld a,%3 (%1) } by { ; peephole 0d loaded %2 into a directly instead of going through %1. - ld a,(#%2+%3) + ld a,(#%2 + %3) } if notUsed(%1) +replace restart { + ld hl,#%1 + %2 + ld a, (hl) +} by { + ; peephole 0d' loaded %2 into a directly instead of going through %1. + ld a, (#%1 + %2) +} if notUsed('hl') + replace restart { srl %1 ld a,%1 @@ -259,17 +267,16 @@ replace restart { ld b, %2 (%3) } if notVolatile(%1), notUsed(%1) -// Bug #2728445 -//replace restart { -// ld %1,a -// ld %2,%3 -// ld %4,%1 -//} by { -// ; peephole 0t loaded %4 from a instead of going through %1. -// ld %1,a -// ld %2,%3 -// ld %4,a -//} if notVolatile(%1), operandsNotRelated(%1 %3), operandsNotRelated(%1 %2) +replace restart { + ld %1,a + ld %2,%3 + ld %4,%1 +} by { + ; peephole 0t loaded %4 from a instead of going through %1. + ld %1,a + ld %2,%3 + ld %4,a +} if notVolatile(%1), operandsNotRelated(%1 %3), operandsNotRelated(%1 %2) replace restart { ld %1,a @@ -404,13 +411,24 @@ replace restart { replace restart { ld iy,#%1 - ld %2,%3 (%4) + ld %2,%3 (iy) } by { ; peephole 0ze used hl instead of iy. ld hl,#%1 + %3 ld %2,(hl) } if notUsed('iy'), notUsed('hl') +replace restart { + ld iy,#%1 + ld %2 (iy),%3 + ld l,%2 (iy) +} by { + ; peephole 0ze' used hl instead of iy. + ld hl,#%1 + %2 + ld (hl),%3 + ld l,(hl) +} if notUsed('iy'), notUsed('h') + replace restart { ld iy,#%1 ld %2 (%3), %4