Date: Wed, 3 Mar 2004 23:36:19 -0500 (EST) From: Daniel Eischen <eischen@vigrid.com> To: Peter Grehan <grehan@freebsd.org> Cc: freebsd-threads@freebsd.org Subject: Re: User-space context switch and floating-point Message-ID: <Pine.GSO.4.10.10403032332380.22172-100000@pcnet5.pcnet.com> In-Reply-To: <40466A3F.5070904@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 4 Mar 2004, Peter Grehan wrote: > >> Any opinions ? I noticed the alpha/sparc64 routines don't save FP. > > > > You don't need to save floating point registers when saving the > > context from userland. > > But why is that any different from having to save non-volatile > integer registers ? For instance, on PPC, gp regs 14-31, and also > fp regs 14-31, need to be saved by the callee if used since they're > non-volatile across function calls. > > > Look at the i386 thr_getcontext(); it only needs to save the FP > > control word. > > Yes, but I thought the i386 FP calling convention was that all > FP registers were volatile across calls, so all were preserved > by the callee. Yes, but how do you generate code that does: double x, y; ... x = y * 1.5 * sqrt(2.25) - 3.15 + pthread_mutex_lock(&m) + 1.25; ... If on the other hand: x = y * 1.5 - sqrt(2.25); pthread_mutex_lock(&m); x = x + 2.0; requires FP registers to be saved, then so be it. I don't know anything about PPC... -- Dan Eischen
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10403032332380.22172-100000>