diff options
| author | bjh21 <bjh21@NetBSD.org> | 2002-05-12 13:12:45 +0000 |
|---|---|---|
| committer | bjh21 <bjh21@NetBSD.org> | 2002-05-12 13:12:45 +0000 |
| commit | 010758bf165388af6dd304172ce3434b9ac1afd6 (patch) | |
| tree | d2e8ea0aac78107d82e6a65d3b5763ae48c3bc4a /lib/libc/softfloat/softfloat-specialize | |
| parent | 8cb3bbd37c8f1e068cfd32976606ce961b526167 (diff) | |
Add SIGFPE support to SoftFloat, so fpsetmask/fpgetmask now work. A new
variable, float_exception_mask (#defined to _softfloat_float_exception_mask)
contains the current exception mask.
Also make the argument to float_raise into an fp_except.
Also synchronise file header comments between files.
Diffstat (limited to 'lib/libc/softfloat/softfloat-specialize')
| -rw-r--r-- | lib/libc/softfloat/softfloat-specialize | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libc/softfloat/softfloat-specialize b/lib/libc/softfloat/softfloat-specialize index a4fdad072f6..8ff3befd02a 100644 --- a/lib/libc/softfloat/softfloat-specialize +++ b/lib/libc/softfloat/softfloat-specialize @@ -1,3 +1,6 @@ +/* $NetBSD: softfloat-specialize,v 1.3 2002/05/12 13:12:45 bjh21 Exp $ */ + +/* This is a derivative work. */ /* =============================================================================== @@ -29,6 +32,8 @@ this code that are retained. =============================================================================== */ +#include <signal.h> + /* ------------------------------------------------------------------------------- Underflow tininess-detection mode, statically initialized to default value. @@ -48,11 +53,15 @@ substitute a result value. If traps are not implemented, this routine should be simply `float_exception_flags |= flags;'. ------------------------------------------------------------------------------- */ -void float_raise( int8 flags ) +fp_except float_exception_mask = 0; +void float_raise( fp_except flags ) { float_exception_flags |= flags; + if ( flags & float_exception_mask ) { + raise( SIGFPE ); + } } /* |
