x87_clear_exceptions ();
else
{
- x87_fenv_t fenv;
- x87_read_environment (fenv.environment_bytes);
- (fenv.environment.x87_status_word) &=~ excepts;
- x87_write_environment (fenv.environment_bytes);
+ struct x87_fenv fenv;
+ x87_read_environment (&fenv);
+ (fenv.x87_status_word) &=~ excepts;
+ x87_write_environment (&fenv);
}
}
return (! (sse_p || x87_p));
sse_write_mxcsr ((sse_read_mxcsr ()) | excepts);
if (x87_p)
{
- x87_fenv_t fenv;
- x87_read_environment (fenv.environment_bytes);
- (fenv.environment.x87_status_word) |= excepts;
- x87_write_environment (fenv.environment_bytes);
+ struct x87_fenv fenv;
+ x87_read_environment (&fenv);
+ (fenv.x87_status_word) |= excepts;
+ x87_write_environment (&fenv);
x87_trap_exceptions ();
}
/* There seems to be no good way to request a trap in SSE.
sse_write_mxcsr ((sse_read_mxcsr ()) | ((*flagp) & excepts));
if (x87_p)
{
- x87_fenv_t fenv;
- x87_read_environment (fenv.environment_bytes);
- (fenv.environment.x87_status_word) |= ((*flagp) & excepts);
- x87_write_environment (fenv.environment_bytes);
+ struct x87_fenv fenv;
+ x87_read_environment (&fenv);
+ (fenv.x87_status_word) |= ((*flagp) & excepts);
+ x87_write_environment (&fenv);
}
return (! (sse_p || x87_p));
}
if (sse_p)
(envp->fenv_sse.sse_mxcsr) = (sse_read_mxcsr ());
if (x87_p)
- x87_read_environment (envp->fenv_x87.environment_bytes);
+ x87_read_environment (&envp->fenv_x87);
return (! (sse_p || x87_p));
}
if (sse_p)
sse_write_mxcsr (envp->fenv_sse.sse_mxcsr);
if (x87_p)
- x87_write_environment (envp->fenv_x87.environment_bytes);
+ x87_write_environment (&envp->fenv_x87);
return (! (sse_p || x87_p));
}
{
x87_clear_exceptions ();
x87_write_control_word
- ((envp->fenv_x87.environment.x87_control_word) | FE_ALL_EXCEPT);
+ ((envp->fenv_x87.x87_control_word) | FE_ALL_EXCEPT);
}
return (0);
}
typedef int fexcept_t;
-typedef struct
+struct sse_fenv
{
int sse_mxcsr;
-} sse_fenv_t;
+};
/* FIXME: This structure needs to be packed. */
-struct x87_environment
+struct x87_fenv
{
unsigned short x87_control_word;
unsigned short x87_unused1;
unsigned short x87_unused5;
};
-typedef union
-{
- struct x87_environment environment;
- unsigned char environment_bytes [sizeof (struct x87_environment)];
-} x87_fenv_t;
-
typedef struct
{
- sse_fenv_t fenv_sse;
- x87_fenv_t fenv_x87;
+ struct sse_fenv fenv_sse;
+ struct x87_fenv fenv_x87;
} fenv_t;
\f
#define FE_TONEAREST 0