From owner-freebsd-threads@FreeBSD.ORG Wed Mar 3 20:36:20 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA43016A4CE; Wed, 3 Mar 2004 20:36:20 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73A5943D2F; Wed, 3 Mar 2004 20:36:20 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i244aJbN023362; Wed, 3 Mar 2004 23:36:19 -0500 (EST) Date: Wed, 3 Mar 2004 23:36:19 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Peter Grehan In-Reply-To: <40466A3F.5070904@freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: User-space context switch and floating-point X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2004 04:36:20 -0000 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