summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2019-03-03 01:24:56 +0000
committerRichard Lowe <richlowe@richlowe.net>2019-03-15 23:45:07 +0000
commit618d207ffd5dca94c4a4715afd5a15b0025530ea (patch)
tree36bd11015155030d4351fc2eaad245b2a875732d /usr/src
parent6760681825872e5ab549ae9309431453fa97e428 (diff)
downloadillumos-joyent-618d207ffd5dca94c4a4715afd5a15b0025530ea.tar.gz
10495 libc should know how many FPU exceptions there are
Reviewed by: Jason King <jason.king@joyent.com> Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Gergő Mihály Doma <domag02@gmail.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Gordon Ross <gwr@nexenta.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/head/floatingpoint.h2
-rw-r--r--usr/src/lib/libc/port/fp/sigfpe.c5
-rw-r--r--usr/src/man/man3c/sigfpe.3c14
-rw-r--r--usr/src/uts/common/sys/ieeefp.h6
4 files changed, 17 insertions, 10 deletions
diff --git a/usr/src/head/floatingpoint.h b/usr/src/head/floatingpoint.h
index 1935b611c6..c8d658cc83 100644
--- a/usr/src/head/floatingpoint.h
+++ b/usr/src/head/floatingpoint.h
@@ -62,8 +62,6 @@ extern "C" {
typedef __FILE FILE;
#endif
-#define N_IEEE_EXCEPTION 5 /* Number of floating-point exceptions. */
-
typedef int sigfpe_code_type; /* Type of SIGFPE code. */
typedef void (*sigfpe_handler_type)(); /* Pointer to exception handler */
diff --git a/usr/src/lib/libc/port/fp/sigfpe.c b/usr/src/lib/libc/port/fp/sigfpe.c
index 9b1942423f..dca4e3428a 100644
--- a/usr/src/lib/libc/port/fp/sigfpe.c
+++ b/usr/src/lib/libc/port/fp/sigfpe.c
@@ -150,6 +150,11 @@ _sigfpe_master(int sig, siginfo_t *siginfo, void *arg)
case FPE_FLTOVF:
exception = fp_overflow;
goto ieee;
+#if defined(__i386) || defined(__amd64)
+ case FPE_FLTDEN:
+ exception = fp_denormalized;
+ goto ieee;
+#endif
default: /* The common default treatment is to abort. */
break;
}
diff --git a/usr/src/man/man3c/sigfpe.3c b/usr/src/man/man3c/sigfpe.3c
index 5f40071c75..2067e19301 100644
--- a/usr/src/man/man3c/sigfpe.3c
+++ b/usr/src/man/man3c/sigfpe.3c
@@ -17,7 +17,6 @@ sigfpe \- signal handling for specific SIGFPE codes
.fi
.SH DESCRIPTION
-.sp
.LP
The \fBsigfpe()\fR function allows signal handling to be specified for
particular \fBSIGFPE\fR codes. A call to \fBsigfpe()\fR defines a new handler
@@ -41,6 +40,15 @@ FPE_FLTOVF fp_overflow \(mi floating-point overflow
FPE_FLTINV fp_invalid \(mi floating-point invalid operation
.fi
.in -2
+.LP
+And additionally on the x86 architecture:
+.sp
+.in +2
+.nf
+FPE_FLTDEN fp_denormalized \(mi floating-point denormalized result
+.fi
+.in -2
+
.sp
.LP
@@ -140,7 +148,6 @@ main(void) {
.in -2
.SH FILES
-.sp
.ne 2
.na
\fB\fB/usr/include/floatingpoint.h\fR\fR
@@ -161,7 +168,6 @@ main(void) {
.RE
.SH ATTRIBUTES
-.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -177,12 +183,10 @@ MT-Level Safe
.TE
.SH SEE ALSO
-.sp
.LP
\fBsigaction\fR(2), \fBabort\fR(3C), \fBsignal\fR(3C), \fBattributes\fR(5),
\fBfloatingpoint.h\fR(3HEAD)
.SH DIAGNOSTICS
-.sp
.LP
The \fBsigfpe()\fR function returns (void(*)())-1 if \fIcode\fR is not zero or
a defined \fBSIGFPE\fR code.
diff --git a/usr/src/uts/common/sys/ieeefp.h b/usr/src/uts/common/sys/ieeefp.h
index 9b47e6ce47..2ee4ec4d51 100644
--- a/usr/src/uts/common/sys/ieeefp.h
+++ b/usr/src/uts/common/sys/ieeefp.h
@@ -27,8 +27,6 @@
#ifndef _SYS_IEEEFP_H
#define _SYS_IEEEFP_H
-#pragma ident "%Z%%M% %I% %E% SMI" /* SunOS4.0 1.6 */
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -60,6 +58,7 @@ enum fp_exception_type { /* exceptions according to bit number */
fp_overflow = 3,
fp_invalid = 4
};
+#define N_IEEE_EXCEPTION 5 /* Number of floating-point exceptions. */
enum fp_trap_enable_type { /* trap enable bits according to bit number */
fp_trap_inexact = 0,
@@ -93,6 +92,7 @@ enum fp_exception_type { /* exceptions according to bit number */
fp_underflow = 4,
fp_inexact = 5
};
+#define N_IEEE_EXCEPTION 6 /* Number of floating-point exceptions. */
enum fp_trap_enable_type { /* trap enable bits according to bit number */
fp_trap_invalid = 0,
@@ -109,7 +109,7 @@ enum fp_class_type { /* floating-point classes */
fp_zero = 0,
fp_subnormal = 1,
fp_normal = 2,
- fp_infinity = 3,
+ fp_infinity = 3,
fp_quiet = 4,
fp_signaling = 5
};