48 #define RNAN 0xffc00000
49 #define DNAN0 0xfff80000
54 #define RNAN 0xffc00000
55 #define DNAN0 0xfff80000
60 #define RNAN 0xff800001
62 #define DNAN0 0xfff00000
66 #define DNAN1 0xfff00000
72 #define FA7UL (unsigned Long) 0xfa7a7a7aL
75 #define FA7UL 0xfa7a7a7aUL
92 _uninit_f2c(x, type, len)
void *x;
int type;
long len;
94 _uninit_f2c(
void *x,
int type,
long len)
111 *(
unsigned short*)x = 0xfa7a;
121 *(
unsigned Long*)x = rnan;
124 lx = (
unsigned Long*)x;
129 printf(
"Surprise type %d in _uninit_f2c\n", type);
136 *(
unsigned short*)x = 0xfa7a;
142 lx = (
unsigned Long*)x;
151 lx = (
unsigned Long*)x;
160 lx = (
unsigned Long*)x;
161 for(lxe = lx + 2*len; lx <
lxe; lx += 2) {
190 _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
195 signal(SIGFPE, SIG_DFL);
204 #include "/usr/include/sigfpe.h"
205 #include "/usr/include/sys/fpu.h"
209 ieeeuserhand(exception,
val) unsigned exception[5];
int val[2];
211 ieeeuserhand(
unsigned exception[5],
int val[2])
215 fprintf(stderr,
"ieee0() aborting because of ");
216 if(exception[0]==_OVERFL) fprintf(stderr,
"overflow\n");
217 else if(exception[0]==_UNDERFL) fprintf(stderr,
"underflow\n");
218 else if(exception[0]==_DIVZERO) fprintf(stderr,
"divide by 0\n");
219 else if(exception[0]==_INVALID) fprintf(stderr,
"invalid operation\n");
220 else fprintf(stderr,
"\tunknown reason\n");
227 ieeeuserhand2(j) unsigned
int **j;
229 ieeeuserhand2(
unsigned int **j)
232 fprintf(stderr,
"ieee0() aborting because of confusion\n");
241 sigfpe_[i].count = 1000;
242 sigfpe_[i].trace = 1;
243 sigfpe_[i].repls = _USER_DETERMINED;
245 sigfpe_[1].repls = _ZERO;
247 _EN_UNDERFL|_EN_OVERFL|_EN_DIVZERO|_EN_INVALID,
248 ieeeuserhand,_ABORT_ON_ERROR,ieeeuserhand2);
254 #include "fpu_control.h"
258 #define __setfpucw(x) __fpu_control = (x)
263 #undef Can_use__setfpucw
264 #define Can_use__setfpucw
270 #if (defined(__mc68000__) || defined(__mc68020__) || defined(mc68020) || defined (__mc68k__))
274 #ifdef Can_use__setfpucw
275 __setfpucw(_FPU_IEEE + _FPU_DOUBLE + _FPU_MASK_OPERR + _FPU_MASK_DZ + _FPU_MASK_SNAN+_FPU_MASK_OVFL);
277 __fpu_control = _FPU_IEEE + _FPU_DOUBLE + _FPU_MASK_OPERR + _FPU_MASK_DZ + _FPU_MASK_SNAN+_FPU_MASK_OVFL;
278 _FPU_SETCW(__fpu_control);
281 #elif (defined(__powerpc__)||defined(_ARCH_PPC)||defined(_ARCH_PWR))
284 #ifdef Can_use__setfpucw
291 __setfpucw(_FPU_DEFAULT + _FPU_MASK_IM+_FPU_MASK_OM+_FPU_MASK_UM);
295 __fpu_control = _FPU_DEFAULT +_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_UM;
296 _FPU_SETCW(__fpu_control);
303 #ifndef _FPU_EXTENDED
304 #define _FPU_EXTENDED 0
307 #define _FPU_DOUBLE 0
309 #ifdef Can_use__setfpucw
310 __setfpucw(_FPU_IEEE - _FPU_EXTENDED + _FPU_DOUBLE - _FPU_MASK_IM - _FPU_MASK_ZM - _FPU_MASK_OM);
312 __fpu_control = _FPU_IEEE - _FPU_EXTENDED + _FPU_DOUBLE - _FPU_MASK_IM - _FPU_MASK_ZM - _FPU_MASK_OM;
313 _FPU_SETCW(__fpu_control);
318 fprintf(stderr,
"\n%s\n%s\n%s\n%s\n",
319 "WARNING: _uninit_f2c in libf2c does not know how",
320 "to enable trapping on this system, so f2c's -trapuv",
321 "option will not detect uninitialized variables unless",
322 "you can enable trapping manually.");
333 #include <machine/fpu.h>
337 ieee_set_fp_control(IEEE_TRAP_ENABLE_INV);
344 #define _INCLUDE_HPUX_SOURCE
349 #define fpsetmask fesettrapenable
350 #define FP_X_INV FE_INVALID
367 fp_enable(TRP_INVALID);
368 fp_trap(FP_TRAP_SYNC);
static unsigned Long rnan
static unsigned Long dnan0
static unsigned Long dnan1