extended precision hazards

matthew fassiotto uunet!austin.metrowerks.com!fassiott
Thu Jun 26 09:18:41 PDT 1997


>David Hough comments:
>
>> /* On a machine with IEEE extended-precision registers, it is
>>  * necessary to specify double-precision (53-bit) rounding precision
>>  * before invoking strtod or dtoa...
>>  */
>>
>> An all-too-familiar warning.    The point relative to the ongoing Java
>> discussions in this mailing list is not that C compilers and C programs
>> can't be written to handle IEEE 754 extended precision correctly and
>> consistently, but that after 15 years they still usually aren't...
>
>There is another point relative to ongoing Java discussions.  One reason
>for the abysmal state of C compilers on some extended-based platforms is
>the lack of guidance from the C standards body, a situation that would
>change considerably with the adoption of C9x.
>
>Unfortunately, history has a chance to repeat itself.  By ignoring
>the performance issues of the vast number of platforms with extended
>extended registers or fused multiply-add operations, the Java spec
>invites nonconformance from vendors who choose not to suffer 1.5X
>to 10X performance degradation in numerical codes in order to match
>the results of less capable architectures.  At worst, that
>nonconformance will be as random and capricious as has the
>situation been with C.

To throw a little more randomness and capriciousness into the mix, consider
that
the performance issues on extended platforms such as X86 are more complicated
than just the Compilers or whatever language.  On X86, the performance of
many of the fp instructions depend
on the precision control setting.  For instance fdiv takes 39 cycles when
pc=64 bits, but only 19 cycles
when pc=24 bits.

So I guess the 1.5X-10X range takes in to consideration the fact that some
of the degradation will be offset by setting pc=53 bits instead of what the
C9X standard specifies as default(64 bit).

In fact,  in some X86 environments I notice that pc=53 bits by default.
This is the case with our compiler and Microsoft's on Windows NT.

On OS/2  I've noticed pc=64 bits.  I never figured out if this is the OS or
the compiler that accounts for this.


-- Matt Fassiotto
    MetroWerks Corporation






More information about the Numeric-interest mailing list