I have been reading about the major hit of ftoi on x86 and was wondering if this was a concern on ARM as well? If so are there any faster ways to round or cast? I did some searching about this specific to the ARM and didn't come up with much.
Floating point math incurs a massive performance hit in the first place on this platform, as that is all done in software. If you are doing floating point math then calls to ftoi are the least of your concern.
What does your app do, and how does it involve floats? Your app may be a candidate for fixed point math.
Dan East
Yeah thats what I was thinking. I am using floating point math extensively in my game. Fixed point would of course be faster, but I always wait to see if its worth converting after testing.
If your game does math real-time and needs to maintain a minimum FPS then fixed point will make a tremendous difference. I can't remember the exact numbers off the top of my head (maybe someone else can pipe in with them), but it was hundreds of cycles required to do a single floating point multiply. In fixed point you've got an integer multiply and a shift - just a couple instructions. So we're talking a factor of hundreds here, not just a few percent difference.
Dan East
The Windows CE floating point emulation library is notoriously slow. The ARM and Intel offerings are faster, but if you can get away with using fixed-point, go that route instead.
Benchmarks that I did years ago on a StrongARM processor revealed that fixed-point dot product operations were 10x faster than floating point on Windows CE.
You don't need to make a call into the floating point library to do a fixed-to-float or float-to-fixed conversion. It can be done with bitwise operations.
I've resorted to using floating point in my 3D code because it's easier, and it really isn't the bottleneck in my 3D library. I usually don't have that many vertices to process and the per-pixel operations in the rasterizer are currently the long pole in the tent.
Hm, what do you mean by the ARM and Intel offerings are faster? Do you mean using a compilier other than EVC/VS?
Floating point is emulated - the code that performs the actual floating point math is embedded in your app. The libraries produced by Intel and ARM that Digby referred to are simply better optimized - probably hand-coded ASM.
Pocket Quake's performance increased substantially just by rebuilding it with one of those kits, since it still has a decent amout of floating point math. I wasn't the one who did that build, so I can't offer more specifics.
Dan East
I did searching for ARM floating point library and ARM toolkit but didn't find anything that seemed like a floating point emulation layer. Do you know where these libraries are or what they are called?
I found the intel compilier for windows ce page, but it doesn't seem to be supported any more and there is no longer a working eval link for it.
http://www.intel.com/cd/software/produc ... 223057.htm
Here someone has built pocketquake with this compilier perhaps this is what you were talking about?
http://www.pocketmatrix.com/forums/view ... e80bd2bd24
UPDATE:
I found some info about the IGPP package here, its now under Marvel
http://softwarecommunity.intel.com/isn/ ... 32249.aspx