https://gcc.gnu.org/g:e49ac94f0cfacbaa722ca38afe2d487704648733

commit e49ac94f0cfacbaa722ca38afe2d487704648733
Author: Michael Meissner <[email protected]>
Date:   Tue Nov 17 19:00:25 2026 -0500

    Add configuration option --with-powerpc-vector-pair-fp.
    
    This patch adds a configuration option --with-powerpc-vector-pair-fp that
    enables -mvector-pair-fp by default.
    
    2026-11-17  Michael Meissner  <[email protected]>
    
            * config.gcc (powerpc-*-*): Add support for a new configuration 
option:
            --with-powerpc-vector-pair-fp.
            * config/rs6000/rs6000.cc (rs6000_debug_reg_global): Print if
            -mvector-pair-fp is configured to be on by default.
            (rs6000_option_override_internal): Add support for the configuration
            option: --with-powerpc-vector-pair-fp.

Diff:
---
 gcc/config.gcc              |  9 +++++++++
 gcc/config/rs6000/rs6000.cc | 23 ++++++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index d5fdbd0b8646..8ef4ecd389ac 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -5873,6 +5873,15 @@ case "${target}" in
                    fi
                fi
 
+               # Test if we should enable -mvector-pair-fp by default
+               # on power9 and power10 systems.
+               if test x$with_powerpc_vector_pair_fp = xyes; then
+                   tm_defines="${tm_defines} POWERPC_VECTOR_PAIR_FP_DEFAULT=1"
+
+               elif test x$with_powerpc_vector_pair_fp = xno; then
+                   tm_defines="${tm_defines} POWERPC_VECTOR_PAIR_FP_DEFAULT=0"
+               fi
+
                # Set up the default long double format if the user changed it.
                if test x$with_long_double_format = xieee; then
                    tm_defines="${tm_defines} TARGET_IEEEQUAD_DEFAULT=1"
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index e95bb7ad2df6..f2d5404df1c6 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -2759,6 +2759,10 @@ rs6000_debug_reg_global (void)
   fprintf (stderr, DEBUG_FMT_D, "VECTOR_PAIR_DOUBLE",
           TARGET_VECTOR_PAIR_DOUBLE);
 
+#if POWERPC_VECTOR_PAIR_FP_DEFAULT
+  fprintf (stderr, DEBUG_FMT_S, "vector pair fp configured", "yes");
+#endif
+
   /* Print information about the various floating point formats used.  */
   if (TARGET_HARD_FLOAT)
     {
@@ -4167,10 +4171,27 @@ rs6000_option_override_internal (bool global_init_p)
     rs6000_isa_flags &= ~((OPTION_MASK_P8_VECTOR | OPTION_MASK_CRYPTO)
                         & ~rs6000_isa_flags_explicit);
 
-  /* See if -mvector-pair-fp can be used.  On power10 systems, we use the
+  /* Support the --with-powerpc-vector-pair-fp configuration option.
+
+     See if -mvector-pair-fp can be used.  On power10 systems, we use the
      load/store vector pair instructions.  On power9 systems, we limit the
      addresses to offsettable instructions so we can do 2 loads or stores.
      Don't allow the option on power8 or before.  */
+
+#if defined(POWERPC_VECTOR_PAIR_FP_DEFAULT)
+  if ((rs6000_isa_flags_explicit & OPTION_MASK_VECTOR_PAIR_FP) == 0
+      && TARGET_P9_VECTOR
+      && !BYTES_BIG_ENDIAN
+      && TARGET_POWERPC64)
+    {
+#if POWERPC_VECTOR_PAIR_FP_DEFAULT
+      rs6000_isa_flags |=OPTION_MASK_VECTOR_PAIR_FP;
+#else
+      rs6000_isa_flags &= ~OPTION_MASK_VECTOR_PAIR_FP;
+#endif
+    }
+#endif
+      
   if (TARGET_VECTOR_PAIR_FP
       && (!TARGET_P9_VECTOR || BYTES_BIG_ENDIAN || !TARGET_POWERPC64))
     {

Reply via email to