[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a question about formatOf operations



IMO 754R needs to restrict itself to things that are widely desired or
which at least don't have widespread opposition. 

To put things into perspective, there is a lot unsaid in 754 about expression
evaluation that has caused difficulties for almost 30 years.     Why do 
numerical
results vary with compiler release and optimization level?   

When is it OK to use higher-precision anonymous temporaries in expression 
evaluation?    
How can that be forced? How can that be suppressed?
When is double rounding in assignments OK?
How can double rounding be forced?   How can it be suppressed?

Or more generally: how can the programmer say what he wants, or even say that
he doesn't care much?

It's a big deal: differences in interpretation cause test vectors to pass or 
fail,
and then even hardware vice presidents get excited if somebody concludes the
hardware is defective (usually not true, but hard to prove at a casual glance).

754R has a lot of mechanism in clause 10 to deal with such issues: 
recommending that languages
define the meaning of source codes (as sequences of arithmetic operations),
recommending that implementations not change the meaning by value-changing
optimization unless the programmer permits that,
recommending that widenTo modes be
provided when multiple formats are supported.
These are language definition issues and hardware vice presidents can't be 
bothered
with them until they get into one of the jams mentioned above.

Clause 5 requires formatOf operations, to implement the widenTo modes,
and to provide a way to suppress double rounding when that's desired.
The necessary hardware support is complicated enough (if performance is desired
for multiple formats)
and perhaps the necessary language definition and software support should not  
be more complicated than that.


754 | revision | FAQ | references | list archive