- if (exceptions& FP_EX_INVALID)
- d = p[0]/p[0];
- if (exceptions& FP_EX_OVERFLOW)
- {
- d = p[3] + p[3];
- exceptions&= ~FP_EX_INEXACT;
- }
- if (exceptions& FP_EX_UNDERFLOW)
- {
- if (exceptions& FP_EX_INEXACT)
- {
- d = p[2] * p[2];
- exceptions&= ~FP_EX_INEXACT;
- }
- else
- d = p[1] - p[2];
- }
- if (exceptions& FP_EX_DIVZERO)
- d = 1.0/p[0];
- if (exceptions& FP_EX_INEXACT)
- d = p[3] - p[2];
- return d;
+ fpu_control_t fcw;
+ int tem, ou;
+
+ _FPU_GETCW(fcw);
+
+ tem = (fcw>> 23)& 0x1f;
+
+ ou = exceptions& (FP_EX_OVERFLOW | FP_EX_UNDERFLOW);
+ if (ou& tem)
+ exceptions&= ~FP_EX_INVALID;
+
+ fcw&= ~0x1f;
+ fcw |= (exceptions | (exceptions<< 5));
+
+ _FPU_SETCW(fcw);