XLF IEEE Handler?

jgs jgs at gn.ecn.purdue.edu
Wed Apr 10 08:51:43 AEST 1991


I'm just posting this for a friend so please direct 
e-mail to the address below

uunet!idaho!othello!rhodesii

Does anybody know if it is possible to make XLF FORTRAN 
on an IBM RS-6000 to trap on a NAN or NANQ (or any other 
floating point exception)?

>From what I can glean in the documentation is that 
exception handling can be enabled with:

     include'fexcp.h'
     call signal(sigtrap,xl_trce)

and an exception will be generated under the following conditions:

a. subscript out of bounds (if you specify the 
       CHECK option at compile time)
b. substring out of bounds (if you specify the
       CHECK option at compile time)
c. Fixed point division by zero.
d. Flow of program control reaches a location for
   which a semantic error with severity level S
   was issued when the program was compiled.

Unfortunately these are not any of the conditions I am
interested in (And even if I was this is not particularly
useful since it only produces a traceback through the 
offset number of the routine. You then have to map the offset 
to the source number by checking the offset on the source listing.). 

What I want is something like SUN's ieee_handler that will trap on 
the 5 floating point exceptions found in IEEE 754-1985:

     1. invalid opertion
     2. division by zero
     3. overflow
     4. underflow
     5. inexact

Have I missed something in the documentation or isn't this 
implemented on the RS-6000?

Joel Rhodes
591 Park Ave. Suite 302
Idaho Falls ID. 83402
ph(208) 522-8443
uunet!idaho!othello!rhodesii



More information about the Comp.unix.aix mailing list