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
slow instructions on GBA   Message List  
Reply | Forward Message #12325 of 15019 |
Re: [gbadev] slow instructions on GBA

> As I know, the modulo (x%y) and division (x/y) instructions are fairly
slow on GBA.

Modulo and division are relatively slow on the AGB as it has no hardware
divide unit, however they are not so slow they are going to screw up
interrupt latency within your VBlank or any other interrupt.

The best thing is just to forget about the relative hit of divides and so on
unless you need to do something which uses divides intensively, such as 3D.
In which case you could consider going to a precalculated table based
reciprocal divide routine which uses a multiply and 1/divisor to increase
the speed of division at the cost of accuracy.

To be honest, I'd forget about it until your game / demo starts to slow down
and optimise then....

--James





Fri Aug 2, 2002 12:15 pm

jim@...
Send Email Send Email

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

Hi, As I know, the modulo (x%y) and division (x/y) instructions are fairly slow on GBA. Are there any other instructions or program sequences to avoid on GBA...
Szabo Ferenc
szabfer
Offline Send Email
Aug 2, 2002
11:54 am

... Square root. I think on devrs.com there's a link to page with tricks for fast sqrt. Frankly saying for the present I'm using the BIOS one, but now I wonder...
Maciej Sinilo
yarpen2002
Offline Send Email
Aug 2, 2002
12:25 pm

... slow on GBA. Modulo and division are relatively slow on the AGB as it has no hardware divide unit, however they are not so slow they are going to screw up ...
James Boulton
jim@...
Send Email
Aug 2, 2002
12:37 pm

On 2 Aug 2002 at 13:15, James Boulton wrote: [snip] ... That's a very good advice. After all, as we all know, "premature optimization is the root of all evil"...
Maciej Sinilo
yarpen2002
Offline Send Email
Aug 2, 2002
12:46 pm

... if you use GCC, here something else to be aware of: another major slowdown/bloat thing is using u8/s8/u16/s16 when don't HAVE to use them... if you don't...
Markus Glanzer
vampy2000.geo
Offline Send Email
Aug 2, 2002
12:52 pm

it is exactly the same for parameters in functions: void f(u32) {} is better than f(u16) {} for the same reasons. Christian VOTAVA Responsable du...
Christian Votava
cvotava@...
Send Email
Aug 2, 2002
2:54 pm
Advanced

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