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

Re: [Stds-754] further rewording of motion #19



        20 minutes later & item 19 is revised again.  - Dan

Date: Fri, 14 Jul 2006 14:09:48 -0700 (PDT)
From: David Hough 754R work <754r@xxxxxxxxxxx>
Subject: [Stds-754] further rewording of motion #19

I realized that the word "coincide" was misleading since in the cases of
overflow and underflow, exception signals do not strictly coincide, 
although the default handling flag raising might coincide.

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
7.7.2, Exception signaling operations, explicitly caters to that possibility.
 
The proposed text seems not to conflict about the conventional wisdom about
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 9.1, replace the existing text

  Except for the exception signaling operations of 7.7.2,
  the only exceptions that can coincide on the same operation are
  inexact with overflow and inexact with underflow.

with

  An invocation of the
  signal-exception operation of 7.7.2 may signal any combination
  of exceptions.    For an invocation of any other operation
  specified by this standard, at most only two exceptions might be
  signaled, in just these combinations:
  overflow followed by inexact, and underflow followed by inexact.
  The inexact exception is signaled if the overflow exception
  receives default handling, and might be signaled if the underflow exception
  receives default handling.
 
  In general, when
  an operation signals more than one exception, none of which
  have alternate exception handling enabled, each signaled exception will
  receive its default handling.
  When an operation signals mmore than one exception, 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 E.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