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

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

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 #11216 of 15019 |
Re: fast 32x32=>64 multiplier for 16.16 fixed point

--- In gbadev@y..., Martin Piper <martinp@a...> wrote:
> 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" (sic) method for example.

Very true. Thanks guys... a small snippet

fmul32:
@ inputs are in r0 and r1, return in r0
smull r2,r3,r0,r1
mov r1,r2,lsr#16
orr r0,r1,r3,lsl#16
bx lr

Thats the entire function [with corrected orr]. I get 2.5x faster
in VBA [250k/sec].

I will also take your advice with the smula instruction.

Tom





Thu May 2, 2002 11:09 am

tomstdenis
Offline Offline
Send Email Send Email

Forward
Message #11216 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