From owner-freebsd-threads@FreeBSD.ORG Wed Mar 3 00:14:29 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 5864816A4CE for ; Wed, 3 Mar 2004 00:14:29 -0800 (PST) Received: from liberty.onthenet.com.au (liberty.OntheNet.com.au [203.22.124.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id C321943D49 for ; Wed, 3 Mar 2004 00:14:28 -0800 (PST) (envelope-from grehan@freebsd.org) Received: from freebsd.org (CPE-30-165.dsl.onthenet.net [203.144.30.165]) i238ERZG085975 for ; Wed, 3 Mar 2004 18:14:27 +1000 (EST) (envelope-from grehan@freebsd.org) Message-ID: <40459478.9060702@freebsd.org> Date: Wed, 03 Mar 2004 18:16:56 +1000 From: Peter Grehan User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.3.1) Gecko/20030524 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: 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: Wed, 03 Mar 2004 08:14:29 -0000 Here's the comment I currently have in libpthread/.../powerpc/context.S: * XXX XXX * Floating-point is a big issue. Since there's no way to determine * if the caller has used FP, all volatile register need to be saved. * If FP hasn't been used, this results in a lazy FP exception in * the kernel and from that point on FP is always switched in/out * for the thread, which may be a big performance drag for the system. * An alternative is to use the the getcontext system call, which * will do the right thing for floating point but will save all * registers rather than the caller-saved subset, and has the overhead * of a syscall. * Maybe another option would be to give a light-weight way for a * thread to determine if FP is in used: perhaps a syscall that * returns this info immediately in the asm traphandler, or an * OSX-style read-only per-thread page with a flag to indicate FP state. Any opinions ? I noticed the alpha/sparc64 routines don't save FP. later, Peter.