New target check: vect_long_mult
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Wed, 4 Oct 2017 11:58:22 +0000 (11:58 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Wed, 4 Oct 2017 11:58:22 +0000 (11:58 +0000)
We don't have a 64 bit vector integer multiply on z.  Add a specific
check for that.

gcc/ChangeLog:

2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* doc/sourcebuild.texi: Document vect_long_mult.

gcc/testsuite/ChangeLog:

2017-10-04  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.

From-SVN: r253405

gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr60656.c
gcc/testsuite/lib/target-supports.exp

index 76c1f1b403ec912122269a6378d824f2d677452b..2015b7fee849f0b2a9c4d917d5a3b7b918e45f38 100644 (file)
@@ -1,3 +1,7 @@
+2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       * doc/sourcebuild.texi: Document vect_long_mult.
+
 2017-10-04  Richard Sandiford  <richard.sandiford@linaro.org>
 
        PR tree-optimization/82413
index 56e1b4eb103ab412b29d6dcd9b556515ebc2ac63..4f25268bda88e481a82ef1c92dfefc1ae4d08372 100644 (file)
@@ -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.
 
index 1dea25d48ff407e91ec8f8794cdd38cf2963aedc..68e0f055f2492b34d8640b3f4419fa0894f5b1e9 100644 (file)
@@ -1,3 +1,9 @@
+2017-10-04  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.
+
 2017-10-04  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * gfortran.dg/vect/fast-math-mgrid-resid.f: Use -mzarch on S/390.
index d9e30bbbeae731eb1a5017f37fe357062a711d16..70ec0f68dd662b927a587ca5d816241526552130 100644 (file)
@@ -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 } } } } */
index 5949da432032d0e58ba1f38a0003b9d74885143b..539aaaf1490239cfafa86e9241956401ed6c61b3 100644 (file)
@@ -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 { } {