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

Re: Zeroes and infinities



David Hough 754R work <754r@xxxxxxxxxxx> wrote:

The one exception, which can only be a political objection, is to not
include the LIA-1 mandatory mode "Terminate with message".  It is, after
all, the oldest and most widespread exception handling mode of all ....

754R does provide in annex E:

"Languages should define, and require implementations to provide, these
non-resumable modes:
        
 - transfer attached to a block: transfers control; no return possible.
transfer is a language-specific idiom for non-resumable control transfer;
conventional languages should offer several transfer idioms such as 
   - goto label: label might be local or global according to the semantics
of the language.
   - break: abandon the block controlled by this exception handling and go
to the next block.
   - throw exceptionName: causes an exceptionName not to be handled locally,
 but rather signaled to the next handling in scope, ...

and in annex G:

 "Debuggers should be able to detect and pause to the debugger when a
prespecified exception is signaled within a particular subprogram, or
within specified undebugged subprograms that it calls."

That's about the best that can be done in general.   Because 
in general, "Terminate with message" doesn't tell what to terminate
nor what the message should be nor to whom it should be directed.

Er, no.  Have you read LIA-1?  "Terminate with message" is the mode
that you MUST have seen, which terminates the program with a message.
Just that.

Speaking as a run-time system implementor, who has implemented several
systems that handle floating-point exceptions, and who is familiar with
a fair number of systems and architectures, the LIA-1 form is the ONLY
one that is effectively always implementable.  The others can be anything
from tricky to impossible, depending on what the hardware and operating
system provide.

For example, on the 8086/8087, most vector systems, the Hitachi SR2201,
the IBM 360/91 and 370/195 and many other systems, NONE of the ones in
IEEE 754R were implementable, but the LIA-1 one was.

And even in traditional batch processing environments, "Terminate with
message" is seldom welcome as a default response for underflow or inexact.

Oh, that is true.  It is a response to "error-type" exceptions, which
never included inexact and only sometimes included underflow.

In the original 754 context, if there is only going to be one 
exception handling response on which a programmer can rely on all
platforms, it had to be "nonstop default result and raise flag".

No, not at all.  It could have been "Terminate with message" for
overflow, divide-by-zero and invalid, and the others ignored.  But I
am not saying that it SHOULD have been - that is a matter of judgement,
and I am not dogmatic about which should be the default.

The legitimate complaint is that 754 required no portable way to get
any other handling when needed. 

Oh, I agree that is the main legitimate complaint.


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1@xxxxxxxxx
Tel.:  +44 1223 334761    Fax:  +44 1223 334679

754 | revision | FAQ | references | list archive