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

2017-09-26  Andreas Krebbel  <kreb...@linux.vnet.ibm.com>

        * gcc.dg/vect/pr60656.c: Check vect_mult_long.
        * lib/target-supports.exp (check_effective_target_vect_mult_long):
        New proc.
---
 gcc/testsuite/gcc.dg/vect/pr60656.c   |  3 ++-
 gcc/testsuite/lib/target-supports.exp | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/vect/pr60656.c 
b/gcc/testsuite/gcc.dg/vect/pr60656.c
index d9e30bb..f44269a 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_mult_long } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index b45a19e..7fdfbbb 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5166,6 +5166,30 @@ proc check_effective_target_vect_long { } {
     return $answer
 }
 
+# Return 1 if the target supports 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_mult_long { } {
+    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_mult_long: returning $answer" 2
+    return $answer
+}
+
 # Return 1 if the target supports hardware vectors of float, 0 otherwise.
 #
 # This won't change for different subtargets so cache the result.
-- 
2.9.1

Reply via email to