Subject: Re: accuracy of "long double"
To: Matthias Drochner <>
From: Neil Booth <>
List: tech-toolchain
Date: 08/21/2007 21:04:19
Matthias Drochner wrote:-

> > d) Despite many claims to the contrary that you will read on the
> >    net, and on GCC lists, there is no double-rounding problem.
> >    All results are correctly rounded to 53-bits given the value
> >    they operated on
> I had read this as "gcc will emit code which makes sure that
> double results are correctly rounded even if the FPU is in
> extended precision mode".
> My code was just to show that this is not the case.

Yes, I was referring to the CPU semantics, not GCC's code emission.
Double-rounding problems with the CPU have been claimed by GCC
maintainers on the lists before, but it's simply not correct.

> So we can't have good "long double" support and correct
> "double" arithmetics at the same time. (at least as long
> as we have to deal with pre-SSE2 CPUs)

Right - really you have to pick one or the other.  NetBSD
chose differently to Linux.