Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: Mike Gilbert <floppym@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] profiles/arch/amd64: add "-mfpmath=sse" to CFLAGS_x86
Date: Tue, 18 Oct 2022 08:14:59
Message-Id: uh701pmyx@gentoo.org
In Reply to: [gentoo-dev] [PATCH] profiles/arch/amd64: add "-mfpmath=sse" to CFLAGS_x86 by Mike Gilbert
1 >>>>> On Tue, 18 Oct 2022, Mike Gilbert wrote:
2
3 > Reference: https://gcc.gnu.org/wiki/x87note
4
5 Which says:
6
7 | ... the amount of worst-case error that could possibly happen using
8 | the x87 (with any amount of intermediate rounding) is at worst the
9 | same as true 64 or 32 bit arithmetic, and in practice is almost always
10 | better.
11
12 and:
13
14 | Note, however, that this greater repeatability comes at the cost of
15 | lost precision (i.e. SSE always gets the same precision because it
16 | always takes the equivalent of the x87's worst case: a forced round
17 | down at each step).
18
19 So, it comes with a price, and I wonder if we shouldn't leave that
20 choice to the user, and go with the upstream GCC default?
21
22 > -CFLAGS_x86="-m32"
23 > +CFLAGS_x86="-m32 -mfpmath=sse"
24
25 Also, why add the flag only to CFLAGS_x86 but not to CFLAGS_amd64?
26 They should have the same single and double precision arithmetic?
27
28 Ulrich

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies