Floating point exceptions with -pthread
Marc Olzheim
marcolz at stack.nl
Wed May 4 14:58:50 PDT 2005
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-threads/attachments/20050504/ea33d7ba/attachment.bin
More information about the freebsd-threads
mailing list