--- oo_1.0.1_src/tools/inc/solmath.hxx.bak 2002-10-16 08:53:26.000000000 +0200 +++ oo_1.0.1_src/tools/inc/solmath.hxx 2002-10-16 08:54:29.000000000 +0200 @@ -304,63 +304,10 @@ #define SOMA_FPRESET() #elif defined(LINUX) -#include +#include -#if defined(POWERPC) - -// we need to work around a compiler issue for ppc linux in gcc 3.1 - -#define _MYFPU_GETCW(cw) ( { \ - union { double d; fpu_control_t cw[2]; } tmp __attribute__ ((__aligned__(8))); \ - __asm__ ("mffs 0; fmr %0, 0" : "=f" (tmp.d) : : "fr0"); \ - (cw)=tmp.cw[1]; \ - tmp.cw[1]; } ) - -#define _MYFPU_SETCW(cw) { \ - union { double d; fpu_control_t cw[2]; } tmp __attribute__ ((__aligned__(8))); \ - tmp.cw[0] = 0xFFF80000; /* More-or-less arbitrary; this is a QNaN. */ \ - tmp.cw[1] = cw; \ - __asm__ ("lfd%U0 0,%0; mtfsf 255,0" : : "m" (tmp.d) : "fr0"); \ -} - -#endif - -extern inline void glibc_setfpucw( fpu_control_t set ) -{ - fpu_control_t cw; - - /* Fetch the current control word. */ - -#if defined(POWERPC) - _MYFPU_GETCW(cw); -#else - _FPU_GETCW(cw); -#endif - - /* Preserve the reserved bits, and set the rest as the user - specified (or the default, if the user gave zero). */ - cw &= _FPU_RESERVED; - cw |= set & ~_FPU_RESERVED; - -#if defined(POWERPC) - _MYFPU_SETCW(cw); -#else - _FPU_SETCW(cw); -#endif - -} - -#define __setfpucw( control_word ) glibc_setfpucw( control_word ) - -#if defined(POWERPC) -/* set bit to 1 to enable that exception */ -/* _FPU_MASK_ZM | _FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_IM */ -#define SOMA_FPEXCEPTIONS_ON() __setfpucw( _FPU_DEFAULT | 0x000000F0 ) -#define SOMA_FPEXCEPTIONS_OFF() __setfpucw( _FPU_DEFAULT ) -#else -#define SOMA_FPEXCEPTIONS_ON() __setfpucw( _FPU_DEFAULT & ~0x001F ) -#define SOMA_FPEXCEPTIONS_OFF() __setfpucw( _FPU_IEEE ) -#endif +#define SOMA_FPEXCEPTIONS_ON() feenableexcept (FE_ALL_EXCEPT) +#define SOMA_FPEXCEPTIONS_OFF() fedisableexcept (FE_ALL_EXCEPT) #define SOMA_FPRESET() #else