commit:     37dff17dbf53946cffea53f5c0514f229f3be11d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 24 22:41:57 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 24 22:41:57 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=37dff17d

15.0.0: add 34_all_time64_ssemath.patch like for 14.2.0

Signed-off-by: Sam James <sam <AT> gentoo.org>

 15.0.0/gentoo/34_all_time64_ssemath.patch | 43 +++++++++++++++++++++++++++++++
 15.0.0/gentoo/README.history              |  1 +
 2 files changed, 44 insertions(+)

diff --git a/15.0.0/gentoo/34_all_time64_ssemath.patch 
b/15.0.0/gentoo/34_all_time64_ssemath.patch
new file mode 100644
index 0000000..3701b6b
--- /dev/null
+++ b/15.0.0/gentoo/34_all_time64_ssemath.patch
@@ -0,0 +1,43 @@
+From 33ba5944f2b887fe8bddd541790645b74f1f2655 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Sun, 24 Nov 2024 14:45:37 +0100
+Subject: [PATCH] Default to -mfpmath=sse on x86 with time64
+
+Our time64 stages already default to `-mfpmath=sse`, so let's have
+the time64 flag implicitly enable it as the default to make things more
+consistent.  Furthermore, this also improves compatibility with clang
+that always enables it whenever the target architectures supports SSE.
+
+Note that this works only if `-march=` with SSE support is specified.
+We could technically improve the consistency even further by raising
+the default `-march=`, but that seems a bit intrusive and probably
+unnecessary, given that the vast majority of Gentoo users and/or
+upstream projects will specify `-march=`.
+
+See also:
+https://public-inbox.gentoo.org/gentoo-dev/[email protected]/
+https://public-inbox.gentoo.org/gentoo-dev/[email protected]/
+---
+ gcc/config/i386/i386-options.cc | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc
+index 6c212a8ed..03801f382 100644
+--- a/gcc/config/i386/i386-options.cc
++++ b/gcc/config/i386/i386-options.cc
+@@ -2881,7 +2881,11 @@ ix86_option_override_internal (bool main_args_p,
+      Also -mfpmath=387 is overall a lot more compact (bout 4-5%) than SSE
+      codegen.  We may switch to 387 with -ffast-math for size optimized
+      functions. */
+-  else if (fast_math_flags_set_p (&global_options)
++#ifndef _GENTOO_TIME64_FORCE
++  #define _GENTOO_TIME64_FORCE 0
++#endif
++
++  else if ((fast_math_flags_set_p (&global_options) || _GENTOO_TIME64_FORCE)
+          && TARGET_SSE2_P (opts->x_ix86_isa_flags))
+     opts->x_ix86_fpmath = FPMATH_SSE;
+   else
+-- 
+2.47.0
+

diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 479b5cc..cf197b9 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,5 +1,6 @@
 ??
 
+       + 34_all_time64_ssemath.patch
        - 72_all_PR117628-libgcc-c23.patch
        - 73_all_PR117646-match-Fix-the-max-a-b-0-pattern-for-pointers.patch
 

Reply via email to