Re: x87 status word size
Re: x87 status word size
- Subject: Re: x87 status word size
- From: Terry Lambert <email@hidden>
- Date: Mon, 15 Jun 2009 14:58:17 -0700
On Jun 15, 2009, at 11:11 AM, Jonas Maebe <email@hidden>
wrote:
Hello,
Why is the x87 tag word field (__fpu_ftw) in
_STRUCT_X86_FLOAT_STATE32 in osfmk/mach/i386/_structs.h only 8 bits?
The hardware tag word is 16 bit. I guess it "overflows" into the
next "__fpu_rsrv1" field when saving/restoring the fpu state, so in
practice it probably doesn't really matter as long as you don't
directly access it (but I would like to do so, to reset the fpu
state within a signal handler).
Thanks,
Jonas
(I asked this question 2 months back on darwin-dev, but didn't get a
reply; maybe someone here knows)
Generally, it's to make it a pain to do what you are trying to do so
that you will reconsider and not do it.
x87 exceptions are not definite exceptions, so the state that you will
be mucking with after a SIGFPE is thrown is the state some time past
the point of the exception that caused it to be raised.
You should really be using fegetexceptflag/fetestexcept/feclearexcept
et. al to make your code processor neutral, rather that bit-banging on
the current thread state (the only exception to this would be if you
were writing a debugger), since we won't promise to not change the
context layout or contents at some future date.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden