From owner-freebsd-bugs@FreeBSD.ORG Wed May 4 23:07:59 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69DDB16A4CE for ; Wed, 4 May 2005 23:07:59 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CBCB43D62 for ; Wed, 4 May 2005 23:07:59 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j44N0GQm072159 for ; Wed, 4 May 2005 23:00:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j44N0GZX072158; Wed, 4 May 2005 23:00:16 GMT (envelope-from gnats) Date: Wed, 4 May 2005 23:00:16 GMT Message-Id: <200505042300.j44N0GZX072158@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Marc Olzheim Subject: Re: kern/80617: floating point registers seem not to be saved after thread preemption. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Marc Olzheim List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2005 23:07:59 -0000 The following reply was made to PR kern/80617; it has been noted by GNATS. From: Marc Olzheim To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/80617: floating point registers seem not to be saved after thread preemption. Date: Thu, 5 May 2005 00:58:25 +0200 The following probably fixes it (thanks to the hint das@ provided). For FreeBSD 5.4, just ignore the truncf() part, since that file hasn't been MFC'd yet. --- lib/msun/i387/s_ceilf.S Thu Jan 13 19:58:25 2005 +++ lib/msun/i387/s_ceilf.S Thu May 5 00:54:18 2005 @@ -13,17 +13,17 @@ movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw -4(%ebp) /* store fpu control word */ + movw -4(%ebp),%dx orw $0x0800,%dx /* round towards +oo */ andw $0xfbff,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,-8(%ebp) + fldcw -8(%ebp) /* load modfied control word */ flds 8(%ebp); /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw -4(%ebp) /* restore original control word */ leave ret --- lib/msun/i387/s_floorf.S Thu Jan 13 19:58:25 2005 +++ lib/msun/i387/s_floorf.S Thu May 5 00:54:29 2005 @@ -13,17 +13,17 @@ movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw -4(%ebp) /* store fpu control word */ + movw -4(%ebp),%dx orw $0x0400,%dx /* round towards -oo */ andw $0xf7ff,%dx - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,-8(%ebp) + fldcw -8(%ebp) /* load modfied control word */ flds 8(%ebp); /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw -4(%ebp) /* restore original control word */ leave ret --- lib/msun/i387/s_truncf.S Sat Apr 16 23:12:55 2005 +++ lib/msun/i387/s_truncf.S Thu May 5 00:54:35 2005 @@ -11,16 +11,16 @@ movl %esp,%ebp subl $8,%esp - fstcw -12(%ebp) /* store fpu control word */ - movw -12(%ebp),%dx + fstcw -4(%ebp) /* store fpu control word */ + movw -4(%ebp),%dx orw $0x0c00,%dx /* round towards -oo */ - movw %dx,-16(%ebp) - fldcw -16(%ebp) /* load modfied control word */ + movw %dx,-8(%ebp) + fldcw -8(%ebp) /* load modfied control word */ flds 8(%ebp) /* round */ frndint - fldcw -12(%ebp) /* restore original control word */ + fldcw -4(%ebp) /* restore original control word */ leave ret