commit:     6daca622f1773923ccb770f7e8c4b24d53a7920f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue May 27 14:15:01 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue May 27 14:15:01 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6daca622

13.3.0: cut patchset 5, time64 patches

Backport time64 bits to 13 on request of dilfridge because 14/15 are broken
on m68k, and this will make it easier to test time64 + new int alignment.

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

 13.3.0/gentoo/33_all_time64.patch         | 39 ++++++++++++++++++++++++++++
 13.3.0/gentoo/34_all_time64_ssemath.patch | 43 +++++++++++++++++++++++++++++++
 13.3.0/gentoo/README.history              |  5 ++++
 3 files changed, 87 insertions(+)

diff --git a/13.3.0/gentoo/33_all_time64.patch 
b/13.3.0/gentoo/33_all_time64.patch
new file mode 100644
index 0000000..ac972b9
--- /dev/null
+++ b/13.3.0/gentoo/33_all_time64.patch
@@ -0,0 +1,39 @@
+From b2ee3846dfcea638e0fbf2d550234f1c7594fcdb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Fri, 1 Nov 2024 07:48:37 +0100
+Subject: [PATCH] Support forcing _TIME_BITS=64 for time64 profiles
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Support forcing _TIME_BITS=64 and _FILE_OFFSET_BITS=64
+via -D_GENTOO_TIME64_FORCE=1, for time64 profiles.
+
+Signed-off-by: Michał Górny <[email protected]>
+---
+ gcc/c-family/c-cppbuiltin.cc | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
+index 8bbfe84b2..962cbd414 100644
+--- a/gcc/c-family/c-cppbuiltin.cc
++++ b/gcc/c-family/c-cppbuiltin.cc
+@@ -1593,6 +1593,15 @@ c_cpp_builtins (cpp_reader *pfile)
+     builtin_define_with_int_value ("_FORTIFY_SOURCE", 
GENTOO_FORTIFY_SOURCE_LEVEL);
+ #endif
+ 
++#ifndef _GENTOO_TIME64_FORCE
++  #define _GENTOO_TIME64_FORCE 0
++#endif
++
++  if (_GENTOO_TIME64_FORCE) {
++    cpp_define (pfile, "_FILE_OFFSET_BITS=64");
++    cpp_define (pfile, "_TIME_BITS=64");
++  }
++
+   /* Misc.  */
+   if (flag_gnu89_inline)
+     cpp_define (pfile, "__GNUC_GNU_INLINE__");
+-- 
+2.47.0
+

diff --git a/13.3.0/gentoo/34_all_time64_ssemath.patch 
b/13.3.0/gentoo/34_all_time64_ssemath.patch
new file mode 100644
index 0000000..3701b6b
--- /dev/null
+++ b/13.3.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/13.3.0/gentoo/README.history b/13.3.0/gentoo/README.history
index d5fadb0..bfbf4d7 100644
--- a/13.3.0/gentoo/README.history
+++ b/13.3.0/gentoo/README.history
@@ -1,3 +1,8 @@
+5      27 May 2025
+
+       + 33_all_time64.patch
+       + 34_all_time64_ssemath.patcho
+
 4      25 April 2025
 
        U 81_all_match.pd-Use-splits-in-makefile-and-make-configurabl.patch

Reply via email to