IEEE floating-point... testing the "binding"... your help requested
uunet!netcom.com!segfault!rfg
uunet!netcom.com!segfault!rfg
Thu Apr 1 08:54:13 PST 1993
I'm currently attempting to write yet more small test programs to check
and see if the behaviors of C (and C++) implementations on various alleged
"IEEE 754 conformant" systems are "reasonable" and/or conformant to the
requirements/specifications/recomendations contained in the NCEG's
"Floting-point C Extensions" document. (After all, what good are standards
like these if there's nobody out there checking for conformance?)
Anyway, in some of the small test programs I have been trying to write, I
want to check that:
o IEEE FP exceptions are raised when the IEEE 754 standard says
they should be, and
o IEEE FP traping occurs (for various "exception" conditions) when
a given exception condition is raised and when the IEEE traping
has been "enabled" for that particular exception condition.
(By the way, I have already learned that some C compilers generate code which
fails to fully satisfy the first of these two IEEE 754 requirements... which
is no big surprize.)
Anyway, the few test programs I have written so far have been written to
assume the presence of a small external library which implements a sort of
"portable standard interface" to the implementation-specific library routines
(if any) which are available on the target system and which permit the
programmer to clear and/or test the five IEEE FP "exception flags", or to
enable trapping (to a signal handler) for each of the five standard exception
types.
I have already managed to implement versions of this small library for SunOS
4.1.x systems, and also for System V, Release 4 systems. In each of these
two cases, implementation of this (very) small library was trivially easy
because the implementation-supplied libraries (in particular libm.a) already
supplied functions to clear, test, and enable traps for each of the IEEE FP
exception types, and these implementation-supplied routines were amply
documented (in the on-line man pages and elsewhere).
My efforts to implement this trivial library on a number of other UNIX systems
have faltered however, primarily (I think) because of a lack of documentation
of the implementation-supplied library functions which provide the programmer
with the capability to clear, test, and enable traps for IEEE FP exceptions.
More specifically, I have been unable to learn how to do these simple opera-
tions on the following types of systems (to which I have access):
HP 9000/7xx HP/UX A.08.xx
IBM RS/6000 AIX 3.2
DECstation Ultrix 4.2
SGI (MIPS/??) IRIX 4.x
DEC Alpha OSF/1 1.2
I would very much like to run my small IEEE FP test cases on these kinds of
systems, but I currently unable to do so because of my own ignorance of how
to clear, test, and enable traps for each of the five standard IEEE FP
exception types on these systems.
I'm hoping that NCEG members might be able to help me out by telling me how
to implement the "clear", "test", and "trap enable" functions for the IEEE
FP exceptions on each of the above system types (as well as others that I
might run my tests on in future, e.g. MS-DOS, OS/2, and MS-NT).
If you know how to implement these simple operations on any of the above
kinds of system, could you please drop me a line and tell me how to do it?
P.S. If I get some useful feedback from the NCEG membership on this subject,
then I'll be happy to post a summary of what I have learned, and describe
how to manipulate IEEE FP exceptions on as many types of systems as I can.
Such information might be useful to the NCEG during future deliberations
regarding the specification of a "standard" approach to IEEE FP exception
handling.
// Ronald F. Guilmette
// domain address: rfgasegfault.uucp
// uucp address: ...!uunet!netcom.com!segfault!rfg
More information about the Numeric-interest
mailing list