Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 May 2005 23:57:30 +0200
From:      Marc Olzheim <marcolz@stack.nl>
To:        Daniel Eischen <deischen@freebsd.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: Floating point exceptions with -pthread
Message-ID:  <20050504215730.GA1629@stack.nl>
In-Reply-To: <Pine.GSO.4.43.0505041631550.498-100000@sea.ntplx.net>
References:  <20050504202200.GD76171@stack.nl> <Pine.GSO.4.43.0505041631550.498-100000@sea.ntplx.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050504215730.GA1629>