Inconsistent results casting double to int on x86

dups41@gmail.com dups41@gmail.com
Thu Mar 23 21:57:00 GMT 2006


On 3/23/06, Perry Smith <pedz@easesoftware.net> wrote:
>
> 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?  Thats obviously an OS specific question but
> generally is that register saved in the process context?  (It seems
> like it would be.)

Thanks for the responses everyone. The call to  _FPU_SETCW mentioned
above reducing x87 precision to 64-bit takes care of (or dodges) the
specific issue I described in the original post.

Thanks,

Andrew



More information about the Gcc-help mailing list