Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2007 10:11:24 -0800
From:      Bakul Shah <bakul@bitblocks.com>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        freebsd-hackers@freebsd.org, Carl Shapiro <carl.shapiro@gmail.com>
Subject:   Re: critical floating point incompatibility 
Message-ID:  <20071221181125.0B6F25B42@mail.bitblocks.com>
In-Reply-To: Your message of "Thu, 20 Dec 2007 20:39:50 %2B1100." <20071220093950.GA79196@server.vk2pj.dyndns.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
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?
> 
> 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.

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.



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