On Tue, Oct 18, 2022 at 5:56 AM David Seifert <s...@gentoo.org> wrote: > > On Tue, 2022-10-18 at 10:14 +0200, Ulrich Mueller wrote: > > > > > > > On Tue, 18 Oct 2022, Mike Gilbert wrote: > > > > > Reference: https://gcc.gnu.org/wiki/x87note > > > > Which says: > > > > > ... the amount of worst-case error that could possibly happen using > > > the x87 (with any amount of intermediate rounding) is at worst the > > > same as true 64 or 32 bit arithmetic, and in practice is almost > > > always > > > better. > > > > and: > > > > > Note, however, that this greater repeatability comes at the cost of > > > lost precision (i.e. SSE always gets the same precision because it > > > always takes the equivalent of the x87's worst case: a forced round > > > down at each step). > > > > So, it comes with a price, and I wonder if we shouldn't leave that > > choice to the user, and go with the upstream GCC default? > > > > > -CFLAGS_x86="-m32" > > > +CFLAGS_x86="-m32 -mfpmath=sse" > > -mfpmath=sse is already the default on amd64.
I have amended the first paragraph to make this more clear: GCC uses x87 floating point instructions when building 32-bit x86 code by default. When building 64-bit code, SSE2 instructions are used instead.