Date: Thu, 10 Jan 2002 09:31:24 -0700 From: Nate Williams <nate@yogotech.com> To: Bruce Evans <bde@zeta.org.au> Cc: Nate Williams <nate@yogotech.com>, Daniel Eischen <eischen@pcnet1.pcnet.com>, Dan Eischen <eischen@vigrid.com>, Peter Wemm <peter@wemm.org>, Archie Cobbs <archie@dellroad.org>, Alfred Perlstein <bright@mu.org>, <arch@FreeBSD.ORG> Subject: Re: Request for review: getcontext, setcontext, etc Message-ID: <15421.49628.630456.688977@caddis.yogotech.com> In-Reply-To: <20020110141330.M10745-100000@gamplex.bde.org> References: <15420.58839.954146.527043@caddis.yogotech.com> <20020110141330.M10745-100000@gamplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> > > > Assuming I used followed things up with 'fnsave', will the exception be
> > > > triggered by a frstor, and thus the exception will be correctly reported
> > > > by the thread triggering the exception?
> > >
> > > Only on broken systems.
> >
> > Why is reporting a SIGFPE considered broken? This is a valid exception,
> > and it should be reported.
>
> Because the SIGFPE is for the broken context-switching code and not for
> the program.
Ok, let's try again. How can I make sure that a SIGFPE that occur due
to a FPU operation is properly reported using fsave/frestor?
(I've asked this before, but apparently not in a way that made sense.)
Here's a snippet again.
fldz
fld1
fdiv %st,%st(1) # 1.0 / 0.0 (should cause a SIGFPE exception)
fsave #fooLocation
// Mumble mumble other code to choose a new thread
frstor #barLocation
Questions
* Would 'thread 1' get a SIGFPE before the fsave instruction? (Yes, No, maybe)
* If above is maybe, would it get the SIGFPE after a frstor #fooLocation?
* If answer to both is NO, how do I make sure that the context of the
fdiv receives a SIGFPE? Can I use a different operation? Can I add
instructions to cause this to work correctly?
> > > See Appendix C of the Intel MMX manual (1997 version at least) for more
> > > details.
> >
> > I don't have the MXX manual, just the x86/87 programming manuals for x86
> > (X <= 3).
>
> Same here, except I also have the 486 manual and a web browser :-).
Ahh, these manuals are online. Thanks for the URL. :)
Nate
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15421.49628.630456.688977>
