4 ms·
Java's FP has historically had problems of its own. The requirement for exact portable behaviour crippled performance when the available hardware primitives wer
by barrkel 13y ago
Java's FP has historically had problems of its own. The requirement for exact portable behaviour crippled performance when the available hardware primitives weren't a good match.
For example, x87 performs all calculations using a configurable intermediate precision, 32, 64 or 80 bit. But if you want to configure it, you need to change the control word - not something you want to do every other instruction. The main other way of specifying precision is to not use most of the processor's internal registers (FP stack), and instead store intermediate results to memory.
That's changed a bit over the years, and Java has loosened up somewhat; you need strictfp to get the old behaviour.
- Pxtl 13y agoYeah, that. Providing portable, perfectly-consistent universal FP is needed as an option (going without it kills whole classes of networked computing applications), but should never be mandatory, not for a language that claims to be general-purpose.
- pcwalton 13y agoWouldn't you only need to change the control word when switching between 32-bit and 64-bit arithmetic? I don't think that would happen in every instruction, at least for the FP-intensive apps I work on (graphics).