X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fhc08%2Fpeeph.def;h=1fddfa6df1d646857b33527fcc20fad2542d993c;hb=f92669107b65c9939a2ec5dfc5d0fef1d6387478;hp=d70a5d1ebc48bd98af4e3bb70341e5e23789d6b1;hpb=d9d71b685333fa132ef705c9932f116d3da7677e;p=fw%2Fsdcc diff --git a/src/hc08/peeph.def b/src/hc08/peeph.def index d70a5d1e..1fddfa6d 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 { @@ -228,3 +288,29 @@ replace { ; Peephole 6b - replaced jmp to rts with rts rts } if labelIsReturnOnly + +replace restart { + psha + lda %1 + sta 1,s +} by { + ; Peephole 7 - optimized stack allocation + lda %1 + psha +} + +replace restart { + lda %1 + sta %1 +} by { + ; Peephole 8a - removed redundant sta + lda %1 +} if notVolatile %1 + +replace restart { + sta %1 + lda %1 +} by { + ; Peephole 8b - removed redundant lda + sta %1 +} if notVolatile %1