critical floating point incompatibility

Kostik Belousov kostikbel at gmail.com
Fri Dec 21 12:16:45 PST 2007


On Fri, Dec 21, 2007 at 10:11:24AM -0800, Bakul Shah wrote:
> Peter Jeremy <peterjeremy at 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?
> > 
> > I believe this is an oversight.  See the thread beginning
> > http://lists.freebsd.org/pipermail/freebsd-stable/2007-November/037947.html
> 
> >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.
> 
> 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.
> 
> 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.
> 
> Filing a PR would help ensure this doesn't get lost.
-------------- 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-hackers/attachments/20071221/a6a8c880/attachment.pgp


More information about the freebsd-hackers mailing list