s390: Add testcase for just fixed PR118362

Message ID Z4ATwcTnfuFzVKt/@tucnak
State New
Headers
Series s390: Add testcase for just fixed PR118362 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed

Commit Message

Jakub Jelinek Jan. 9, 2025, 6:21 p.m. UTC
  On Thu, Jan 09, 2025 at 01:29:27PM +0100, Stefan Schulze Frielinghaus wrote:
> Optimization s390_constant_via_vgbm_p() should only apply to constant
> vectors which can be expressed by the hardware, i.e., which have a size
> of at most 16-bytes, similar as it is done for s390_constant_via_vgm_p()
> and s390_constant_via_vrepi_p().
> 
> gcc/ChangeLog:
> 
> 	PR target/118362
> 	* config/s390/s390.cc (s390_constant_via_vgbm_p): Allow at most
> 	16-byte vectors.
> ---
>  Bootstrap and regtest are still running.  If both are successful, I
>  will push this one promptly.

This was committed without a testcase, which IMHO shouldn't hurt.

Ok for trunk?

2025-01-09  Jakub Jelinek  <jakub@redhat.com>

	PR target/118362
	* gcc.c-torture/compile/pr118362.c: New test.
	* gcc.target/s390/pr118362.c: New test.



	Jakub
  

Comments

Stefan Schulze Frielinghaus Jan. 9, 2025, 8:51 p.m. UTC | #1
On Thu, Jan 09, 2025 at 07:21:53PM +0100, Jakub Jelinek wrote:
> On Thu, Jan 09, 2025 at 01:29:27PM +0100, Stefan Schulze Frielinghaus wrote:
> > Optimization s390_constant_via_vgbm_p() should only apply to constant
> > vectors which can be expressed by the hardware, i.e., which have a size
> > of at most 16-bytes, similar as it is done for s390_constant_via_vgm_p()
> > and s390_constant_via_vrepi_p().
> > 
> > gcc/ChangeLog:
> > 
> > 	PR target/118362
> > 	* config/s390/s390.cc (s390_constant_via_vgbm_p): Allow at most
> > 	16-byte vectors.
> > ---
> >  Bootstrap and regtest are still running.  If both are successful, I
> >  will push this one promptly.
> 
> This was committed without a testcase, which IMHO shouldn't hurt.
> 
> Ok for trunk?

Ok.

Thanks,
Stefan
  

Patch

--- gcc/testsuite/gcc.c-torture/compile/pr118362.c.jj	2025-01-09 19:13:10.536029180 +0100
+++ gcc/testsuite/gcc.c-torture/compile/pr118362.c	2025-01-09 19:13:03.377128620 +0100
@@ -0,0 +1,19 @@ 
+/* PR target/118362 */
+
+int a, b, c[18];
+
+void
+foo (void)
+{
+  for (int i = 0; i < 8; i++)
+    if (b)
+      {
+	c[i * 2 + 1] = a;
+	c[i * 2 + 2] = 200;
+      }
+    else
+      {
+	c[i * 2 + 1] = 1000000;
+	c[i * 2 + 2] = 200;
+      }
+}
--- gcc/testsuite/gcc.target/s390/pr118362.c.jj	2025-01-09 19:13:47.865510663 +0100
+++ gcc/testsuite/gcc.target/s390/pr118362.c	2025-01-09 19:14:25.691985248 +0100
@@ -0,0 +1,5 @@ 
+/* PR target/118362 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=z14" } */
+
+#include "../../gcc.c-torture/compile/pr118362.c"