View Single Post
Old 25 May 2022, 16:39   #207
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,303
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

Last edited by jotd; 25 May 2022 at 18:52.
jotd is offline  
 
Page generated in 0.05378 seconds with 10 queries