Is there a reason why one wouldn't use: (z80/gbz80)

replace restart {
        ld      %2, %4
        ld      %1, %3
} by {
        ; brought register pair into uniform order
        ld      %1, %3
        ld      %2, %4
} if canAssign(%1%2 '#0x0102'), notSame(%2, %3)

replace {
        ld      %1, #0x%3
        ld      %2, #0x%4
} by {
        ld      %1%2, #0x%3%4
        ; combined constant loads into register pair.
} if canAssign(%1%2 '#0x0102')

instead of:

replace {
        ld      e, #0x%1
        ld      d, #0x%2
} by {
        ld      de, #0x%2%1
        ; peephole 92 combined constant loads into register pair.
}

replace {
        ld      d, #0x%1
        ld      e, #0x%2
} by {
        ld      de, #0x%1%2
        ; peephole 93 combined constant loads into register pair.
}

replace {
        ld      l, #0x%1
        ld      h, #0x%2
} by {
        ld      hl, #0x%2%1
        ; peephole 94 combined constant loads into register pair.
}

replace {
        ld      h, #0x%1
        ld      l, #0x%2
} by {
        ld      hl, #0x%1%2
        ; peephole 95 combined constant loads into register pair.
}

replace {
        ld      c, #0x%1
        ld      b, #0x%2
} by {
        ld      bc, #0x%2%1
        ; peephole 96 combined constant loads into register pair.
}

replace {
        ld      b, #0x%1
        ld      c, #0x%2
} by {
        ld      bc, #0x%1%2
        ; peephole 97 combined constant loads into register pair.
}

--
Freundliche Grüße / Yours sincerely
Sebastian Riedel


_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to