From: Andreas Krebbel Date: Wed, 4 Oct 2017 11:58:22 +0000 (+0000) Subject: New target check: vect_long_mult X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c059a92eccd96d00ffd23801d032eba14ff2a244;p=gcc.git New target check: vect_long_mult 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 * doc/sourcebuild.texi: Document vect_long_mult. gcc/testsuite/ChangeLog: 2017-10-04 Andreas Krebbel * gcc.dg/vect/pr60656.c: Check vect_long_mult. * lib/target-supports.exp (check_effective_target_vect_long_mult): New proc. From-SVN: r253405 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76c1f1b403e..2015b7fee84 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2017-10-04 Andreas Krebbel + + * doc/sourcebuild.texi: Document vect_long_mult. + 2017-10-04 Richard Sandiford PR tree-optimization/82413 diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 56e1b4eb103..4f25268bda8 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/ChangeLog b/gcc/testsuite/ChangeLog index 1dea25d48ff..68e0f055f24 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-10-04 Andreas Krebbel + + * 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 * gfortran.dg/vect/fast-math-mgrid-resid.f: Use -mzarch on S/390. diff --git a/gcc/testsuite/gcc.dg/vect/pr60656.c b/gcc/testsuite/gcc.dg/vect/pr60656.c index d9e30bbbeae..70ec0f68dd6 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 5949da43203..539aaaf1490 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 { } {