From owner-freebsd-threads@FreeBSD.ORG Wed May 4 21:58:50 2005 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 BDE4E16A4CE; Wed, 4 May 2005 21:58:50 +0000 (GMT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id E598043D60; Wed, 4 May 2005 21:58:49 +0000 (GMT) (envelope-from marcolz@stack.nl) Received: from hammer.stack.nl (hammer.stack.nl [IPv6:2001:610:1108:5010::153]) by mailhost.stack.nl (Postfix) with ESMTP id 3D62F1F201; Wed, 4 May 2005 23:57:30 +0200 (CEST) Received: by hammer.stack.nl (Postfix, from userid 333) id 23C126393; Wed, 4 May 2005 23:57:30 +0200 (CEST) Date: Wed, 4 May 2005 23:57:30 +0200 From: Marc Olzheim To: Daniel Eischen Message-ID: <20050504215730.GA1629@stack.nl> References: <20050504202200.GD76171@stack.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="h31gzZEtNLTqOjlF" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD hammer.stack.nl 5.4-STABLE FreeBSD 5.4-STABLE X-URL: http://www.stack.nl/~marcolz/ User-Agent: Mutt/1.5.9i cc: Marc Olzheim cc: freebsd-threads@freebsd.org Subject: Re: Floating point exceptions with -pthread 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, 04 May 2005 21:58:50 -0000 --h31gzZEtNLTqOjlF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 04, 2005 at 05:25:04PM -0400, Daniel Eischen wrote: > floorf() seems to fiddle with the FP control word. The kernel > and libpthread use fxsave and fxrstor respectively. These > save and restore the control word, but something may not be > working correctly. Hmm, as does ceilf. But trunf() the only other doing this, does not get the sigFPE: fstcw, then: floorf() ceilf() truncf() or 0x0400 or 0x0800 or 0x0c00 and 0xf7ff and 0xfbff and fldcw the modified version. Then why is truncf() different... ? All abuse the 0x0c00 bits of the control word. Marc --h31gzZEtNLTqOjlF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (FreeBSD) iD8DBQFCeUVJezjnobFOgrERAvKvAKCJBnuJGTKQZMM8C1WiNNZn19/JkACeKp+T u9zLzNe4Jb2o20ZAnRagJdg= =JmWY -----END PGP SIGNATURE----- --h31gzZEtNLTqOjlF--