public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work146-vsize)] Add -mvector-size-32-vectorize.
@ 2023-11-21 20:33 Michael Meissner
0 siblings, 0 replies; 2+ messages in thread
From: Michael Meissner @ 2023-11-21 20:33 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:f0b0e812104de31be0c0c71b8b30e9bdfb3fac28
commit f0b0e812104de31be0c0c71b8b30e9bdfb3fac28
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Tue Nov 21 15:33:20 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..e7936bf81af 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)
+ {
+ if (mode == DFmode)
+ return V4DFmode;
+ else if (mode == SFmode)
+ return V8SFmode;
+ }
+
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] 2+ messages in thread
* [gcc(refs/users/meissner/heads/work146-vsize)] Add -mvector-size-32-vectorize.
@ 2023-11-21 22:25 Michael Meissner
0 siblings, 0 replies; 2+ messages in thread
From: Michael Meissner @ 2023-11-21 22:25 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:8c90ff2f397b1675532b367e6f2353781ec2da46
commit 8c90ff2f397b1675532b367e6f2353781ec2da46
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Tue Nov 21 17:24:54 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] 2+ messages in thread
end of thread, other threads:[~2023-11-21 22:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 20:33 [gcc(refs/users/meissner/heads/work146-vsize)] Add -mvector-size-32-vectorize Michael Meissner
2023-11-21 22:25 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).