public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/5] vect testsuite adjustments for S/390 - v2
@ 2017-09-28 11:50 Andreas Krebbel
  2017-09-28 11:51 ` [PATCH 1/5] Enable vect_float with S/390 VXE and adjust testcases Andreas Krebbel
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Andreas Krebbel @ 2017-09-28 11:50 UTC (permalink / raw)
  To: gcc-patches

Changes to last version:

- vect_mult_long renamed to vect_long_mult (since there is already vect_int_mult ...)
- vect_no_peel changed to vect_can_peel as suggested by Richard
- another two target checks added: vect_intdouble_cvt and vect_doubleint_cvt
- documentation for the new target checks added


Ok for mainline?

Andreas Krebbel (5):
  Enable vect_float with S/390 VXE and adjust testcases
  Testcases using dg-options require at least -mzarch.
  New target check: vect_long_mult
  New target check for double<->int conversions
  New target check: vect_can_peel

 gcc/doc/sourcebuild.texi                           |  12 +++
 gcc/testsuite/g++.dg/vect/slp-pr56812.cc           |   4 +-
 gcc/testsuite/gcc.dg/vect/pr31699.c                |   2 +-
 gcc/testsuite/gcc.dg/vect/pr60656.c                |   3 +-
 gcc/testsuite/gcc.dg/vect/pr61194.c                |   1 +
 gcc/testsuite/gcc.dg/vect/pr65947-10.c             |   1 +
 gcc/testsuite/gcc.dg/vect/pr66142.c                |   2 +-
 gcc/testsuite/gcc.dg/vect/pr66251.c                |   4 +-
 gcc/testsuite/gcc.dg/vect/slp-10.c                 |   1 +
 gcc/testsuite/gcc.dg/vect/slp-11c.c                |   1 +
 gcc/testsuite/gcc.dg/vect/slp-12b.c                |   1 +
 gcc/testsuite/gcc.dg/vect/slp-18.c                 |   1 +
 gcc/testsuite/gcc.dg/vect/slp-33.c                 |   1 +
 gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c   |   2 +
 gcc/testsuite/gcc.dg/vect/slp-cond-2.c             |   2 +
 gcc/testsuite/gcc.dg/vect/vect-cond-10.c           |   1 +
 gcc/testsuite/gcc.dg/vect/vect-cond-8.c            |   1 +
 gcc/testsuite/gcc.dg/vect/vect-cond-9.c            |   1 +
 gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c    |   1 +
 gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c  |   1 +
 .../gcc.dg/vect/vect-floatint-conversion-2.c       |   2 +-
 .../gcc.dg/vect/vect-intfloat-conversion-3.c       |   2 +-
 .../gfortran.dg/vect/fast-math-mgrid-resid.f       |   1 +
 gcc/testsuite/gfortran.dg/vect/pr60510.f           |   1 +
 gcc/testsuite/gfortran.dg/vect/pr77848.f           |   1 +
 gcc/testsuite/gfortran.dg/vect/vect-8.f90          |   3 +-
 gcc/testsuite/lib/target-supports.exp              | 112 ++++++++++++++++++++-
 27 files changed, 155 insertions(+), 10 deletions(-)

-- 
2.9.1

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

* [PATCH 1/5] Enable vect_float with S/390 VXE and adjust testcases
  2017-09-28 11:50 [PATCH 0/5] vect testsuite adjustments for S/390 - v2 Andreas Krebbel
@ 2017-09-28 11:51 ` Andreas Krebbel
  2017-10-02 22:30   ` Jeff Law
  2017-09-28 11:52 ` [PATCH 2/5] Testcases using dg-options require at least -mzarch Andreas Krebbel
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Andreas Krebbel @ 2017-09-28 11:51 UTC (permalink / raw)
  To: gcc-patches

The target supports routines provide vect_double and vect_float but
these do not appear to be used consequently in the vect testcases.
With z13 we only have support for vector double but with z14 also for
vector float.  This patch adds vect_float to the testcases using the
float data type and make the vect_float target check to return 1 only
on z14.

gcc/testsuite/ChangeLog:

2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* lib/target-supports.exp (check_effective_target_vect_float):
	Return 1 being on a S/390 with VXE.
	* gcc.dg/vect/pr31699.c: Require vec_float.
	* gcc.dg/vect/pr61194.c: Likewise.
	* gcc.dg/vect/pr65947-10.c: Likewise.
	* gcc.dg/vect/pr66142.c: Likewise.
	* gcc.dg/vect/slp-10.c: Likewise.
	* gcc.dg/vect/slp-11c.c: Likewise.
	* gcc.dg/vect/slp-12b.c: Likewise.
	* gcc.dg/vect/slp-18.c: Likewise.
	* gcc.dg/vect/slp-33.c: Likewise.
	* gcc.dg/vect/slp-cond-2-big-array.c: Likewise.
	* gcc.dg/vect/slp-cond-2.c: Likewise.
	* gcc.dg/vect/vect-cond-10.c: Likewise.
	* gcc.dg/vect/vect-cond-8.c: Likewise.
	* gcc.dg/vect/vect-cond-9.c: Likewise.
	* gcc.dg/vect/vect-float-extend-1.c: Likewise.
	* gcc.dg/vect/vect-float-truncate-1.c: Likewise.
---
 gcc/testsuite/gcc.dg/vect/pr31699.c               | 2 +-
 gcc/testsuite/gcc.dg/vect/pr61194.c               | 1 +
 gcc/testsuite/gcc.dg/vect/pr65947-10.c            | 1 +
 gcc/testsuite/gcc.dg/vect/pr66142.c               | 2 +-
 gcc/testsuite/gcc.dg/vect/slp-10.c                | 1 +
 gcc/testsuite/gcc.dg/vect/slp-11c.c               | 1 +
 gcc/testsuite/gcc.dg/vect/slp-12b.c               | 1 +
 gcc/testsuite/gcc.dg/vect/slp-18.c                | 1 +
 gcc/testsuite/gcc.dg/vect/slp-33.c                | 1 +
 gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c  | 2 ++
 gcc/testsuite/gcc.dg/vect/slp-cond-2.c            | 2 ++
 gcc/testsuite/gcc.dg/vect/vect-cond-10.c          | 1 +
 gcc/testsuite/gcc.dg/vect/vect-cond-8.c           | 1 +
 gcc/testsuite/gcc.dg/vect/vect-cond-9.c           | 1 +
 gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c   | 1 +
 gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c | 1 +
 gcc/testsuite/lib/target-supports.exp             | 4 +++-
 17 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/vect/pr31699.c b/gcc/testsuite/gcc.dg/vect/pr31699.c
index 59b8daa..7ec4dfe 100644
--- a/gcc/testsuite/gcc.dg/vect/pr31699.c
+++ b/gcc/testsuite/gcc.dg/vect/pr31699.c
@@ -1,4 +1,4 @@
-/* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_float } */
 
 #include <stdlib.h>
 #include <stdarg.h>
diff --git a/gcc/testsuite/gcc.dg/vect/pr61194.c b/gcc/testsuite/gcc.dg/vect/pr61194.c
index f7c71b9..8421367 100644
--- a/gcc/testsuite/gcc.dg/vect/pr61194.c
+++ b/gcc/testsuite/gcc.dg/vect/pr61194.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_cond_mixed } */
+/* { dg-require-effective-target vect_float } */
 
 #include "tree-vect.h"
 
diff --git a/gcc/testsuite/gcc.dg/vect/pr65947-10.c b/gcc/testsuite/gcc.dg/vect/pr65947-10.c
index a8a674f..321cb8c 100644
--- a/gcc/testsuite/gcc.dg/vect/pr65947-10.c
+++ b/gcc/testsuite/gcc.dg/vect/pr65947-10.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_condition } */
+/* { dg-require-effective-target vect_float } */
 
 #include "tree-vect.h"
 
diff --git a/gcc/testsuite/gcc.dg/vect/pr66142.c b/gcc/testsuite/gcc.dg/vect/pr66142.c
index 94854ea..8c79f29 100644
--- a/gcc/testsuite/gcc.dg/vect/pr66142.c
+++ b/gcc/testsuite/gcc.dg/vect/pr66142.c
@@ -41,4 +41,4 @@ foo (float *a, float *b, float *c)
   *a = z;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target vect_condition } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target { vect_condition && vect_float } } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/slp-10.c b/gcc/testsuite/gcc.dg/vect/slp-10.c
index 3395d22..61c5d3c 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-10.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-10.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/slp-11c.c b/gcc/testsuite/gcc.dg/vect/slp-11c.c
index 8edd663..bdcf434 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-11c.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-11c.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/slp-12b.c b/gcc/testsuite/gcc.dg/vect/slp-12b.c
index d6fe4e4..48e7865 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-12b.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-12b.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_uintfloat_cvt } */
+/* { dg-require-effective-target vect_float } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/slp-18.c b/gcc/testsuite/gcc.dg/vect/slp-18.c
index 0752363..ed426a3 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-18.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-18.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
 /* { dg-require-effective-target vect_intfloat_cvt } */
 
 #include <stdarg.h>
diff --git a/gcc/testsuite/gcc.dg/vect/slp-33.c b/gcc/testsuite/gcc.dg/vect/slp-33.c
index 30220d4..ad74daf 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-33.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-33.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_float } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c b/gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c
index f171208..57cc67e 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-cond-2-big-array.c
@@ -1,4 +1,6 @@
 /* { dg-require-effective-target vect_cond_mixed } */
+/* { dg-require-effective-target vect_float } */
+
 #include "tree-vect.h"
 
 #define N 128
diff --git a/gcc/testsuite/gcc.dg/vect/slp-cond-2.c b/gcc/testsuite/gcc.dg/vect/slp-cond-2.c
index 68085d4..7350695 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-cond-2.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-cond-2.c
@@ -1,4 +1,6 @@
 /* { dg-require-effective-target vect_cond_mixed } */
+/* { dg-require-effective-target vect_float } */
+
 #include "tree-vect.h"
 
 #define N 32
diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-10.c b/gcc/testsuite/gcc.dg/vect/vect-cond-10.c
index a75ac26..1a18800 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-cond-10.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-cond-10.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_cond_mixed } */
+/* { dg-require-effective-target vect_float } */
 /* { dg-additional-options "-fno-ipa-icf" } */
 
 #include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-8.c b/gcc/testsuite/gcc.dg/vect/vect-cond-8.c
index 1b31d7d..224251d 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-cond-8.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-cond-8.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_cond_mixed } */
+/* { dg-require-effective-target vect_float } */
 
 #include "tree-vect.h"
 
diff --git a/gcc/testsuite/gcc.dg/vect/vect-cond-9.c b/gcc/testsuite/gcc.dg/vect/vect-cond-9.c
index 6259ab6..c03ed96 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-cond-9.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-cond-9.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_cond_mixed } */
+/* { dg-require-effective-target vect_float } */
 /* { dg-additional-options "-fno-ipa-icf" } */
 
 #include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c b/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
index 85a7ad1..867fe20 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-float-extend-1.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_float } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
diff --git a/gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c b/gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c
index 81c23cf..30d3a83 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-float-truncate-1.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_double } */
+/* { dg-require-effective-target vect_float } */
 
 #include <stdarg.h>
 #include "tree-vect.h"
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 57f646c..5949da4 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5211,7 +5211,9 @@ proc check_effective_target_vect_float { } {
 	     || [istarget aarch64*-*-*]
 	     || ([istarget mips*-*-*]
 		 && [et-is-effective-target mips_msa])
-	     || [is-effective-target arm_neon] } {
+	     || [is-effective-target arm_neon]
+	     || ([istarget s390*-*-*]
+		 && [check_effective_target_s390_vxe]) } {
 	    set et_vect_float_saved($et_index) 1
 	}
     }
-- 
2.9.1

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

* [PATCH 3/5] New target check: vect_long_mult
  2017-09-28 11:50 [PATCH 0/5] vect testsuite adjustments for S/390 - v2 Andreas Krebbel
  2017-09-28 11:51 ` [PATCH 1/5] Enable vect_float with S/390 VXE and adjust testcases Andreas Krebbel
  2017-09-28 11:52 ` [PATCH 2/5] Testcases using dg-options require at least -mzarch Andreas Krebbel
@ 2017-09-28 11:52 ` Andreas Krebbel
  2017-10-02 22:29   ` Jeff Law
  2017-09-28 11:53 ` [PATCH 4/5] New target check for double<->int conversions Andreas Krebbel
  2017-09-28 11:54 ` [PATCH 5/5] New target check: vect_can_peel Andreas Krebbel
  4 siblings, 1 reply; 11+ messages in thread
From: Andreas Krebbel @ 2017-09-28 11:52 UTC (permalink / raw)
  To: gcc-patches

We don't have a 64 bit vector integer multiply on z.  Add a specific
check for that.

gcc/ChangeLog:

2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* doc/sourcebuild.texi: Document vect_long_mult.

gcc/testsuite/ChangeLog:

2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.dg/vect/pr60656.c: Check vect_long_mult.
	* lib/target-supports.exp (check_effective_target_vect_long_mult):
	New proc.
---
 gcc/doc/sourcebuild.texi              |  3 +++
 gcc/testsuite/gcc.dg/vect/pr60656.c   |  3 ++-
 gcc/testsuite/lib/target-supports.exp | 24 ++++++++++++++++++++++++
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 56e1b4e..4f25268 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1422,6 +1422,9 @@ Target supports @code{vector short} multiplication.
 @item vect_int_mult
 Target supports @code{vector int} multiplication.
 
+@item vect_long_mult
+Target supports 64 bit @code{vector long} multiplication.
+
 @item vect_extract_even_odd
 Target supports vector even/odd element extraction.
 
diff --git a/gcc/testsuite/gcc.dg/vect/pr60656.c b/gcc/testsuite/gcc.dg/vect/pr60656.c
index d9e30bb..70ec0f6 100644
--- a/gcc/testsuite/gcc.dg/vect/pr60656.c
+++ b/gcc/testsuite/gcc.dg/vect/pr60656.c
@@ -43,4 +43,5 @@ int main()
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_mult_si_to_di_pattern } } } */
+/* P * P * P requires a widening multiplication first as well as a longxlong->long after that.  */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_widen_mult_si_to_di_pattern && vect_long_mult } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 5949da4..539aaaf 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -6299,6 +6299,30 @@ proc check_effective_target_vect_int_mult { } {
     return $et_vect_int_mult_saved($et_index)
 }
 
+# Return 1 if the target supports 64 bit hardware vector
+# multiplication of long operands with a long result, 0 otherwise.
+#
+# This can change for different subtargets so do not cache the result.
+
+proc check_effective_target_vect_long_mult { } {
+    if { [istarget i?86-*-*] || [istarget x86_64-*-*]
+	 || (([istarget powerpc*-*-*]
+              && ![istarget powerpc-*-linux*paired*])
+              && [check_effective_target_ilp32])
+	 || [is-effective-target arm_neon]
+	 || ([istarget sparc*-*-*] && [check_effective_target_ilp32])
+	 || [istarget aarch64*-*-*]
+	 || ([istarget mips*-*-*]
+	      && [et-is-effective-target mips_msa]) } {
+	set answer 1
+    } else {
+	set answer 0
+    }
+
+    verbose "check_effective_target_vect_long_mult: returning $answer" 2
+    return $answer
+}
+
 # Return 1 if the target supports vector even/odd elements extraction, 0 otherwise.
 
 proc check_effective_target_vect_extract_even_odd { } {
-- 
2.9.1

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

* [PATCH 2/5] Testcases using dg-options require at least -mzarch.
  2017-09-28 11:50 [PATCH 0/5] vect testsuite adjustments for S/390 - v2 Andreas Krebbel
  2017-09-28 11:51 ` [PATCH 1/5] Enable vect_float with S/390 VXE and adjust testcases Andreas Krebbel
@ 2017-09-28 11:52 ` Andreas Krebbel
  2017-10-02 22:31   ` Jeff Law
  2017-09-28 11:52 ` [PATCH 3/5] New target check: vect_long_mult Andreas Krebbel
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Andreas Krebbel @ 2017-09-28 11:52 UTC (permalink / raw)
  To: gcc-patches

Testcases which override the vect default options using dg-options
need at least -mzarch on S/390 32 bit.

gcc/testsuite/ChangeLog:

2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gfortran.dg/vect/fast-math-mgrid-resid.f: Use -mzarch on S/390.
	* gfortran.dg/vect/pr77848.f: Likewise.
---
 gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f | 1 +
 gcc/testsuite/gfortran.dg/vect/pr77848.f               | 1 +
 2 files changed, 2 insertions(+)

diff --git a/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f b/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
index 54f1e9e..7e2816b 100644
--- a/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
+++ b/gcc/testsuite/gfortran.dg/vect/fast-math-mgrid-resid.f
@@ -2,6 +2,7 @@
 ! { dg-require-effective-target vect_double }
 ! { dg-options "-O3 --param vect-max-peeling-for-alignment=0 -fpredictive-commoning -fdump-tree-pcom-details" }
 ! { dg-additional-options "-mprefer-avx128" { target { i?86-*-* x86_64-*-* } } }
+! { dg-additional-options "-mzarch" { target { s390*-*-* } } }
 
 ******* RESID COMPUTES THE RESIDUAL:  R = V - AU
 *
diff --git a/gcc/testsuite/gfortran.dg/vect/pr77848.f b/gcc/testsuite/gfortran.dg/vect/pr77848.f
index d54676e..4752205 100644
--- a/gcc/testsuite/gfortran.dg/vect/pr77848.f
+++ b/gcc/testsuite/gfortran.dg/vect/pr77848.f
@@ -1,6 +1,7 @@
 ! PR 77848: Verify versioning is on when vectorization fails
 ! { dg-do compile }
 ! { dg-options "-O3 -ffast-math -fdump-tree-ifcvt -fdump-tree-vect-details" }
+! { dg-additional-options "-mzarch" { target { s390*-*-* } } }
 
       subroutine sub(x,a,n,m)
       implicit none
-- 
2.9.1

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

* [PATCH 4/5] New target check for double<->int conversions
  2017-09-28 11:50 [PATCH 0/5] vect testsuite adjustments for S/390 - v2 Andreas Krebbel
                   ` (2 preceding siblings ...)
  2017-09-28 11:52 ` [PATCH 3/5] New target check: vect_long_mult Andreas Krebbel
@ 2017-09-28 11:53 ` Andreas Krebbel
  2017-10-02 22:33   ` Jeff Law
  2017-09-28 11:54 ` [PATCH 5/5] New target check: vect_can_peel Andreas Krebbel
  4 siblings, 1 reply; 11+ messages in thread
From: Andreas Krebbel @ 2017-09-28 11:53 UTC (permalink / raw)
  To: gcc-patches

gcc/ChangeLog:

2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* doc/sourcebuild.texi: Document vect_intdouble_cvt and
	vect_doubleint_cvt.

gcc/testsuite/ChangeLog:

2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* gcc.dg/vect/pr66251.c: Replace vect_floatint_cvt with
	vect_doubleint_cvt and vect_intfloat_cvt with vect_intdouble_cvt.
	* gcc.dg/vect/vect-floatint-conversion-2.c: Replace
	vect_floatint_cvt with vect_doubleint_cvt.
	* gcc.dg/vect/vect-intfloat-conversion-3.c: Replace
	vect_intfloat_cvt with vect_intdouble_cvt.
	* gfortran.dg/vect/pr60510.f: Require vect_intdouble_cvt.
	* gfortran.dg/vect/vect-8.f90: Make number of vectorized loops
	depend on vect_intdouble_cvt.
	* lib/target-supports.exp
	(check_effective_target_vect_doubleint_cvt)
	(check_effective_target_vect_intdouble_cvt): New procs.
---
 gcc/doc/sourcebuild.texi                           |  6 +++
 gcc/testsuite/gcc.dg/vect/pr66251.c                |  4 +-
 .../gcc.dg/vect/vect-floatint-conversion-2.c       |  2 +-
 .../gcc.dg/vect/vect-intfloat-conversion-3.c       |  2 +-
 gcc/testsuite/gfortran.dg/vect/pr60510.f           |  1 +
 gcc/testsuite/gfortran.dg/vect/vect-8.f90          |  3 +-
 gcc/testsuite/lib/target-supports.exp              | 62 ++++++++++++++++++++++
 7 files changed, 75 insertions(+), 5 deletions(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 4f25268..e09bca1 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1508,6 +1508,12 @@ Target supports conversion from @code{float} to @code{signed int}.
 @item vect_floatuint_cvt
 Target supports conversion from @code{float} to @code{unsigned int}.
 
+@item vect_intdouble_cvt
+Target supports conversion from @code{signed int} to @code{double}.
+
+@item vect_doubleint_cvt
+Target supports conversion from @code{double} to @code{signed int}.
+
 @item vect_max_reduc
 Target supports max reduction for vectors.
 @end table
diff --git a/gcc/testsuite/gcc.dg/vect/pr66251.c b/gcc/testsuite/gcc.dg/vect/pr66251.c
index 7f0c4bc..26afbc9 100644
--- a/gcc/testsuite/gcc.dg/vect/pr66251.c
+++ b/gcc/testsuite/gcc.dg/vect/pr66251.c
@@ -1,7 +1,7 @@
 /* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_double } */
-/* { dg-require-effective-target vect_floatint_cvt } */
-/* { dg-require-effective-target vect_intfloat_cvt } */
+/* { dg-require-effective-target vect_doubleint_cvt } */
+/* { dg-require-effective-target vect_intdouble_cvt } */
 /* { dg-require-effective-target vect_pack_trunc } */
 /* { dg-require-effective-target vect_unpack } */
 /* { dg-require-effective-target vect_hw_misalign } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
index 27d248b..64fab38 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-floatint-conversion-2.c
@@ -36,4 +36,4 @@ main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_floatint_cvt } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_doubleint_cvt } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
index 6eb4fec..78fc3da 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-intfloat-conversion-3.c
@@ -35,4 +35,4 @@ int main (void)
   return main1 ();
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intfloat_cvt } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_intdouble_cvt } } } */
diff --git a/gcc/testsuite/gfortran.dg/vect/pr60510.f b/gcc/testsuite/gfortran.dg/vect/pr60510.f
index 5e2c085..202c1be 100644
--- a/gcc/testsuite/gfortran.dg/vect/pr60510.f
+++ b/gcc/testsuite/gfortran.dg/vect/pr60510.f
@@ -1,5 +1,6 @@
 ! { dg-do run }
 ! { dg-require-effective-target vect_double }
+! { dg-require-effective-target vect_intdouble_cvt }
 ! { dg-additional-options "-fno-inline -ffast-math" }
       subroutine foo(a,x,y,n)
       implicit none
diff --git a/gcc/testsuite/gfortran.dg/vect/vect-8.f90 b/gcc/testsuite/gfortran.dg/vect/vect-8.f90
index ec95598..8e18be5 100644
--- a/gcc/testsuite/gfortran.dg/vect/vect-8.f90
+++ b/gcc/testsuite/gfortran.dg/vect/vect-8.f90
@@ -704,4 +704,5 @@ CALL track('KERNEL  ')
 RETURN
 END SUBROUTINE kernel
 
-! { dg-final { scan-tree-dump-times "vectorized 21 loops" 1 "vect" } }
+! { dg-final { scan-tree-dump-times "vectorized 21 loops" 1 "vect" { target { vect_intdouble_cvt } } } }
+! { dg-final { scan-tree-dump-times "vectorized 17 loops" 1 "vect" { target { ! vect_intdouble_cvt } } } }
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 539aaaf..4f752ec2 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3119,6 +3119,68 @@ proc check_effective_target_vect_intfloat_cvt { } {
     return $et_vect_intfloat_cvt_saved($et_index)
 }
 
+# Return 1 if the target supports signed double->int conversion
+#
+
+proc check_effective_target_vect_doubleint_cvt { } {
+    global et_vect_doubleint_cvt_saved
+    global et_index
+
+    if [info exists et_vect_doubleint_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_doubleint_cvt: using cached result" 2
+    } else {
+	set et_vect_doubleint_cvt_saved($et_index) 0
+	if { (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	      && [check_no_compiler_messages vect_doubleint_cvt assembly {
+		  #ifdef __tune_atom__
+		  # error No double vectorizer support.
+		  #endif
+	      }])
+	     || [istarget aarch64*-*-*]
+	     || [istarget spu-*-*]
+	     || ([istarget powerpc*-*-*] && [check_vsx_hw_available])
+	     || ([istarget mips*-*-*]
+		 && [et-is-effective-target mips_msa]) } {
+	    set et_vect_doubleint_cvt_saved($et_index) 1
+	}
+    }
+
+    verbose "check_effective_target_vect_doubleint_cvt:\
+	     returning $et_vect_doubleint_cvt_saved($et_index)" 2
+    return $et_vect_doubleint_cvt_saved($et_index)
+}
+
+# Return 1 if the target supports signed int->double conversion
+#
+
+proc check_effective_target_vect_intdouble_cvt { } {
+    global et_vect_intdouble_cvt_saved
+    global et_index
+
+    if [info exists et_vect_intdouble_cvt_saved($et_index)] {
+	verbose "check_effective_target_vect_intdouble_cvt: using cached result" 2
+    } else {
+	set et_vect_intdouble_cvt_saved($et_index) 0
+	if { (([istarget i?86-*-*] || [istarget x86_64-*-*])
+	      && [check_no_compiler_messages vect_intdouble_cvt assembly {
+		  #ifdef __tune_atom__
+		  # error No double vectorizer support.
+		  #endif
+	      }])
+	     || [istarget aarch64*-*-*]
+	     || [istarget spu-*-*]
+	     || ([istarget powerpc*-*-*] && [check_vsx_hw_available])
+	     || ([istarget mips*-*-*]
+		 && [et-is-effective-target mips_msa]) } {
+	    set et_vect_intdouble_cvt_saved($et_index) 1
+	}
+    }
+
+    verbose "check_effective_target_vect_intdouble_cvt:\
+	     returning $et_vect_intdouble_cvt_saved($et_index)" 2
+    return $et_vect_intdouble_cvt_saved($et_index)
+}
+
 #Return 1 if we're supporting __int128 for target, 0 otherwise.
 
 proc check_effective_target_int128 { } {
-- 
2.9.1

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

* [PATCH 5/5] New target check: vect_can_peel
  2017-09-28 11:50 [PATCH 0/5] vect testsuite adjustments for S/390 - v2 Andreas Krebbel
                   ` (3 preceding siblings ...)
  2017-09-28 11:53 ` [PATCH 4/5] New target check for double<->int conversions Andreas Krebbel
@ 2017-09-28 11:54 ` Andreas Krebbel
  2017-10-02 22:36   ` Jeff Law
  4 siblings, 1 reply; 11+ messages in thread
From: Andreas Krebbel @ 2017-09-28 11:54 UTC (permalink / raw)
  To: gcc-patches

gcc/ChangeLog:

2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* doc/sourcebuild.texi: Document vect_can_peel.

gcc/testsuite/ChangeLog:

2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

	* g++.dg/vect/slp-pr56812.cc: xfail for targets which don't want
	vector loop peeling.
	* lib/target-supports.exp (check_effective_target_vect_can_peel):
	New proc.
---
 gcc/doc/sourcebuild.texi                 |  3 +++
 gcc/testsuite/g++.dg/vect/slp-pr56812.cc |  4 +++-
 gcc/testsuite/lib/target-supports.exp    | 22 ++++++++++++++++++++++
 3 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index e09bca1..01d8595 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1404,6 +1404,9 @@ Target supports a vector misalign access.
 @item vect_no_align
 Target does not support a vector alignment mechanism.
 
+@item vect_can_peel
+Target might require to peel loops for alignment purposes.
+
 @item vect_no_int_min_max
 Target does not support a vector min and max instruction on @code{int}.
 
diff --git a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
index 80bdcdd..7d1cd71 100644
--- a/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
+++ b/gcc/testsuite/g++.dg/vect/slp-pr56812.cc
@@ -17,4 +17,6 @@ void mydata::Set (float x)
     data[i] = x;
 }
 
-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" } } */
+/* For targets without vector loop peeling the loop becomes cheap
+   enough to be vectorized.  */
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp1" { xfail { ! vect_can_peel } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 4f752ec2..49a7aef 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3277,6 +3277,28 @@ proc check_effective_target_vect_floatuint_cvt { } {
     return $et_vect_floatuint_cvt_saved($et_index)
 }
 
+# Return 1 if peeling for alignment might be profitable on the target
+#
+
+proc check_effective_target_vect_can_peel { } {
+    global et_vect_can_peel_saved
+    global et_index
+
+    if [info exists et_vect_can_peel_saved($et_index)] {
+	verbose "check_effective_target_vect_can_peel: using cached result" 2
+    } else {
+	set et_vect_can_peel_saved($et_index) 1
+        if { ([istarget s390*-*-*]
+	      && [check_effective_target_s390_vx]) } {
+	    set et_vect_can_peel_saved($et_index) 0
+        }
+    }
+
+    verbose "check_effective_target_vect_can_peel:\
+	     returning $et_vect_can_peel_saved($et_index)" 2
+    return $et_vect_can_peel_saved($et_index)
+}
+
 # Return 1 if the target supports #pragma omp declare simd, 0 otherwise.
 #
 # This won't change for different subtargets so cache the result.
-- 
2.9.1

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

* Re: [PATCH 3/5] New target check: vect_long_mult
  2017-09-28 11:52 ` [PATCH 3/5] New target check: vect_long_mult Andreas Krebbel
@ 2017-10-02 22:29   ` Jeff Law
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Law @ 2017-10-02 22:29 UTC (permalink / raw)
  To: Andreas Krebbel, gcc-patches

On 09/28/2017 05:50 AM, Andreas Krebbel wrote:
> We don't have a 64 bit vector integer multiply on z.  Add a specific
> check for that.
> 
> gcc/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* doc/sourcebuild.texi: Document vect_long_mult.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* gcc.dg/vect/pr60656.c: Check vect_long_mult.
> 	* lib/target-supports.exp (check_effective_target_vect_long_mult):
> 	New proc.
OK.
jeff

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

* Re: [PATCH 1/5] Enable vect_float with S/390 VXE and adjust testcases
  2017-09-28 11:51 ` [PATCH 1/5] Enable vect_float with S/390 VXE and adjust testcases Andreas Krebbel
@ 2017-10-02 22:30   ` Jeff Law
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Law @ 2017-10-02 22:30 UTC (permalink / raw)
  To: Andreas Krebbel, gcc-patches

On 09/28/2017 05:50 AM, Andreas Krebbel wrote:
> The target supports routines provide vect_double and vect_float but
> these do not appear to be used consequently in the vect testcases.
> With z13 we only have support for vector double but with z14 also for
> vector float.  This patch adds vect_float to the testcases using the
> float data type and make the vect_float target check to return 1 only
> on z14.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* lib/target-supports.exp (check_effective_target_vect_float):
> 	Return 1 being on a S/390 with VXE.
> 	* gcc.dg/vect/pr31699.c: Require vec_float.
> 	* gcc.dg/vect/pr61194.c: Likewise.
> 	* gcc.dg/vect/pr65947-10.c: Likewise.
> 	* gcc.dg/vect/pr66142.c: Likewise.
> 	* gcc.dg/vect/slp-10.c: Likewise.
> 	* gcc.dg/vect/slp-11c.c: Likewise.
> 	* gcc.dg/vect/slp-12b.c: Likewise.
> 	* gcc.dg/vect/slp-18.c: Likewise.
> 	* gcc.dg/vect/slp-33.c: Likewise.
> 	* gcc.dg/vect/slp-cond-2-big-array.c: Likewise.
> 	* gcc.dg/vect/slp-cond-2.c: Likewise.
> 	* gcc.dg/vect/vect-cond-10.c: Likewise.
> 	* gcc.dg/vect/vect-cond-8.c: Likewise.
> 	* gcc.dg/vect/vect-cond-9.c: Likewise.
> 	* gcc.dg/vect/vect-float-extend-1.c: Likewise.
> 	* gcc.dg/vect/vect-float-truncate-1.c: Likewise.
OK.
jeff

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

* Re: [PATCH 2/5] Testcases using dg-options require at least -mzarch.
  2017-09-28 11:52 ` [PATCH 2/5] Testcases using dg-options require at least -mzarch Andreas Krebbel
@ 2017-10-02 22:31   ` Jeff Law
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Law @ 2017-10-02 22:31 UTC (permalink / raw)
  To: Andreas Krebbel, gcc-patches

On 09/28/2017 05:50 AM, Andreas Krebbel wrote:
> Testcases which override the vect default options using dg-options
> need at least -mzarch on S/390 32 bit.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* gfortran.dg/vect/fast-math-mgrid-resid.f: Use -mzarch on S/390.
> 	* gfortran.dg/vect/pr77848.f: Likewise.
OK.
jeff

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

* Re: [PATCH 4/5] New target check for double<->int conversions
  2017-09-28 11:53 ` [PATCH 4/5] New target check for double<->int conversions Andreas Krebbel
@ 2017-10-02 22:33   ` Jeff Law
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Law @ 2017-10-02 22:33 UTC (permalink / raw)
  To: Andreas Krebbel, gcc-patches

On 09/28/2017 05:50 AM, Andreas Krebbel wrote:
> gcc/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* doc/sourcebuild.texi: Document vect_intdouble_cvt and
> 	vect_doubleint_cvt.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* gcc.dg/vect/pr66251.c: Replace vect_floatint_cvt with
> 	vect_doubleint_cvt and vect_intfloat_cvt with vect_intdouble_cvt.
> 	* gcc.dg/vect/vect-floatint-conversion-2.c: Replace
> 	vect_floatint_cvt with vect_doubleint_cvt.
> 	* gcc.dg/vect/vect-intfloat-conversion-3.c: Replace
> 	vect_intfloat_cvt with vect_intdouble_cvt.
> 	* gfortran.dg/vect/pr60510.f: Require vect_intdouble_cvt.
> 	* gfortran.dg/vect/vect-8.f90: Make number of vectorized loops
> 	depend on vect_intdouble_cvt.
> 	* lib/target-supports.exp
> 	(check_effective_target_vect_doubleint_cvt)
> 	(check_effective_target_vect_intdouble_cvt): New procs.
OK.
jeff

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

* Re: [PATCH 5/5] New target check: vect_can_peel
  2017-09-28 11:54 ` [PATCH 5/5] New target check: vect_can_peel Andreas Krebbel
@ 2017-10-02 22:36   ` Jeff Law
  0 siblings, 0 replies; 11+ messages in thread
From: Jeff Law @ 2017-10-02 22:36 UTC (permalink / raw)
  To: Andreas Krebbel, gcc-patches

On 09/28/2017 05:50 AM, Andreas Krebbel wrote:
> gcc/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* doc/sourcebuild.texi: Document vect_can_peel.
> 
> gcc/testsuite/ChangeLog:
> 
> 2017-09-28  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
> 
> 	* g++.dg/vect/slp-pr56812.cc: xfail for targets which don't want
> 	vector loop peeling.
> 	* lib/target-supports.exp (check_effective_target_vect_can_peel):
> 	New proc.
Can you come up with a better name than vect_can_peel?  The comments
indicate it's more about peeling to improve alignment is profitable on
the target rather than the target's ability to peel.

OK with a better name.

jeff

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

end of thread, other threads:[~2017-10-02 22:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-28 11:50 [PATCH 0/5] vect testsuite adjustments for S/390 - v2 Andreas Krebbel
2017-09-28 11:51 ` [PATCH 1/5] Enable vect_float with S/390 VXE and adjust testcases Andreas Krebbel
2017-10-02 22:30   ` Jeff Law
2017-09-28 11:52 ` [PATCH 2/5] Testcases using dg-options require at least -mzarch Andreas Krebbel
2017-10-02 22:31   ` Jeff Law
2017-09-28 11:52 ` [PATCH 3/5] New target check: vect_long_mult Andreas Krebbel
2017-10-02 22:29   ` Jeff Law
2017-09-28 11:53 ` [PATCH 4/5] New target check for double<->int conversions Andreas Krebbel
2017-10-02 22:33   ` Jeff Law
2017-09-28 11:54 ` [PATCH 5/5] New target check: vect_can_peel Andreas Krebbel
2017-10-02 22:36   ` Jeff Law

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