Re: Inconsistent results casting double to int on x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Perry Smith writes:
 > 
 > On Mar 23, 2006, at 8:19 AM, Andrew Haley wrote:
 > 
 > > This is because of excess precision in the x87.
 > >
 > > This is http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323.
 > 
 > I don't use Intel so forgive my ignorance.  Is the call to
 > _FPU_SETCW mentioned in comment 60
 > (http://gcc.gnu.org/bugzilla/show_bug.cgi?  id=323#c60) going to
 > affect how the x87 operates per process or for the whole system?

It's per-process on GC/Linux.

 > Thats obviously an OS specific question but generally is that
 > register saved in the process context?  (It seems like it would
 > be.)
 > 
 > If it is, then how about adding the code in comment #60 to the
 > regular crt0.c code?

It's been suggested before, and rejected IIRC.  Apart from anything
else, it only corrects the problem for doubles.  Also, there are some
advantages to using higher intermediate precision in some cases.

 > If that avoids the problem.  Anyone that is really working with
 > floating point will be more likely to set this register up the way
 > they want it if they want it a specific way.

Quite.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux