Assembly multiply and divide routines ?
Rayman
Posts: 14,801
Anybody seen optimized multiply and divide routines in PASM here?
Comments
The multiply is 32x32=64 and can be easily cut-back to 32x32=32 and becomes much simpler ( remove lhs:top and acc:top ). It doesn't have deterministic timing.
Post Edited (hippy) : 1/10/2008 3:09:13 PM GMT
multiplication. It doesn't have to be 2^64 entries ( although that's the fastest ) but
could be done by 'quarter squares'. That reduces the size of lookup quite considerably
but I cannot remember by how much; 2^33 ?
I cannot remember the details but it involves turning "ab = a(b²-a²)/(b+a) + a²" into
"ab = qs(a+b) - qs(a-b)" or something like that; a+b would give the lookup table size
of 2^33 as above. qs(n) = n²/4
Added : details here ... mathworld.wolfram.com/QuarterSquaresRule.html
You might get some mileage out of dropping down to 16x16, even lower. Although you'll
lose quality at least you may be able to go forward.
Post Edited (hippy) : 1/10/2008 4:02:18 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Like so: http://forums.parallax.com/showthread.php?p=668559
See also: Lighting a candle v. cursing the dark.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Michael Park
PS, BTW, and FYI:
To search the forum, use search.parallax.com (do not use the Search button).
Check out the Propeller Wiki: propeller.wikispaces.com/
I have read your tutorial and I apologize for having not commented on how informative it is. In fact, I am in the process of rereading it now, and I shall keep it in favorites!
Maybe you could post a link to it in your signature. That way it will get publicity even when your wrtting about something totally unrelated!
Though assembly code should not be overemphasized. Alas, the full wisdom of this forum is not easy to tap. Reading between some lines, I have the impression that even the much adversized work of our WIKI writers is hardly known. When I read in it from time to time I am always astonished about its comprehensive and to the point information. Great work there!