I'm working on Cortex-A8 and Cortex-A9 in particular. I know that some architectures don't come with integer division, but what is the best way to do it other than convert to float, divide, convert to integer? Or is that indeed the best solution?
Cheers! = )
The compiler normally includes a divide in its library, gcclib for example I have extracted them from gcc and use them directly:
https://github.com/dwelch67/stm32vld/ then stm32f4d/adventure/gcclib
going to float and back is probably not the best solution. you can try it and see how fast it is...This is a multiply but could as easily make it a divide:
https://github.com/dwelch67/stm32vld/ then stm32f4d/float01/vectors.s
I didnt time it though to see how fast/slow. Understood I am using a cortex-m above and you are talking about a cortex-a, different ends of the spectrum, similar float instructions and the gcc lib stuff is similar, for the cortex-m I have to build for thumb but you can just as easily build for arm. Actually with gcc it should all just work automagically you should not need to do it the way I did it. Other compilers as well you should not need to do it the way I did it in the adventure game above.