Question:
I have this '020 code
Code:
moveq.l #127,d5
moveq.l #126,d3
move.l (a0,d5.l*4),d0
sub.l (a0,d3.l*4),d0
as d5 and d3 are clobbered just afterwards so we don't really need the values there, I figured that I could write
Code:
move.l (127*4,a0),d0
sub.l (126*4,a0),d0
But the moveq is very quick and now I have 16 bit offsets instead of registers (but the *4 operation is done at compile time)
Is my optimisation useful?
Or I could use another register:
Code:
lea 127*4(a0),a1
move.l (A1),d0
sub.l -(A1),d0 # pre-decrementing to get offset 126*4