public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes
@ 2022-08-03 10:20 Ilya Leoshkevich
  2022-08-03 13:41 ` Andreas Krebbel
  2022-08-10 11:42 ` Ilya Leoshkevich
  0 siblings, 2 replies; 6+ messages in thread
From: Ilya Leoshkevich @ 2022-08-03 10:20 UTC (permalink / raw)
  To: Andreas Krebbel, Jakub Jelinek; +Cc: gcc-patches, Ilya Leoshkevich

Bootstrapped and regtested on s390x-redhat-linux.  Ok for master?



dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3
produces an insn that vsel<mode> is supposed to recognize, but can't,
because it's not defined for V2SF.  Fix by defining it for all vector
modes supported by copysign<mode>3.

gcc/ChangeLog:

	* config/s390/vector.md (V_HW_FT): New iterator.
	* config/s390/vx-builtins.md (vsel<mode>): Use V instead of
	V_HW.
---
 gcc/config/s390/vector.md      |  6 ++++++
 gcc/config/s390/vx-builtins.md | 12 ++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
index a6c4b4eb974..624729814af 100644
--- a/gcc/config/s390/vector.md
+++ b/gcc/config/s390/vector.md
@@ -63,6 +63,12 @@
 			   V1DF V2DF
 			   (V1TF "TARGET_VXE") (TF "TARGET_VXE")])
 
+; All modes present in V_HW and VFT.
+(define_mode_iterator V_HW_FT [V16QI V8HI V4SI V2DI (V1TI "TARGET_VXE") V1DF
+			       V2DF (V1SF "TARGET_VXE") (V2SF "TARGET_VXE")
+			       (V4SF "TARGET_VXE") (V1TF "TARGET_VXE")
+			       (TF "TARGET_VXE")])
+
 ; FP vector modes directly supported by the HW.  This does not include
 ; vector modes using only part of a vector register and should be used
 ; for instructions which might trigger IEEE exceptions.
diff --git a/gcc/config/s390/vx-builtins.md b/gcc/config/s390/vx-builtins.md
index d5130799804..98ee08b2683 100644
--- a/gcc/config/s390/vx-builtins.md
+++ b/gcc/config/s390/vx-builtins.md
@@ -517,12 +517,12 @@
 ; swapped in s390-c.cc when we get here.
 
 (define_insn "vsel<mode>"
-  [(set (match_operand:V_HW                      0 "register_operand" "=v")
-	(ior:V_HW
-	 (and:V_HW (match_operand:V_HW           1 "register_operand"  "v")
-		   (match_operand:V_HW           3 "register_operand"  "v"))
-	 (and:V_HW (not:V_HW (match_dup 3))
-		   (match_operand:V_HW           2 "register_operand"  "v"))))]
+  [(set (match_operand:V_HW_FT               0 "register_operand" "=v")
+	(ior:V_HW_FT
+	 (and:V_HW_FT (match_operand:V_HW_FT 1 "register_operand"  "v")
+		      (match_operand:V_HW_FT 3 "register_operand"  "v"))
+	 (and:V_HW_FT (not:V_HW_FT (match_dup 3))
+		      (match_operand:V_HW_FT 2 "register_operand"  "v"))))]
   "TARGET_VX"
   "vsel\t%v0,%1,%2,%3"
   [(set_attr "op_type" "VRR")])
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes
  2022-08-03 10:20 [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes Ilya Leoshkevich
@ 2022-08-03 13:41 ` Andreas Krebbel
  2022-08-10 11:42 ` Ilya Leoshkevich
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Krebbel @ 2022-08-03 13:41 UTC (permalink / raw)
  To: Ilya Leoshkevich, Andreas Krebbel, Jakub Jelinek; +Cc: gcc-patches

On 8/3/22 12:20, Ilya Leoshkevich wrote:
> Bootstrapped and regtested on s390x-redhat-linux.  Ok for master?
> 
> 
> 
> dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3
> produces an insn that vsel<mode> is supposed to recognize, but can't,
> because it's not defined for V2SF.  Fix by defining it for all vector
> modes supported by copysign<mode>3.
> 
> gcc/ChangeLog:
> 
> 	* config/s390/vector.md (V_HW_FT): New iterator.
> 	* config/s390/vx-builtins.md (vsel<mode>): Use V instead of
> 	V_HW.

Ok. There is a typo in the changelog:
"Use *V* instead ..." should probably read "Use V_HW_FT instead ..."

Thanks,

Andreas

> ---
>  gcc/config/s390/vector.md      |  6 ++++++
>  gcc/config/s390/vx-builtins.md | 12 ++++++------
>  2 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
> index a6c4b4eb974..624729814af 100644
> --- a/gcc/config/s390/vector.md
> +++ b/gcc/config/s390/vector.md
> @@ -63,6 +63,12 @@
>  			   V1DF V2DF
>  			   (V1TF "TARGET_VXE") (TF "TARGET_VXE")])
>  
> +; All modes present in V_HW and VFT.
> +(define_mode_iterator V_HW_FT [V16QI V8HI V4SI V2DI (V1TI "TARGET_VXE") V1DF
> +			       V2DF (V1SF "TARGET_VXE") (V2SF "TARGET_VXE")
> +			       (V4SF "TARGET_VXE") (V1TF "TARGET_VXE")
> +			       (TF "TARGET_VXE")])
> +
>  ; FP vector modes directly supported by the HW.  This does not include
>  ; vector modes using only part of a vector register and should be used
>  ; for instructions which might trigger IEEE exceptions.
> diff --git a/gcc/config/s390/vx-builtins.md b/gcc/config/s390/vx-builtins.md
> index d5130799804..98ee08b2683 100644
> --- a/gcc/config/s390/vx-builtins.md
> +++ b/gcc/config/s390/vx-builtins.md
> @@ -517,12 +517,12 @@
>  ; swapped in s390-c.cc when we get here.
>  
>  (define_insn "vsel<mode>"
> -  [(set (match_operand:V_HW                      0 "register_operand" "=v")
> -	(ior:V_HW
> -	 (and:V_HW (match_operand:V_HW           1 "register_operand"  "v")
> -		   (match_operand:V_HW           3 "register_operand"  "v"))
> -	 (and:V_HW (not:V_HW (match_dup 3))
> -		   (match_operand:V_HW           2 "register_operand"  "v"))))]
> +  [(set (match_operand:V_HW_FT               0 "register_operand" "=v")
> +	(ior:V_HW_FT
> +	 (and:V_HW_FT (match_operand:V_HW_FT 1 "register_operand"  "v")
> +		      (match_operand:V_HW_FT 3 "register_operand"  "v"))
> +	 (and:V_HW_FT (not:V_HW_FT (match_dup 3))
> +		      (match_operand:V_HW_FT 2 "register_operand"  "v"))))]
>    "TARGET_VX"
>    "vsel\t%v0,%1,%2,%3"
>    [(set_attr "op_type" "VRR")])


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes
  2022-08-03 10:20 [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes Ilya Leoshkevich
  2022-08-03 13:41 ` Andreas Krebbel
@ 2022-08-10 11:42 ` Ilya Leoshkevich
  2022-08-11  5:45   ` Andreas Krebbel
  1 sibling, 1 reply; 6+ messages in thread
From: Ilya Leoshkevich @ 2022-08-10 11:42 UTC (permalink / raw)
  To: Andreas Krebbel, Jakub Jelinek; +Cc: gcc-patches

On Wed, 2022-08-03 at 12:20 +0200, Ilya Leoshkevich wrote:
> Bootstrapped and regtested on s390x-redhat-linux.  Ok for master?
> 
> 
> 
> dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3
> produces an insn that vsel<mode> is supposed to recognize, but can't,
> because it's not defined for V2SF.  Fix by defining it for all vector
> modes supported by copysign<mode>3.
> 
> gcc/ChangeLog:
> 
>         * config/s390/vector.md (V_HW_FT): New iterator.
>         * config/s390/vx-builtins.md (vsel<mode>): Use V instead of
>         V_HW.
> ---
>  gcc/config/s390/vector.md      |  6 ++++++
>  gcc/config/s390/vx-builtins.md | 12 ++++++------
>  2 files changed, 12 insertions(+), 6 deletions(-)

Jakub pointed out that this is broken in gcc-12 as well.
The patch applies cleanly, and I started a bootstrap/regtest.
Ok for gcc-12?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes
  2022-08-10 11:42 ` Ilya Leoshkevich
@ 2022-08-11  5:45   ` Andreas Krebbel
  2022-08-17 13:01     ` Ilya Leoshkevich
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Krebbel @ 2022-08-11  5:45 UTC (permalink / raw)
  To: Ilya Leoshkevich, Jakub Jelinek; +Cc: gcc-patches

On 8/10/22 13:42, Ilya Leoshkevich wrote:
> On Wed, 2022-08-03 at 12:20 +0200, Ilya Leoshkevich wrote:
>> Bootstrapped and regtested on s390x-redhat-linux.  Ok for master?
>>
>>
>>
>> dg.exp=pr104612.c fails with an ICE on s390x, because copysignv2sf3
>> produces an insn that vsel<mode> is supposed to recognize, but can't,
>> because it's not defined for V2SF.  Fix by defining it for all vector
>> modes supported by copysign<mode>3.
>>
>> gcc/ChangeLog:
>>
>>         * config/s390/vector.md (V_HW_FT): New iterator.
>>         * config/s390/vx-builtins.md (vsel<mode>): Use V instead of
>>         V_HW.
>> ---
>>  gcc/config/s390/vector.md      |  6 ++++++
>>  gcc/config/s390/vx-builtins.md | 12 ++++++------
>>  2 files changed, 12 insertions(+), 6 deletions(-)
> 
> Jakub pointed out that this is broken in gcc-12 as well.
> The patch applies cleanly, and I started a bootstrap/regtest.
> Ok for gcc-12?

Yes. Thanks!

Andreas

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes
  2022-08-11  5:45   ` Andreas Krebbel
@ 2022-08-17 13:01     ` Ilya Leoshkevich
  2022-08-18  6:44       ` Richard Biener
  0 siblings, 1 reply; 6+ messages in thread
From: Ilya Leoshkevich @ 2022-08-17 13:01 UTC (permalink / raw)
  To: Andreas Krebbel, Jakub Jelinek, Richard Biener; +Cc: gcc-patches

On Thu, 2022-08-11 at 07:45 +0200, Andreas Krebbel wrote:
> On 8/10/22 13:42, Ilya Leoshkevich wrote:
> > On Wed, 2022-08-03 at 12:20 +0200, Ilya Leoshkevich wrote:
> > > Bootstrapped and regtested on s390x-redhat-linux.  Ok for master?
> > > 
> > > 
> > > 
> > > dg.exp=pr104612.c fails with an ICE on s390x, because
> > > copysignv2sf3
> > > produces an insn that vsel<mode> is supposed to recognize, but
> > > can't,
> > > because it's not defined for V2SF.  Fix by defining it for all
> > > vector
> > > modes supported by copysign<mode>3.
> > > 
> > > gcc/ChangeLog:
> > > 
> > >         * config/s390/vector.md (V_HW_FT): New iterator.
> > >         * config/s390/vx-builtins.md (vsel<mode>): Use V instead
> > > of
> > >         V_HW.
> > > ---
> > >  gcc/config/s390/vector.md      |  6 ++++++
> > >  gcc/config/s390/vx-builtins.md | 12 ++++++------
> > >  2 files changed, 12 insertions(+), 6 deletions(-)
> > 
> > Jakub pointed out that this is broken in gcc-12 as well.
> > The patch applies cleanly, and I started a bootstrap/regtest.
> > Ok for gcc-12?
> 
> Yes. Thanks!
> 
> Andreas

Hi,

I've committed this today without realizing that gcc-12 branch is
closed.  Sorry!  Please let me know if I should revert this.

Best regards,
Ilya

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes
  2022-08-17 13:01     ` Ilya Leoshkevich
@ 2022-08-18  6:44       ` Richard Biener
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Biener @ 2022-08-18  6:44 UTC (permalink / raw)
  To: Ilya Leoshkevich; +Cc: Andreas Krebbel, Jakub Jelinek, gcc-patches

On Wed, 17 Aug 2022, Ilya Leoshkevich wrote:

> On Thu, 2022-08-11 at 07:45 +0200, Andreas Krebbel wrote:
> > On 8/10/22 13:42, Ilya Leoshkevich wrote:
> > > On Wed, 2022-08-03 at 12:20 +0200, Ilya Leoshkevich wrote:
> > > > Bootstrapped and regtested on s390x-redhat-linux.  Ok for master?
> > > > 
> > > > 
> > > > 
> > > > dg.exp=pr104612.c fails with an ICE on s390x, because
> > > > copysignv2sf3
> > > > produces an insn that vsel<mode> is supposed to recognize, but
> > > > can't,
> > > > because it's not defined for V2SF.  Fix by defining it for all
> > > > vector
> > > > modes supported by copysign<mode>3.
> > > > 
> > > > gcc/ChangeLog:
> > > > 
> > > >         * config/s390/vector.md (V_HW_FT): New iterator.
> > > >         * config/s390/vx-builtins.md (vsel<mode>): Use V instead
> > > > of
> > > >         V_HW.
> > > > ---
> > > >  gcc/config/s390/vector.md      |  6 ++++++
> > > >  gcc/config/s390/vx-builtins.md | 12 ++++++------
> > > >  2 files changed, 12 insertions(+), 6 deletions(-)
> > > 
> > > Jakub pointed out that this is broken in gcc-12 as well.
> > > The patch applies cleanly, and I started a bootstrap/regtest.
> > > Ok for gcc-12?
> > 
> > Yes. Thanks!
> > 
> > Andreas
> 
> Hi,
> 
> I've committed this today without realizing that gcc-12 branch is
> closed.  Sorry!  Please let me know if I should revert this.

It doesn't look too risky, so leave it in.

Richard.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-18  6:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03 10:20 [PATCH] PR106342 - IBM zSystems: Provide vsel for all vector modes Ilya Leoshkevich
2022-08-03 13:41 ` Andreas Krebbel
2022-08-10 11:42 ` Ilya Leoshkevich
2022-08-11  5:45   ` Andreas Krebbel
2022-08-17 13:01     ` Ilya Leoshkevich
2022-08-18  6:44       ` Richard Biener

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).