This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/5] pr60656.c: New target check: vect_mult_long


On 09/26/2017 01:57 PM, Rainer Orth wrote:
> Hi Andreas,
> 
>> We don't have a 64 bit vector integer multiply on z.  Add a specific
>> check for that.
>>
>> 2017-09-26  Andreas Krebbel  <krebbel@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.
> 
> as usual, this and the other new effective-target keywords need
> documenting in sourcebuild.texi.
> 
> 	Rainer
> 

Ok.

-Andreas-

pr60656.c: New target check: vect_mult_long

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

gcc/ChangeLog:

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

	* doc/sourcebuild.texi: Document vect_mult_long.

gcc/testsuite/ChangeLog:

2017-09-26  Andreas Krebbel  <krebbel@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.

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 9901c94..307c726 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1467,6 +1467,10 @@ into @code{int} results, or can promote (unpack) from @code{short} to
 Target supports a vector widening multiplication of @code{int} operands
 into @code{long} results.

+@item vect_mult_long
+Target supports a vector multiplication of @code{long} operands into
+@code{long} results.
+
 @item vect_sdot_qi
 Target supports a vector dot-product of @code{signed char}.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]