* sim/ucsim/hc08.src/inst.cc (inst_condbranch): fixed simulation of
[fw/sdcc] / src / hc08 / peeph.def
index d70a5d1ebc48bd98af4e3bb70341e5e23789d6b1..93af395f532f237f518732889e32da6f91020121 100644 (file)
@@ -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 {