public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] x86 arch testing: please use -mfpmath=sse
@ 2024-02-13 19:30 Michał Górny
  2024-02-13 19:37 ` [gentoo-dev] Re: [gentoo-dev-announce] " Sam James
  0 siblings, 1 reply; 2+ messages in thread
From: Michał Górny @ 2024-02-13 19:30 UTC (permalink / raw)
  To: gentoo-dev-announce; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1634 bytes --]

Hello,

TL;DR: when arch testing for x86, please use `-mfpmath=sse` (this may
require raising `-march=` to `pentium4` or newer, or adding `-msse2`.


The x86 architecture historically supports two floating-precision
arithmetic modes: using the 387 coprocessor, and using the SSE
instruction set.  The compilers default to using the former when
compiling for 32-bit x86, and the latter for amd64.

The problem with 387 arithmetic is that it uses nonstandard 80-bit
registers (vs 64-bit doubles).  While technically this means that it
achieves better precision, it often means that the same computations
yield different rounding results.  As a result, test built against amd64
fail with 387-based arithmetic.

While technically these tests are broken in the first place for doing
exact matching on floating-point arithmetic results, getting everything
fixed is a major issue.  These problems are quite unlikely to affect
real use cases.  On top of that, many upstreams don't care about 32-bit
systems much, and bothering them with avoidable test failures reduces
our chances of having real problems solved.

Therefore, I would like to ask arch testers not to test with 387
floating-point arithmetic anymore.  We have already switched amd64
multilib to use `-mfpmath=sse` for 32-bit multilib, and we are planning
to provide x86 profiles with SSE2 baseline as well.

Note that in order for `-mfpmath=sse` to be fully effectively, the code
must be compiled with SSE2 support.  This could be achieved by using `-
march=pentium4` or higher, or adding `-msse2`.

TIA.

-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-dev] Re: [gentoo-dev-announce] x86 arch testing: please use -mfpmath=sse
  2024-02-13 19:30 [gentoo-dev] x86 arch testing: please use -mfpmath=sse Michał Górny
@ 2024-02-13 19:37 ` Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-02-13 19:37 UTC (permalink / raw)
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2420 bytes --]


Michał Górny <mgorny@gentoo.org> writes:

> [[PGP Signed Part:Undecided]]
> Hello,
>
> TL;DR: when arch testing for x86, please use `-mfpmath=sse` (this may
> require raising `-march=` to `pentium4` or newer, or adding `-msse2`.
>
>
> The x86 architecture historically supports two floating-precision
> arithmetic modes: using the 387 coprocessor, and using the SSE
> instruction set.  The compilers default to using the former when
> compiling for 32-bit x86, and the latter for amd64.
>
> The problem with 387 arithmetic is that it uses nonstandard 80-bit
> registers (vs 64-bit doubles).  While technically this means that it
> achieves better precision, it often means that the same computations
> yield different rounding results.  As a result, test built against amd64
> fail with 387-based arithmetic.
>
> While technically these tests are broken in the first place for doing
> exact matching on floating-point arithmetic results, getting everything
> fixed is a major issue.  These problems are quite unlikely to affect
> real use cases.  On top of that, many upstreams don't care about 32-bit
> systems much, and bothering them with avoidable test failures reduces
> our chances of having real problems solved.

Yes. To be clear, this is NOT about us not caring about bugs without
SSE or SSE2, but rather that right now, the spurious FP comparison
failures are blocking stabilisation on x86 and are causing people to
not want to look at x86 at all and keep calling for it to be destabled.

I'm very happy to look into interesting problems, I just don't think
it's a good use of anybody's time to be reporting these FP issues when
it's taking time away from real problems on these platforms.

We're better off with this by avoiding useless failures. We also did
this for multilib x86 a while ago -- see
ed189588a071f88186a3a9de25abfbd7582b9c69.

>
> Therefore, I would like to ask arch testers not to test with 387
> floating-point arithmetic anymore.  We have already switched amd64
> multilib to use `-mfpmath=sse` for 32-bit multilib, and we are planning
> to provide x86 profiles with SSE2 baseline as well.
>
> Note that in order for `-mfpmath=sse` to be fully effectively, the code
> must be compiled with SSE2 support.  This could be achieved by using `-
> march=pentium4` or higher, or adding `-msse2`.
>
> TIA.

+1

thanks for doing this,
sam

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 377 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-13 19:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-13 19:30 [gentoo-dev] x86 arch testing: please use -mfpmath=sse Michał Górny
2024-02-13 19:37 ` [gentoo-dev] Re: [gentoo-dev-announce] " Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox