site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Hello, Thanks, Jonas -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Jun 15, 2009, at 11:11 AM, Jonas Maebe <jonas.maebe@elis.ugent.be> wrote: 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). (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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert