Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2007 22:16:33 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Bakul Shah <bakul@bitblocks.com>
Cc:        Carl Shapiro <carl.shapiro@gmail.com>, freebsd-hackers@freebsd.org
Subject:   Re: critical floating point incompatibility
Message-ID:  <20071221201633.GM57756@deviant.kiev.zoral.com.ua>
In-Reply-To: <20071221181125.0B6F25B42@mail.bitblocks.com>
References:  <20071220093950.GA79196@server.vk2pj.dyndns.org> <20071221181125.0B6F25B42@mail.bitblocks.com>

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

--00sTfE/IIAT5d2r5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Dec 21, 2007 at 10:11:24AM -0800, Bakul Shah wrote:
> Peter Jeremy <peterjeremy@optushome.com.au> wrote:
> > On Wed, Dec 19, 2007 at 09:40:34PM -0800, Carl Shapiro wrote:
> > >The default setting of the x87 floating point control word on the i386
> > >port is 0x127F.  Among other things, this value sets the precision
> > >control to double precision.  The default setting of the x87 floating
> > >point control word on the AMD64 is 0x37F.
> > ...
> > >It seems clear that the right thing to do is to set the floating point
> > >environment to the i386 default for i386 binaries.  Is the current
> > >behavior intended?
> >=20
> > I believe this is an oversight.  See the thread beginning
> > http://lists.freebsd.org/pipermail/freebsd-stable/2007-November/037947.=
html
>=20
> >From reading Bruce's last message in that thread, seems to me
> may be default for 64bit binaries should be the same as on
> i386. Anyone wanting different behavior can always call
> fpsetprec() etc.
>=20
> I think the fix is to change __INITIAL_FPUCW__ in
> /sys/amd64/include/fpu.h to 0x127F like on i386.
I think this shall be done for 32-bit processes only, or we get into
another ABI breaking nightmare.
>=20
> Also, while at it, comments above this constant in this file
> and above __INITIAL_NPXCW__ in /sys/i386/include/npx.h needs
> to reflect what was chosen and why.
>=20
> Filing a PR would help ensure this doesn't get lost.

--00sTfE/IIAT5d2r5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFHbB8gC3+MBN1Mb4gRAvfzAJ4oE92p/C6v34EvgKibtc/rir2LVwCg1ZAX
WWaOmJWge/hZDAJ2O5qzEeM=
=f5Sx
-----END PGP SIGNATURE-----

--00sTfE/IIAT5d2r5--



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