X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fhc08%2Fpeeph.def;h=93af395f532f237f518732889e32da6f91020121;hb=014ffb2177ce6852557ae1895d9a800856831c55;hp=a4c8e75615af7a7eaec507b4d47d330c76c7e1e8;hpb=3ca8f7f80a31fbc4a64b33756da79cfb4a4cbb33;p=fw%2Fsdcc diff --git a/src/hc08/peeph.def b/src/hc08/peeph.def index a4c8e756..93af395f 100644 --- a/src/hc08/peeph.def +++ b/src/hc08/peeph.def @@ -86,6 +86,66 @@ replace { %1: } if labelInRange +replace { + bls %1 + jmp %5 +%1: +} by { + ; Peephole 2g - eliminated bra + bhi %5 +%1: +} if labelInRange + +replace { + bhi %1 + jmp %5 +%1: +} by { + ; Peephole 2h - eliminated bra + bls %5 +%1: +} if labelInRange + +replace { + ble %1 + jmp %5 +%1: +} by { + ; Peephole 2i - eliminated bra + bgt %5 +%1: + +} if labelInRange +replace { + bgt %1 + jmp %5 +%1: +} by { + ; Peephole 2j - eliminated bra + ble %5 +%1: +} if labelInRange + +replace { + bge %1 + jmp %5 +%1: +} by { + ; Peephole 2k - eliminated bra + blt %5 +%1: +} if labelInRange + +replace { + blt %1 + jmp %5 +%1: +} by { + ; Peephole 2l - eliminated bra + bge %5 +%1: +} if labelInRange + replace { jmp %5 } by { @@ -124,3 +184,107 @@ replace { ; Peephole 4d - eliminated redundant tstx ldx %1,s } + +replace { + clra + sta %1 + clra + sta %2 + clra + sta %3 + clra + sta %4 +} by { + ; Peephole 5a - eliminated redundant clra + clra + sta %1 + sta %2 + sta %3 + sta %4 +} + +replace { + clra + sta %1 + clra + sta %2 + clra + sta %3 +} by { + ; Peephole 5b - eliminated redundant clra + clra + sta %1 + sta %2 + sta %3 +} + +replace { + clra + sta %1 + clra + sta %2 +} by { + ; Peephole 5c - eliminated redundant clra + clra + sta %1 + sta %2 +} + +replace { + lda #%9 + sta %1 + lda #%9 + sta %2 + lda #%9 + sta %3 + lda #%9 + sta %4 +} by { + ; Peephole 5d - eliminated redundant lda + lda #%9 + sta %1 + sta %2 + sta %3 + sta %4 +} + +replace { + lda #%9 + sta %1 + lda #%9 + sta %2 + lda #%9 + sta %3 +} by { + ; Peephole 5e - eliminated redundant lda + lda #%9 + sta %1 + sta %2 + sta %3 +} + +replace { + lda #%9 + sta %1 + lda #%9 + sta %2 +} by { + ; Peephole 5f - eliminated redundant lda + lda #%9 + sta %1 + sta %2 +} + +replace { + jmp %5 +} by { + ; Peephole 6a - replaced jmp to rts with rts + rts +} if labelIsReturnOnly + +replace { + bra %5 +} by { + ; Peephole 6b - replaced jmp to rts with rts + rts +} if labelIsReturnOnly