Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Sep 1998 11:32:44 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, cracauer@cons.org, current@FreeBSD.ORG
Subject:   Re: Floating Point Exceptions, signal handlers & subsequent ops
Message-ID:  <199809010132.LAA14077@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>OK, I had another look and Linux and Solaris both have
>#define FPE_INTDIV      1       /* integer divide by zero */
>#define FPE_INTOVF      2       /* integer overflow */
>#define FPE_FLTDIV      3       /* floating point divide by zero */
>#define FPE_FLTOVF      4       /* floating point overflow */
>#define FPE_FLTUND      5       /* floating point underflow */
>#define FPE_FLTRES      6       /* floating point inexact result */
>#define FPE_FLTINV      7       /* invalid floating point operation */
>#define FPE_FLTSUB      8       /* subscript out of range */
>
>I think that's the way to go for the code to pass as the second
>argument to the signal handler.

Yes.  Add FPE_FLTSTK (floating point stack overflow).  <machine/ieeefp.h>
is missing this too.  Delete FPE_FLTSUB (does it mean bounds check
exception?  In any case, it shouldn't have FLT in its name).  Add
FPE_FLT_DNM[L] (floating point denormal operand).  Actually, I prefer
the current naming scheme, and glibc uses one close to it, at least in
its manual:

FPE_INTOVF_TRAP		this and following ones have same name as ours
FPE_INTDIV_TRAP
FPE_SUBRNG_TRAP
FPE_FLTOVF_TRAP
FPE_FLTDIV_TRAP
FPE_FLTUND_TRAP
FPE_FLTDECOVF_TRAP	floating point decimal overflow trap
[same names with s/TRAP/FAULT/]

That's about all in the manual :(.  Then, apparently for hurd only:

FPE_FLTDNR_FAULT	denormalized (sic) operand
FPE_FLTINX_FAULT	... loss of precision

Still not complete.

>Which header file should I put the FPE_...... macros in?  Should I
>replace the FPE_......_TRAP macros in trap.h? That way, I can add our
>FPE_FPU_NP_TRAP to the set above.

<machine/trap.h>.  It's included by <machine/trap.h> and is almost
free of pollution.

FPE_FPU_NP_TRAP won't happen in practice.

Bruce

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809010132.LAA14077>