#176564 - GLaDOS - Thu Aug 18, 2011 7:55 am
I noticed in the beginners FAQ, it refers to the possibility of using a custom divider to optimize divisions. However, the link is broken because Geocities no longer exists.
Does anyone know where I can find the information?
#176579 - Ruben - Fri Aug 19, 2011 3:53 pm
32/32=32 Division
You may have to change the name of the labels in order to make it work with GAS.
EDIT:
Oh yeah, you may also have to change the 'movs pc, foo' to 'bx foo' for ARM-THUMB interworking (if you're working on the GBA, anyway - the DS doesn't need bx).
Also, if this is for the GBA, put it in IWRAM. If it's for the DS, put it in ITCM.
Last edited by Ruben on Sat Aug 20, 2011 7:25 am; edited 1 time in total
#176586 - Miked0801 - Sat Aug 20, 2011 4:16 am
Your better off multplying by the fixed point reciprical if possible.
#176587 - GLaDOS - Sat Aug 20, 2011 5:09 am
I already converted all divisions to multiplications where possible. But there are a couple which are impossible to get rid of.
#176588 - Miked0801 - Sat Aug 20, 2011 5:27 pm
Then, are you sure that division is hurting you that much? I've no problem using that custom divider, but I don't really believe it's going to net you that much performance - depending on what you are dividing with now of course. If your current divider is at all decent, you might get 2-3%, nothing more.
#176589 - GLaDOS - Sat Aug 20, 2011 6:47 pm
Well, I'm using whatever GCC generates in ARM code.
#176591 - Ruben - Sun Aug 21, 2011 4:30 am
GCC uses a slightly looped version of the divider I linked.
For most uses, it's good enough, but if you're dividing a LOT, it may help to use the one I linked.