Time ordering of IEEE-754 exceptions

David G Hough at validgh validgh
Fri Oct 30 08:02:35 PST 1998


> From IEEE-754 7.0 Exceptions:  "For each type of 
> exception the implementation shall provide a status 
> flag that shall be set on any occurrence of the
> corresponding exception when no corresponding trap
> occurs."
> 
> The question the C committe has is:  Does the
> computing the default result (one event) and the 
> setting of the status flag (the second event) 
> happen at the same time?  Or, may the two events 
> be split in time and other events happen in between?
> 
> I assume that they happen at the same time and
> the the committee did not consider this issue.

Remember the IEEE 754 spec is for a programming environment.   In a
conforming environment, it appears as if these events were simultaneous.
For instance, in most microprocessors, the underlying hardware writes the
destination and the status register either simultaneously, or in a manner
that is indistinguishable from simultaneously as far as any software can
tell.     

Similarly system software may be intervening below the level of the 
conforming programming environment.    On Solaris running on SPARC, for
instance, aspects of IEEE 754 unimplemented in hardware are emulated in
software, and of course that software can't update the destination register
and %fsr at the same time, but it does happen in the same system call,
and so is indistinguishable to the user-mode software where the 754-conforming
environment might be found.

In a software-only user-mode implementation of IEEE arithmetic, the same
run-time library call would be expected to update the destination and the
status flags, "atomically" from the point of view of the defined API, but
of course as separate operations if viewed at the machine instruction
level from adb.




More information about the Numeric-interest mailing list