[J3] [EXTERNAL] Re: Exception handling in one Ada processor
Malcolm Cohen
malcolm at nag-j.co.jp
Thu Jul 25 21:18:45 EDT 2019
>The example in my paper
>caught overflow or underflow to allow computing the L2 norm of a vector
>by the obvious (and fast) method, unless an overflow or underflow
>occurs.
After telling us that exceptions were for truly exceptional cases not ordinary ones, you have this very ordinary example.
> Without exceptions, one needs to use the slower method that
>checks at every step.
Not so. One just checks the IEEE flags at one’s own convenience. Which would presumably not be within the innermost loop. But if it’s a long vector waiting to the end might also be a suboptimal choice.
Using an exception handling mechanism just means the compiler inserts the checks. Without any user control, and so could very well be a suboptimal choice.
(If you’re thinking the hardware might help cut the evaluation short with some kind of “IEEE trapping” behaviour, think again. Some hardware has an order of magnitude slowdown if traps are enabled, some other hardware simply does not support IEEE traps at all.)
This example is in any case handled well by our existing IEEE support.
Cheers,
--
..............Malcolm Cohen, NAG Oxford/Tokyo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20190726/92675f58/attachment-0001.html>
More information about the J3
mailing list