View Single Post
Old 03 February 2011, 10:52   #1
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
68000 code optimisations

Thread title says it all really.

I'm interested in the quickest ways to do things on the 68000 processor.

I imagine that an optimisation that is valid for 68000 might not necessarily be valid for > 68000 processors but my main interest is in vanilla 68000 coding.

So, if you have any, please post them here.

In the meantime, some from me. Right hand operand(s) accomplish (according to my own testing, correct me if I'm wrong! ) the same as the left hand operand(s) only faster:

Code:
 
68000 code speed optimisations
------------------------------
 
clr.l     d0     -->     moveq.l     #0,d0
 
lsl.w     #1,d0  -->     add.w       d0,d0
 
lsl.w     #2,d0  -->     add.w       d0,d0
                         add.w       d0,d0
 
adda.w    #10,a0 -->     lea         10(a0),a0
 
moveq.l   #16,d0 -->     swap        d1
ror.l     d0,d1
 
moveq.l   #15,d0 -->     swap        d1
ror.l     d0,d1          rol.l       #1,d1
pmc is offline  
 
Page generated in 0.04975 seconds with 11 queries