public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work149-vsubreg)] Add -mvector-size-32-vectorize.
@ 2023-11-28 18:33 Michael Meissner
  0 siblings, 0 replies; only message in thread
From: Michael Meissner @ 2023-11-28 18:33 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9fcfcd6f81b74d7a524ab22e6555b347d8e2f1fb

commit 9fcfcd6f81b74d7a524ab22e6555b347d8e2f1fb
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Nov 28 13:31:50 2023 -0500

    Add -mvector-size-32-vectorize.
    
    2023-11-21  Michael Meissner  <meissner@linux.ibm.com>
    
    gcc/
    
            * config/rs6000/rs6000.cc (rs6000_option_override_internal): Add
            -mvector-size-32-vectorize.
            (rs6000_preferred_simd_mode): Likewise.
            (rs6000_opt_vars): Likewise.
            * config/rs6000/rs6000.opt (-mvector-size-32-vectorize): Likewise.

Diff:
---
 gcc/config/rs6000/rs6000.cc  | 15 +++++++++++++++
 gcc/config/rs6000/rs6000.opt |  4 ++++
 2 files changed, 19 insertions(+)

diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index aeac7c9fa42..3d99e4371e2 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -4494,6 +4494,10 @@ rs6000_option_override_internal (bool global_init_p)
       rs6000_isa_flags &= OPTION_MASK_STORE_VECTOR_PAIR;
     }
 
+  if (TARGET_VECTOR_SIZE_32_VECTORIZE && TARGET_MMA
+      && !OPTION_SET_P (TARGET_VECTOR_SIZE_32))
+      TARGET_VECTOR_SIZE_32 = 1;
+
   if (!TARGET_MMA && TARGET_VECTOR_SIZE_32)
     {
       if (OPTION_SET_P (TARGET_VECTOR_SIZE_32))
@@ -5248,6 +5252,14 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
 static machine_mode
 rs6000_preferred_simd_mode (scalar_mode mode)
 {
+  if (TARGET_MMA && TARGET_VECTOR_SIZE_32 && TARGET_VECTOR_SIZE_32_VECTORIZE)
+    {
+      opt_machine_mode vpmode = mode_for_vector (mode, 32 / GET_MODE_SIZE (mode));
+
+      if (vpmode.exists ())
+	return vpmode.require ();
+    }
+
   opt_machine_mode vmode = mode_for_vector (mode, 16 / GET_MODE_SIZE (mode));
 
   if (vmode.exists () && !VECTOR_MEM_NONE_P (vmode.require ()))
@@ -24798,6 +24810,9 @@ static struct rs6000_opt_var const rs6000_opt_vars[] =
   { "vector-size-32",
     offsetof (struct gcc_options, x_TARGET_VECTOR_SIZE_32),
     offsetof (struct cl_target_option, x_TARGET_VECTOR_SIZE_32), },
+  { "vector-size-32-vectorize",
+    offsetof (struct gcc_options, x_TARGET_VECTOR_SIZE_32_VECTORIZE),
+    offsetof (struct cl_target_option, x_TARGET_VECTOR_SIZE_32_VECTORIZE), },
 };
 
 /* Inner function to handle attribute((target("..."))) and #pragma GCC target
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 74f8481016b..90a930bc8d7 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -609,6 +609,10 @@ mvector-size-32
 Target Var(TARGET_VECTOR_SIZE_32) Init(0) Save
 Generate (do not generate) vector pair instructions for vector_size(32).
 
+mvector-size-32-vectorize
+Target Undocumented Var(TARGET_VECTOR_SIZE_32_VECTORIZE) Init(0) Save
+Use (do not use) vector_size(32) in vectorization.
+
 mrelative-jumptables
 Target Undocumented Var(rs6000_relative_jumptables) Init(1) Save

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-28 18:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-28 18:33 [gcc(refs/users/meissner/heads/work149-vsubreg)] Add -mvector-size-32-vectorize Michael Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).