57 #define RNAN 0xffc00000
58 #define DNAN0 0xfff80000
63 #define RNAN 0xffc00000
64 #define DNAN0 0xfff80000
69 #define RNAN 0xff800001
71 #define DNAN0 0xfff00000
75 #define DNAN1 0xfff00000
81 #define FA7UL (unsigned Long) 0xfa7a7a7aL
84 #define FA7UL 0xfa7a7a7aUL
101 _uninit_f2c(
x, type, len)
void *
x;
int type;
long len;
103 _uninit_f2c(
void *x,
int type,
long len)
106 static int first = 1;
120 *(
unsigned short*)x = 0xfa7a;
130 *(
unsigned Long*)x = rnan;
133 lx = (
unsigned Long*)x;
138 printf(
"Surprise type %d in _uninit_f2c\n", type);
145 *(
unsigned short*)x = 0xfa7a;
151 lx = (
unsigned Long*)x;
160 lx = (
unsigned Long*)x;
169 lx = (
unsigned Long*)x;
170 for(lxe = lx + 2*len; lx <
lxe; lx += 2) {
199 _control87(EM_DENORMAL | EM_UNDERFLOW | EM_INEXACT, MCW_EM);
204 signal(SIGFPE, SIG_DFL);
213 #include "/usr/include/sigfpe.h"
214 #include "/usr/include/sys/fpu.h"
218 ieeeuserhand(exception,
val) unsigned exception[5];
int val[2];
220 ieeeuserhand(
unsigned exception[5],
int val[2])
224 fprintf(stderr,
"ieee0() aborting because of ");
225 if(exception[0]==_OVERFL) fprintf(stderr,
"overflow\n");
226 else if(exception[0]==_UNDERFL) fprintf(stderr,
"underflow\n");
227 else if(exception[0]==_DIVZERO) fprintf(stderr,
"divide by 0\n");
228 else if(exception[0]==_INVALID) fprintf(stderr,
"invalid operation\n");
229 else fprintf(stderr,
"\tunknown reason\n");
236 ieeeuserhand2(j) unsigned
int **j;
238 ieeeuserhand2(
unsigned int **j)
241 fprintf(stderr,
"ieee0() aborting because of confusion\n");
250 sigfpe_[
i].count = 1000;
251 sigfpe_[
i].trace = 1;
252 sigfpe_[
i].repls = _USER_DETERMINED;
254 sigfpe_[1].repls = _ZERO;
256 _EN_UNDERFL|_EN_OVERFL|_EN_DIVZERO|_EN_INVALID,
257 ieeeuserhand,_ABORT_ON_ERROR,ieeeuserhand2);
263 #include "fpu_control.h"
267 #define __setfpucw(x) __fpu_control = (x)
272 #undef Can_use__setfpucw
273 #define Can_use__setfpucw
279 #if (defined(__mc68000__) || defined(__mc68020__) || defined(mc68020) || defined (__mc68k__))
283 #ifdef Can_use__setfpucw
284 __setfpucw(_FPU_IEEE + _FPU_DOUBLE + _FPU_MASK_OPERR + _FPU_MASK_DZ + _FPU_MASK_SNAN+_FPU_MASK_OVFL);
286 __fpu_control = _FPU_IEEE + _FPU_DOUBLE + _FPU_MASK_OPERR + _FPU_MASK_DZ + _FPU_MASK_SNAN+_FPU_MASK_OVFL;
287 _FPU_SETCW(__fpu_control);
290 #elif (defined(__powerpc__)||defined(_ARCH_PPC)||defined(_ARCH_PWR))
293 #ifdef Can_use__setfpucw
300 __setfpucw(_FPU_DEFAULT + _FPU_MASK_IM+_FPU_MASK_OM+_FPU_MASK_UM);
304 __fpu_control = _FPU_DEFAULT +_FPU_MASK_OM+_FPU_MASK_IM+_FPU_MASK_UM;
305 _FPU_SETCW(__fpu_control);
312 #ifndef _FPU_EXTENDED
313 #define _FPU_EXTENDED 0
316 #define _FPU_DOUBLE 0
318 #ifdef Can_use__setfpucw
319 __setfpucw(_FPU_IEEE - _FPU_EXTENDED + _FPU_DOUBLE - _FPU_MASK_IM - _FPU_MASK_ZM - _FPU_MASK_OM);
321 __fpu_control = _FPU_IEEE - _FPU_EXTENDED + _FPU_DOUBLE - _FPU_MASK_IM - _FPU_MASK_ZM - _FPU_MASK_OM;
322 _FPU_SETCW(__fpu_control);
327 fprintf(stderr,
"\n%s\n%s\n%s\n%s\n",
328 "WARNING: _uninit_f2c in libf2c does not know how",
329 "to enable trapping on this system, so f2c's -trapuv",
330 "option will not detect uninitialized variables unless",
331 "you can enable trapping manually.");
342 #include <machine/fpu.h>
346 ieee_set_fp_control(IEEE_TRAP_ENABLE_INV);
353 #define _INCLUDE_HPUX_SOURCE
358 #define fpsetmask fesettrapenable
359 #define FP_X_INV FE_INVALID
376 fp_enable(TRP_INVALID);
377 fp_trap(FP_TRAP_SYNC);
static unsigned Long rnan
static unsigned Long dnan0
static unsigned Long dnan1