replace {
ld a, %1
ld %2, a
} by {
mov %2, %1
} if notUsed('a')
Does the rule need anything else? Something to assert that the %1 and %2
source/destination addresses are 'longmem' (or 'shortmem')? Some way of
determining if any following instructions rely on N/Z flags (e.g. JRNE)?
I don’t use stm8, but when I looked through it’s constraint functions, I
saw that it allows things like notUsed('z')
And after a quick look into the OP codes, it looks like %1 and %2 could
also be XH/YH/XL/YL/SP, which doesn’t seem to be supported by mov.
--
Freundliche Grüße / Yours sincerely
Sebastian Riedel
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user