View Single Post
Old 06 April 2018, 15:52   #1
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Fast multiply / divide by 64?

Hi all,

My code uses a lot of multiplying and dividing by 64.

for example:

Code:
lsl.w #6,d0
lsl.w #6,d1

---

lsr.w #6,d0
lsr.w #6,d1
Each one of those shifts is taking 18 cycles.

The maximum number i need to shift to and from is 200 so if I were to use a table I would need values going up to 12800, therefore I would need to hold a table on memory that would be over 25Kb (big waste).

Is there a better/faster method i can use for doing this multiplication without sapping 25Kb ram with a table?

Looking at doing it in a table I still would'nt improve on the cycle count anyway.

Cheers,
Geezer

Last edited by mcgeezer; 06 April 2018 at 16:11. Reason: Added table table cycle counts
mcgeezer is online now  
 
Page generated in 0.04612 seconds with 11 queries