Search the web
Sign In
New User? Sign Up
gbadev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
fast 32x32=>64 multiplier for 16.16 fixed point   Message List  
Reply | Forward Message #11210 of 15019 |
I didn't find much in the archives for this so I wrote my own....

This routine gets ~27000 multiplies per second in VBA which means on
the real hardware its probably around ~22000 [my gba broke so I can't
test it myself...]

What the code does is a 32x32 multiply then a shift right by 16 bits so
it emulates a multiply for a 16.16 system.

I used a standard double/add method but I think if I could take
advantage of the ARM multiplier somehow that may prove useful. However
two major obstacles, the multiplier is unsigned and it doesn't produce
the upper 32 bits [well at least not in Thumb mode].

The code is at http://tomstdenis.home.dhs.org/mylib.zip

Under /sqrt/sqrt.bin is a precompiled binary for the demo [I used it to
time my sqrt function and then my fmul32].

The source for this function is in GAS assembler code in the files
/lib/amath.s

Anyone else have info on this particular operation? Could someone
please time this on real hardware?

Tom

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com




Thu May 2, 2002 1:45 am

tomstdenis
Offline Offline
Send Email Send Email

Forward
Message #11210 of 15019 |
Expand Messages Author Sort by Date

I didn't find much in the archives for this so I wrote my own.... This routine gets ~27000 multiplies per second in VBA which means on the real hardware its...
tom st denis
tomstdenis
Offline Send Email
May 2, 2002
8:43 am

... on ... can't ... bits so ... I've managed to speed up the code 5x and I will tell y'all how. Really easy using some school math. Ok so the the basic 16.16...
tomstdenis
Offline Send Email
May 2, 2002
10:32 am

To accurately multiply two 16.16 number you shouldn't need to split them up in to separate 16 bit multiplies, commonly known as "using the highschool math"...
Martin Piper
fnagaton
Offline Send Email
May 2, 2002
10:54 am

... split them up ... highschool ... Very true. Thanks guys... a small snippet fmul32: @ inputs are in r0 and r1, return in r0 smull r2,r3,r0,r1 mov...
tomstdenis
Offline Send Email
May 2, 2002
12:31 pm

For something that small, wouldn't it be better to put it inline than to do a branch and return? Unless, of course, you are in thumb mode at the time. ... ...
Dennis Munsie
bea_dennis
Offline Send Email
May 3, 2002
8:29 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help