JJC1138 wrote:
Eek... It hadn't actually occurred to me that the G1 might not have floating point, but you're quite right, it's based on the Qualcomm MSM7201A, which includes an ARM11 processor with no FPU.
That's unfortunate, lack of FPU in any Java system makes for a more difficult development experience, especially in light of the lack of operator overloading and a typedef statement (and it results in worse performance, for that matter, as the most reasonable way to handle fixed point math in Java is to make a Fixed class, which is always going to be slower and more memory-hungry than using primitives).
Do you know of any semi-automated ways to turn floating point Java code into fixed point code? I know there are some areas of Box2d that need alteration for fixed point, but that's almost trivial compared to what it would take to convert every floating point op to a fixed point one without operator overloading to aid us...
On the bright side, it's marginally easier to pool wrapped primitives than objects because of the semantic differences, so a stack-based Fixed pool could probably avoid any additional GCs.
Maybe once I get an Android phone I'll take a look and see what I can do about creating a fixed point port, or at least setting up a code transformation utility to achieve the same (I don't want to have to maintain two separate codebases, and I couldn't run them side by side without trading off performance in the floating point version). At the moment, I don't have enough time to do this, but I am planning to move into Android development eventually, so we'll see...