commit:     ebed28dd5e08e8aaee44f08c27c367019568fb15
Author:     matoro <matoro_gentoo <AT> matoro <DOT> tk>
AuthorDate: Tue Feb 13 21:08:48 2024 +0000
Commit:     Ben Kohler <bkohler <AT> gentoo <DOT> org>
CommitDate: Wed Mar 20 15:47:27 2024 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ebed28dd

arch: add new x86.i686-ssemath subprofile

As mentioned on the mailing list, x86 arch testing needs to be performed
using SSE registers for floating-point math instead of the 387 FPU.
This is a subprofile which provides a generic i686 target with SSE2 and
`-mfpmath=sse`.  The use is not just limited to arch testing however as
this is a useful platform for getting maximum performance on late-gen
chips.  Per gcc:

> The resulting code should be considerably faster in the majority of
cases and avoid the numerical instability problems of 387 code, but may
break some existing code that expects temporaries to be 80 bits.

Of course modern code has quite the opposite problem, where it does not
expect floating-point variables to be 80 bits.

Signed-off-by: Matoro Mahri <matoro_gentoo <AT> matoro.tk>
Closes: https://github.com/gentoo/catalyst/pull/12
Signed-off-by: Ben Kohler <bkohler <AT> gentoo.org>

 arch/x86.toml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86.toml b/arch/x86.toml
index 5451d410..24d4c547 100644
--- a/arch/x86.toml
+++ b/arch/x86.toml
@@ -50,3 +50,6 @@ CPU_FLAGS_X86 = [ "mmx", "mmxext", "3dnow", "3dnowext",]
 COMMON_FLAGS = "-O2 -march=athlon-xp -pipe"
 CPU_FLAGS_X86 = [ "mmx", "mmxext", "3dnow", "3dnowext", "sse",]
 
+[x86.i686-ssemath]
+COMMON_FLAGS = "-O2 -march=i686 -msse2 -mfpmath=sse -pipe"
+CPU_FLAGS_X86 = [ "mmx", "mmxext", "sse", "sse2",]

Reply via email to