Comments on Sun's Proposal for Extension of Java Floating
Point in JDK 1.2
David Chase
chaseaworld.std.com
Wed Aug 12 10:10:53 PDT 1998
An elaboration to a remark in my previous message that
one person has already pointed out was unclear:
>For access to fused-multiply-add, there is little need
>to modify the existing system; simply write it portably
>in Java, put it where anyone can get it, and on those systems
>where it can replaced with a machine instruction, do the
>obvious substitution. ... If programmers need the operation,
>they can ask for it by name. If they really like the existing
>syntax, then calls to the appropriate method can be inserted
>either with a source transformation or a bytecode transformation.
>(The input pattern is simply "dmul; dadd", and the output
>is "invokestatic SomeClass.fusedMultiplyAdd(DDD)D". It does
>add one byte to the code.)
>This preserves portability, provides the instruction to
>those people who want it, and eliminates differing-precision
>surprises.
By "eliminates differing-precision surprises", I do not
mean that the replacement of "dmul; dadd" with a fused
multiply-add is bit-for-bit compatible. Changing the
bytecodes to introduce fused mul-add where none existed
before is an intentional operation, and anyone doing
this should not be "surprised" if/when it yields different
results.
Sorry for the unclear original wording.
David Chase
NaturalBridge, LLC
More information about the Numeric-interest
mailing list