This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 3/5] New target check: vect_long_mult
- From: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 28 Sep 2017 13:50:02 +0200
- Subject: [PATCH 3/5] New target check: vect_long_mult
- Authentication-results: sourceware.org; auth=none
- References: <20170928115044.21422-1-krebbel@linux.vnet.ibm.com>
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