How do Java runtimes targeting pre-SSE2 processors implement
floating-point basic operations?
How does(did) a Java runtime targeting an Intel processor without SSE2
deal with floating-point denormals, when strictfp is set?
Even when the 387 FPU is set for 53-bit precision, it keeps an oversized
exponent range that:
forces to detect underflow/overflow at each intermediate result, and
makes it difficult to avoid double-rounding of denormals.
Strategies include re-computing the operation that resulted in a denormal
value with emulated floating-point, or a permanent exponent offset along
the lines of this technique to equip OCaml with 63-bit floats, borrowing a
bit from the exponent in order to avoid double-rounding.
In any case, I see no way to avoid at least one conditional branch for
each floating-point computation, unless the operation can statically be
determined not to underflow/overflow. How exceptional (overflow/underflow)
cases are dealt with is part of my question, but this cannot be separated
from the question of the representation (the permanent exponent offset
strategy seems to mean that only overflows need to be checked for, for
instance).
No comments:
Post a Comment