public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work043)] Add -mno-xxspltiw and -mno-xxspltidp switches.
@ 2021-03-31 19:41 Michael Meissner
0 siblings, 0 replies; 2+ messages in thread
From: Michael Meissner @ 2021-03-31 19:41 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:3dc81508dff8a25bbdcd4a15e00634e88692a3fb
commit 3dc81508dff8a25bbdcd4a15e00634e88692a3fb
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Wed Mar 31 15:41:21 2021 -0400
Add -mno-xxspltiw and -mno-xxspltidp switches.
This patch adds some temporary debug switches to control whether XXSPLTIW
or XXSPLTIDP are automatically generated for power10.
gcc/
2021-03-31 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/altivec.md (xxspltiw_v8hi): Add support for
-mno-xxspltiw.
(xxspltiw_v4si): Add support for -mno-xxspltiw.
(xxspltiw_v4sf): Add support for -mno-xxspltiw.
* config/rs6000/predicates.md (xxspltidp_operand): Add support for
-mno-xxspltidp.
* config/rs6000/rs6000-cpus.def (ISA_3_1_MASKS_SERVER): Add
support for -mno-xxspltiw and -mno-xxspltidp.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Add
support for -mno-xxspltiw and -mno-xxspltidp.
(xxspltiw_constant_p): Add support for -mno-xxspltiw.
(rs6000_expand_vector_init): Add support for -mno-xxspltiw and
-mno-xxspltidp.
(rs6000_opt_masks): Add support for -mno-xxspltiw and
-mno-xxspltidp.
* config/rs6000/rs6000.md (mov{sf,df} splitter for XXSPLTIDP): Add
support for -mno-xxspltidp.
(xxspltidp<mode>): Add support for -mno-xxspltidp.
* config/rs6000/rs6000.opt (-mxxspltiw): Add support for
-mno-xxspltiw.
(-mxxspltiwdp): Add support for -mno-xxspltidp.
Diff:
---
gcc/config/rs6000/altivec.md | 6 +++---
gcc/config/rs6000/predicates.md | 2 +-
gcc/config/rs6000/rs6000-cpus.def | 4 +++-
gcc/config/rs6000/rs6000.c | 19 ++++++++++++++-----
gcc/config/rs6000/rs6000.md | 4 ++--
gcc/config/rs6000/rs6000.opt | 8 ++++++++
6 files changed, 31 insertions(+), 12 deletions(-)
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index b108b7a688a..129578a9e89 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -822,7 +822,7 @@
[(set (match_operand:V8HI 0 "vsx_register_operand" "=wa,wa,v,wa")
(vec_duplicate:V8HI
(match_operand 1 "short_cint_operand" "O,wM,wB,n")))]
- "TARGET_POWER10"
+ "TARGET_XXSPLTIW"
{
int value = INTVAL (operands[1]);
@@ -848,7 +848,7 @@
[(set (match_operand:V4SI 0 "vsx_register_operand" "=wa,wa,v,wa")
(vec_duplicate:V4SI
(match_operand:SI 1 "s32bit_cint_operand" "O,wM,wB,n")))]
- "TARGET_POWER10"
+ "TARGET_XXSPLTIW"
"@
xxspltib %x0,0
xxspltib %x0,255
@@ -862,7 +862,7 @@
[(set (match_operand:V4SF 0 "register_operand" "=wa,wa")
(vec_duplicate:V4SF
(match_operand:SF 1 "const_double_operand" "j,F")))]
- "TARGET_POWER10"
+ "TARGET_XXSPLTIW"
{
if (operands[1] == CONST0_RTX (SFmode))
return "xxspltib %x0,0";
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index b5b17a8b7c6..fe97d5c1d0c 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -576,7 +576,7 @@
long value;
rtx element;
- if (!TARGET_POWER10 || !TARGET_VSX)
+ if (!TARGET_XXSPLTIDP)
return 0;
if (mode == V2DFmode)
diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index cbbb42c1b3a..559aee29e89 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -85,7 +85,9 @@
| OTHER_POWER10_MASKS \
| OPTION_MASK_P10_FUSION \
| OPTION_MASK_P10_FUSION_LD_CMPI \
- | OPTION_MASK_P10_FUSION_2LOGICAL)
+ | OPTION_MASK_P10_FUSION_2LOGICAL \
+ | OPTION_MASK_XXSPLTIW \
+ | OPTION_MASK_XXSPLTIDP)
/* Flags that need to be turned off if -mno-power9-vector. */
#define OTHER_P9_VECTOR_MASKS (OPTION_MASK_FLOAT128_HW \
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index a076c4e67dc..5265b9a336f 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4507,8 +4507,15 @@ rs6000_option_override_internal (bool global_init_p)
(rs6000_isa_flags_explicit & OPTION_MASK_P10_FUSION_LD_CMPI) == 0)
rs6000_isa_flags |= OPTION_MASK_P10_FUSION_LD_CMPI;
- if (TARGET_POWER10 && (rs6000_isa_flags_explicit & OPTION_MASK_P10_FUSION_2LOGICAL) == 0)
- rs6000_isa_flags |= OPTION_MASK_P10_FUSION_2LOGICAL;
+ if (TARGET_POWER10 && (rs6000_isa_flags_explicit & OPTION_MASK_XXSPLTIW) == 0)
+ rs6000_isa_flags |= OPTION_MASK_XXSPLTIW;
+
+ if (TARGET_POWER10 && (rs6000_isa_flags_explicit & OPTION_MASK_XXSPLTIDP) == 0)
+ rs6000_isa_flags |= OPTION_MASK_XXSPLTIDP;
+
+ if (TARGET_POWER10 &&
+ (rs6000_isa_flags_explicit & OPTION_MASK_P10_FUSION_LD_CMPI) == 0)
+ rs6000_isa_flags |= OPTION_MASK_P10_FUSION_LD_CMPI;
/* Turn off vector pair/mma options on non-power10 systems. */
else if (!TARGET_POWER10 && TARGET_MMA)
@@ -6399,7 +6406,7 @@ xxspltiw_constant_p (rtx op, machine_mode mode, rtx *constant_ptr)
{
*constant_ptr = NULL_RTX;
- if (!TARGET_POWER10)
+ if (!TARGET_XXSPLTIW)
return false;
if (mode == VOIDmode)
@@ -6733,7 +6740,7 @@ rs6000_expand_vector_init (rtx target, rtx vals)
if (n_var == 0)
{
/* Generate XXSPLTIW if we can. */
- if (TARGET_POWER10 && all_same
+ if (TARGET_XXSPLTIW && all_same
&& (mode == V4SImode || mode == V4SFmode || mode == V8HImode))
{
rtx dup = gen_rtx_VEC_DUPLICATE (mode, XVECEXP (vals, 0, 0));
@@ -6742,7 +6749,7 @@ rs6000_expand_vector_init (rtx target, rtx vals)
}
/* Generate XXSPLTIDP if we can. */
- if (TARGET_POWER10 && all_same && mode == V2DFmode
+ if (TARGET_XXSPLTIDP && all_same && mode == V2DFmode
&& xxspltidp_operand (XVECEXP (vals, 0, 0), DFmode))
{
rtx dup = gen_rtx_VEC_DUPLICATE (mode, XVECEXP (vals, 0, 0));
@@ -24090,6 +24097,8 @@ static struct rs6000_opt_mask const rs6000_opt_masks[] =
{ "string", 0, false, true },
{ "update", OPTION_MASK_NO_UPDATE, true , true },
{ "vsx", OPTION_MASK_VSX, false, true },
+ { "xxspltiw", OPTION_MASK_XXSPLTIW, false, true },
+ { "xxspltidp", OPTION_MASK_XXSPLTIDP, false, true },
#ifdef OPTION_MASK_64BIT
#if TARGET_AIX_OS
{ "aix64", OPTION_MASK_64BIT, false, false },
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 960d1913d9b..109ef05ad65 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -7536,7 +7536,7 @@
(define_split
[(set (match_operand:SFDF 0 "vsx_register_operand")
(match_operand:SFDF 1 "xxspltidp_operand"))]
- "TARGET_POWER10 && TARGET_VSX && operands[1] != CONST0_RTX (<MODE>mode)"
+ "TARGET_XXSPLTIDP && operands[1] != CONST0_RTX (<MODE>mode)"
[(set (match_dup 0)
(unspec:SFDF [(match_dup 2)] UNSPEC_XXSPLTID))]
{
@@ -7550,7 +7550,7 @@
[(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
(unspec:SFDF [(match_operand 1 "const_int_operand" "n")]
UNSPEC_XXSPLTID))]
- "TARGET_POWER10 && TARGET_VSX"
+ "TARGET_XXSPLTIDP"
"xxspltidp %x0,%1"
[(set_attr "type" "vecperm")
(set_attr "prefixed" "yes")
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 1fb2c35c1b3..2638dc45937 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -626,3 +626,11 @@ Generate (do not generate) MMA instructions.
mrelative-jumptables
Target Undocumented Var(rs6000_relative_jumptables) Init(1) Save
+
+mxxspltiw
+Target Undocumented Mask(XXSPLTIW) Var(rs6000_isa_flags)
+Generate (do not generate) XXSPLTIW instructions
+
+mxxspltidp
+Target Undocumented Mask(XXSPLTIDP) Var(rs6000_isa_flags)
+Generate (do not generate) XXSPLTIDP instructions
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gcc(refs/users/meissner/heads/work043)] Add -mno-xxspltiw and -mno-xxspltidp switches.
@ 2021-03-31 20:36 Michael Meissner
0 siblings, 0 replies; 2+ messages in thread
From: Michael Meissner @ 2021-03-31 20:36 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:7ca08be35a62c1e021433b6ca53f41ac46e5e268
commit 7ca08be35a62c1e021433b6ca53f41ac46e5e268
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Wed Mar 31 16:36:14 2021 -0400
Add -mno-xxspltiw and -mno-xxspltidp switches.
This patch adds some temporary debug switches to control whether XXSPLTIW
or XXSPLTIDP are automatically generated for power10.
gcc/
2021-03-31 Michael Meissner <meissner@linux.ibm.com>
* config/rs6000/altivec.md (xxspltiw_v8hi): Add support for
-mno-xxspltiw.
(xxspltiw_v4si): Add support for -mno-xxspltiw.
(xxspltiw_v4sf): Add support for -mno-xxspltiw.
* config/rs6000/predicates.md (xxspltidp_operand): Add support for
-mno-xxspltidp.
* config/rs6000/rs6000-cpus.def (ISA_3_1_MASKS_SERVER): Add
support for -mno-xxspltiw and -mno-xxspltidp.
* config/rs6000/rs6000.c (rs6000_option_override_internal): Add
support for -mno-xxspltiw and -mno-xxspltidp.
(xxspltiw_constant_p): Add support for -mno-xxspltiw.
(rs6000_expand_vector_init): Add support for -mno-xxspltiw and
-mno-xxspltidp.
(rs6000_opt_masks): Add support for -mno-xxspltiw and
-mno-xxspltidp.
* config/rs6000/rs6000.md (mov{sf,df} splitter for XXSPLTIDP): Add
support for -mno-xxspltidp.
(xxspltidp<mode>): Add support for -mno-xxspltidp.
* config/rs6000/rs6000.opt (-mxxspltiw): Add support for
-mno-xxspltiw.
(-mxxspltiwdp): Add support for -mno-xxspltidp.
Diff:
---
gcc/config/rs6000/altivec.md | 6 +++---
gcc/config/rs6000/predicates.md | 2 +-
gcc/config/rs6000/rs6000-cpus.def | 4 +++-
gcc/config/rs6000/rs6000.c | 37 ++++++++++++++++++++++++++++++++-----
gcc/config/rs6000/rs6000.md | 4 ++--
gcc/config/rs6000/rs6000.opt | 8 ++++++++
6 files changed, 49 insertions(+), 12 deletions(-)
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index b108b7a688a..129578a9e89 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -822,7 +822,7 @@
[(set (match_operand:V8HI 0 "vsx_register_operand" "=wa,wa,v,wa")
(vec_duplicate:V8HI
(match_operand 1 "short_cint_operand" "O,wM,wB,n")))]
- "TARGET_POWER10"
+ "TARGET_XXSPLTIW"
{
int value = INTVAL (operands[1]);
@@ -848,7 +848,7 @@
[(set (match_operand:V4SI 0 "vsx_register_operand" "=wa,wa,v,wa")
(vec_duplicate:V4SI
(match_operand:SI 1 "s32bit_cint_operand" "O,wM,wB,n")))]
- "TARGET_POWER10"
+ "TARGET_XXSPLTIW"
"@
xxspltib %x0,0
xxspltib %x0,255
@@ -862,7 +862,7 @@
[(set (match_operand:V4SF 0 "register_operand" "=wa,wa")
(vec_duplicate:V4SF
(match_operand:SF 1 "const_double_operand" "j,F")))]
- "TARGET_POWER10"
+ "TARGET_XXSPLTIW"
{
if (operands[1] == CONST0_RTX (SFmode))
return "xxspltib %x0,0";
diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md
index b5b17a8b7c6..fe97d5c1d0c 100644
--- a/gcc/config/rs6000/predicates.md
+++ b/gcc/config/rs6000/predicates.md
@@ -576,7 +576,7 @@
long value;
rtx element;
- if (!TARGET_POWER10 || !TARGET_VSX)
+ if (!TARGET_XXSPLTIDP)
return 0;
if (mode == V2DFmode)
diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def
index cbbb42c1b3a..559aee29e89 100644
--- a/gcc/config/rs6000/rs6000-cpus.def
+++ b/gcc/config/rs6000/rs6000-cpus.def
@@ -85,7 +85,9 @@
| OTHER_POWER10_MASKS \
| OPTION_MASK_P10_FUSION \
| OPTION_MASK_P10_FUSION_LD_CMPI \
- | OPTION_MASK_P10_FUSION_2LOGICAL)
+ | OPTION_MASK_P10_FUSION_2LOGICAL \
+ | OPTION_MASK_XXSPLTIW \
+ | OPTION_MASK_XXSPLTIDP)
/* Flags that need to be turned off if -mno-power9-vector. */
#define OTHER_P9_VECTOR_MASKS (OPTION_MASK_FLOAT128_HW \
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index a076c4e67dc..e1c855cb8ad 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -4507,8 +4507,9 @@ rs6000_option_override_internal (bool global_init_p)
(rs6000_isa_flags_explicit & OPTION_MASK_P10_FUSION_LD_CMPI) == 0)
rs6000_isa_flags |= OPTION_MASK_P10_FUSION_LD_CMPI;
- if (TARGET_POWER10 && (rs6000_isa_flags_explicit & OPTION_MASK_P10_FUSION_2LOGICAL) == 0)
- rs6000_isa_flags |= OPTION_MASK_P10_FUSION_2LOGICAL;
+ if (TARGET_POWER10 &&
+ (rs6000_isa_flags_explicit & OPTION_MASK_P10_FUSION_LD_CMPI) == 0)
+ rs6000_isa_flags |= OPTION_MASK_P10_FUSION_LD_CMPI;
/* Turn off vector pair/mma options on non-power10 systems. */
else if (!TARGET_POWER10 && TARGET_MMA)
@@ -4519,6 +4520,30 @@ rs6000_option_override_internal (bool global_init_p)
rs6000_isa_flags &= ~OPTION_MASK_MMA;
}
+ if (TARGET_POWER10 && TARGET_VSX
+ && (rs6000_isa_flags_explicit & OPTION_MASK_XXSPLTIW) == 0)
+ rs6000_isa_flags |= OPTION_MASK_XXSPLTIW;
+
+ if ((!TARGET_POWER10 || !TARGET_VSX) && TARGET_XXSPLTIW)
+ {
+ if ((rs6000_isa_flags_explicit & OPTION_MASK_XXSPLTIW) != 0)
+ error ("%qs requires %qs", "-mxxspltiw", "-mcpu=power10");
+
+ rs6000_isa_flags &= ~OPTION_MASK_XXSPLTIW;
+ }
+
+ if (TARGET_POWER10 && TARGET_VSX
+ && (rs6000_isa_flags_explicit & OPTION_MASK_XXSPLTIDP) == 0)
+ rs6000_isa_flags |= OPTION_MASK_XXSPLTIDP;
+
+ if ((!TARGET_POWER10 || !TARGET_VSX) && TARGET_XXSPLTIDP)
+ {
+ if ((rs6000_isa_flags_explicit & OPTION_MASK_XXSPLTIDP) != 0)
+ error ("%qs requires %qs", "-mxxspltidp", "-mcpu=power10");
+
+ rs6000_isa_flags &= ~OPTION_MASK_XXSPLTIDP;
+ }
+
if (!TARGET_PCREL && TARGET_PCREL_OPT)
rs6000_isa_flags &= ~OPTION_MASK_PCREL_OPT;
@@ -6399,7 +6424,7 @@ xxspltiw_constant_p (rtx op, machine_mode mode, rtx *constant_ptr)
{
*constant_ptr = NULL_RTX;
- if (!TARGET_POWER10)
+ if (!TARGET_XXSPLTIW)
return false;
if (mode == VOIDmode)
@@ -6733,7 +6758,7 @@ rs6000_expand_vector_init (rtx target, rtx vals)
if (n_var == 0)
{
/* Generate XXSPLTIW if we can. */
- if (TARGET_POWER10 && all_same
+ if (TARGET_XXSPLTIW && all_same
&& (mode == V4SImode || mode == V4SFmode || mode == V8HImode))
{
rtx dup = gen_rtx_VEC_DUPLICATE (mode, XVECEXP (vals, 0, 0));
@@ -6742,7 +6767,7 @@ rs6000_expand_vector_init (rtx target, rtx vals)
}
/* Generate XXSPLTIDP if we can. */
- if (TARGET_POWER10 && all_same && mode == V2DFmode
+ if (TARGET_XXSPLTIDP && all_same && mode == V2DFmode
&& xxspltidp_operand (XVECEXP (vals, 0, 0), DFmode))
{
rtx dup = gen_rtx_VEC_DUPLICATE (mode, XVECEXP (vals, 0, 0));
@@ -24090,6 +24115,8 @@ static struct rs6000_opt_mask const rs6000_opt_masks[] =
{ "string", 0, false, true },
{ "update", OPTION_MASK_NO_UPDATE, true , true },
{ "vsx", OPTION_MASK_VSX, false, true },
+ { "xxspltiw", OPTION_MASK_XXSPLTIW, false, true },
+ { "xxspltidp", OPTION_MASK_XXSPLTIDP, false, true },
#ifdef OPTION_MASK_64BIT
#if TARGET_AIX_OS
{ "aix64", OPTION_MASK_64BIT, false, false },
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 960d1913d9b..109ef05ad65 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -7536,7 +7536,7 @@
(define_split
[(set (match_operand:SFDF 0 "vsx_register_operand")
(match_operand:SFDF 1 "xxspltidp_operand"))]
- "TARGET_POWER10 && TARGET_VSX && operands[1] != CONST0_RTX (<MODE>mode)"
+ "TARGET_XXSPLTIDP && operands[1] != CONST0_RTX (<MODE>mode)"
[(set (match_dup 0)
(unspec:SFDF [(match_dup 2)] UNSPEC_XXSPLTID))]
{
@@ -7550,7 +7550,7 @@
[(set (match_operand:SFDF 0 "vsx_register_operand" "=wa")
(unspec:SFDF [(match_operand 1 "const_int_operand" "n")]
UNSPEC_XXSPLTID))]
- "TARGET_POWER10 && TARGET_VSX"
+ "TARGET_XXSPLTIDP"
"xxspltidp %x0,%1"
[(set_attr "type" "vecperm")
(set_attr "prefixed" "yes")
diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt
index 1fb2c35c1b3..2638dc45937 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -626,3 +626,11 @@ Generate (do not generate) MMA instructions.
mrelative-jumptables
Target Undocumented Var(rs6000_relative_jumptables) Init(1) Save
+
+mxxspltiw
+Target Undocumented Mask(XXSPLTIW) Var(rs6000_isa_flags)
+Generate (do not generate) XXSPLTIW instructions
+
+mxxspltidp
+Target Undocumented Mask(XXSPLTIDP) Var(rs6000_isa_flags)
+Generate (do not generate) XXSPLTIDP instructions
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-31 20:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-31 19:41 [gcc(refs/users/meissner/heads/work043)] Add -mno-xxspltiw and -mno-xxspltidp switches Michael Meissner
2021-03-31 20:36 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).