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

restatement and enlarged commentary on July motion #19: multiple exceptions



Date: Wed Jun 28 14:52:34 PDT 2006
From: David Hough
 
Motion: Define multiple-exception semantics
 
Rationale:
The current specification doesn't specify what happens when alternate
exception handling is enabled for an exception that arises on an operation
that signals more than one exception at once (overflow+inexact or
underflow+inexact).     Since languages define almost everything else to
do with alternate exception handling, they should define this too.
 
Alternative possibilities include requiring that all enabled
alternate exception handling is invoked (what if the first one is a
longjump?) and requiring that flags be raised for all default exceptions.
I don't know if the latter is consistent with any existing hardware.

The proposed text is intended to encompass nonstandard
operations that might signal additional
combinations of exceptions, since the programming interface of
5.7.2. Exception signaling operations explicitly caters to that possibility.

The proposed text seems not to contradict conventional wisdom about
754 overflow/underlow:

1) If no alternate exception handling is enabled, the overflow signal
results in raising the overflow and inexact flags always.
The underflow signal results either in no action or in raising the
underflow and inexact flags always.

2) If alternate exception handling is enabled for overflow/underflow,
regardless of whether alternate exception handling is enabled for inexact,
then that alternate exception handling is invoked and no inexact exception
is signaled except if specified explicitly as part of the alternate
exception handling for overflow/underflow.

3) If no alternate exception handling is enabled for overflow/underflow,
but is enabled for inexact, and the result would be inexact
(always for overflow, sometimes for underflow),
then the effect on overflow/underflow flags is currently UNDEFINED and
alternate exception handling is invoked for inexact.


Text:
* In 7.0, replace the existing text

  The only exceptions that can coincide on the same operation are
  inexact with overflow and inexact with underflow.

with

  For the operations specified in this standard,
  the only exceptions that can coincide on the same operation are
  inexact with overflow and inexact with underflow.
  When an operation signals coincident exceptions, none of which
  have alternate exception handling enabled, each signaled exception will
  receive its default handling.
  When an operation signals coincident exceptions, some or all of which
  have alternate exception handling enabled, alternate
  exception handling will be invoked for the most important exception,
  and languages define
  whether other signaled exceptions receive default handling,
  alternate handling, or are ignored.    Exceptions are listed in this
  clause in order of decreasing importance (invalid most important,
  inexact least important).

* Delete A.4. Precedence, since that specification is subsumed in the foregoing.



Comment: in a more easily understood parallel universe, no invocation of
an operation would
signal more than one exception, the most important,
and the default handling of every exception
would be to raise the corresponding flag.
But we can't get to that universe from ours without entering an
upward-performance-incompatibility warp.

754 | revision | FAQ | references | list archive