RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-08-24 Thread Robert Suchanek
Hi Jeff,

> > The following patch reverts to the old behaviour. I also removed misleading
> > comments and related logic that checks for the cached result.  There might 
> > be
> > other procedures with similar inconsistency but here I only modified the
> offending ones.
> Thanks.  Given how much cut-n-paste we do with the tcl code there's a
> good chance this problem exists elsewhere.   I don't start ranting about
> tcl/dejagnu, I'll just put me in a terrible mood for the rest of the day.

Indeed.

> > Alternatively, it would be possible to switch to the new method and do the
> caching
> > but it is more intrusive change that requires careful analysis of the 
> > results
> > and the tests will not likely be directly comparable with old results
> (because of
> > flag mixing into the test names).  It's safer to restore the original
> behaviour
> > as the patch was not supposed to change any existing results.
> I'd go with the safer approach for now -- I keep holding out hope that
> there's a silver bullet out there that will allow us to replace dejagnu
> and all its tcl goop some day.

I noticed over time that tcl/dejagnu have a unique set of features.
Replacing them with something else at some point wouldn't be a bad thing.

> 
> >
> > Ok to apply?
> >
> > Regards,
> > Robert
> >
> > gcc/testsuite/
> > * lib/target-supports.exp
> > (check_effective_target_vect_aligned_arrays): Don't cache the result.
> > (check_effective_target_vect_natural_alignment): Ditto.
> > (check_effective_target_vector_alignment_reachable): Ditto.
> > (check_effective_target_vector_alignment_reachable_for_64bit): Ditto.
> OK.
> jeff
> >

Committed as r239730.

Regards,
Robert


RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-08-24 Thread Robert Suchanek
> On 08/23/2016 04:15 PM, Trevor Saunders wrote:
> >
> > I've certainly been tempted to take a stab at at least replacing the
> > expect stuff with something else, it drives me kind of crazy to see how
> > much testsuite time is spent running expect.  Even if we can't do all of
> > it, the vast majority is just run the compiler and grep dump files or
> > the compiler's stdout / stderr.
> Yup.  When Rob was making noise about rewriting dejagnu I tried to steer
> him a bit towards instead replacing the expect layer, but his plans
> where more on the tcl/dejagnu side.  I don't think anything ever came
> out of that proposal.
> 
> Expect is severe overkill for what we need and yes, it burns an amazing
> about of CPU time for what get out of it.
> 
> Jeff

True.  I wasn't considering replacing the expect layer, just to overcome
the limitation of auto-vect tests.  This in itself is rather another hack
but didn't have a suggestion what to replace it with.

Regards,
Robert





Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-08-23 Thread Jeff Law

On 08/23/2016 04:15 PM, Trevor Saunders wrote:


I've certainly been tempted to take a stab at at least replacing the
expect stuff with something else, it drives me kind of crazy to see how
much testsuite time is spent running expect.  Even if we can't do all of
it, the vast majority is just run the compiler and grep dump files or
the compiler's stdout / stderr.
Yup.  When Rob was making noise about rewriting dejagnu I tried to steer 
him a bit towards instead replacing the expect layer, but his plans 
where more on the tcl/dejagnu side.  I don't think anything ever came 
out of that proposal.


Expect is severe overkill for what we need and yes, it burns an amazing 
about of CPU time for what get out of it.


Jeff


Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-08-23 Thread Trevor Saunders
On Tue, Aug 23, 2016 at 09:52:23AM -0600, Jeff Law wrote:
> On 08/23/2016 02:15 AM, Robert Suchanek wrote:
> > Hi,
> > 
> > > unfortunately this broke make check-c
> > > RUNTESTFLAGS='vect.exp=*no-vfa-vect-dv-2.c
> > > --target_board=unix\{-m32,-m64\}', causing the check if
> > > vect_aligned_arrays to be cached between the -m64 and -m32 variants
> > > which is incorrect at least on my machine if you actually run that test
> > > for -m32 and -m64 you get different results.  In both case et_index is 0
> > > so you use the cached value the second time, but that's not correct
> > > because the options changed.
> > > 
> > > I suspect this also causes some random vectorizer tests to appear and
> > > disappear during regression testing with the same -m64 and -m32, but I'm
> > > not absolutely sure of that part.
> > > 
> > > Thanks!
> > > 
> > > Trev
> > 
> > I was misled by the comments in a few procedures suggesting that the results
> > should have been cached and the use of global variable looked mistyped.
> Comments wrong, surely you jest :-)
> 
> > 
> > The following patch reverts to the old behaviour. I also removed misleading
> > comments and related logic that checks for the cached result.  There might 
> > be
> > other procedures with similar inconsistency but here I only modified the 
> > offending ones.
> Thanks.  Given how much cut-n-paste we do with the tcl code there's a good
> chance this problem exists elsewhere.   I don't start ranting about
> tcl/dejagnu, I'll just put me in a terrible mood for the rest of the day.
> 
> > 
> > Alternatively, it would be possible to switch to the new method and do the 
> > caching
> > but it is more intrusive change that requires careful analysis of the 
> > results
> > and the tests will not likely be directly comparable with old results 
> > (because of
> > flag mixing into the test names).  It's safer to restore the original 
> > behaviour
> > as the patch was not supposed to change any existing results.
> I'd go with the safer approach for now -- I keep holding out hope that
> there's a silver bullet out there that will allow us to replace dejagnu and
> all its tcl goop some day.

I've certainly been tempted to take a stab at at least replacing the
expect stuff with something else, it drives me kind of crazy to see how
much testsuite time is spent running expect.  Even if we can't do all of
it, the vast majority is just run the compiler and grep dump files or
the compiler's stdout / stderr.

Trev



Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-08-23 Thread Jeff Law

On 08/23/2016 02:15 AM, Robert Suchanek wrote:

Hi,


unfortunately this broke make check-c
RUNTESTFLAGS='vect.exp=*no-vfa-vect-dv-2.c
--target_board=unix\{-m32,-m64\}', causing the check if
vect_aligned_arrays to be cached between the -m64 and -m32 variants
which is incorrect at least on my machine if you actually run that test
for -m32 and -m64 you get different results.  In both case et_index is 0
so you use the cached value the second time, but that's not correct
because the options changed.

I suspect this also causes some random vectorizer tests to appear and
disappear during regression testing with the same -m64 and -m32, but I'm
not absolutely sure of that part.

Thanks!

Trev


I was misled by the comments in a few procedures suggesting that the results
should have been cached and the use of global variable looked mistyped.

Comments wrong, surely you jest :-)



The following patch reverts to the old behaviour. I also removed misleading
comments and related logic that checks for the cached result.  There might be
other procedures with similar inconsistency but here I only modified the 
offending ones.
Thanks.  Given how much cut-n-paste we do with the tcl code there's a 
good chance this problem exists elsewhere.   I don't start ranting about 
tcl/dejagnu, I'll just put me in a terrible mood for the rest of the day.




Alternatively, it would be possible to switch to the new method and do the 
caching
but it is more intrusive change that requires careful analysis of the results
and the tests will not likely be directly comparable with old results (because 
of
flag mixing into the test names).  It's safer to restore the original behaviour
as the patch was not supposed to change any existing results.
I'd go with the safer approach for now -- I keep holding out hope that 
there's a silver bullet out there that will allow us to replace dejagnu 
and all its tcl goop some day.




Ok to apply?

Regards,
Robert

gcc/testsuite/
* lib/target-supports.exp
(check_effective_target_vect_aligned_arrays): Don't cache the result.
(check_effective_target_vect_natural_alignment): Ditto.
(check_effective_target_vector_alignment_reachable): Ditto.
(check_effective_target_vector_alignment_reachable_for_64bit): Ditto.

OK.
jeff




RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-08-23 Thread Robert Suchanek
Hi,

> unfortunately this broke make check-c
> RUNTESTFLAGS='vect.exp=*no-vfa-vect-dv-2.c
> --target_board=unix\{-m32,-m64\}', causing the check if
> vect_aligned_arrays to be cached between the -m64 and -m32 variants
> which is incorrect at least on my machine if you actually run that test
> for -m32 and -m64 you get different results.  In both case et_index is 0
> so you use the cached value the second time, but that's not correct
> because the options changed.
> 
> I suspect this also causes some random vectorizer tests to appear and
> disappear during regression testing with the same -m64 and -m32, but I'm
> not absolutely sure of that part.
> 
> Thanks!
> 
> Trev

I was misled by the comments in a few procedures suggesting that the results
should have been cached and the use of global variable looked mistyped.

The following patch reverts to the old behaviour. I also removed misleading
comments and related logic that checks for the cached result.  There might be
other procedures with similar inconsistency but here I only modified the 
offending ones.

Alternatively, it would be possible to switch to the new method and do the 
caching
but it is more intrusive change that requires careful analysis of the results
and the tests will not likely be directly comparable with old results (because 
of
flag mixing into the test names).  It's safer to restore the original behaviour
as the patch was not supposed to change any existing results.

Ok to apply?

Regards,
Robert

gcc/testsuite/
* lib/target-supports.exp
(check_effective_target_vect_aligned_arrays): Don't cache the result.
(check_effective_target_vect_natural_alignment): Ditto.
(check_effective_target_vector_alignment_reachable): Ditto.
(check_effective_target_vector_alignment_reachable_for_64bit): Ditto.

diff --git a/gcc/testsuite/lib/target-supports.exp 
b/gcc/testsuite/lib/target-supports.exp
index 533d3a6..0dabea0 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -5309,32 +5309,22 @@ proc check_effective_target_vect_hw_misalign { } {
 
 # Return 1 if arrays are aligned to the vector alignment
 # boundary, 0 otherwise.
-#
-# This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_aligned_arrays { } {
-global et_vect_aligned_arrays_saved
-global et_index
-
-if [info exists et_vect_aligned_arrays_saved($et_index)] {
-   verbose "check_effective_target_vect_aligned_arrays:\
-using cached result" 2
-} else {
-   set et_vect_aligned_arrays_saved($et_index) 0
-if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
-   if { ([is-effective-target lp64]
- && ( ![check_avx_available]
-|| [check_prefer_avx128])) } {
-set et_vect_aligned_arrays_saved($et_index) 1
-   }
-   }
-if [istarget spu-*-*] {
-   set et_vect_aligned_arrays_saved($et_index) 1
+set et_vect_aligned_arrays 0
+if { ([istarget x86_64-*-*] || [istarget i?86-*-*]) } {
+   if { ([is-effective-target lp64]
+ && ( ![check_avx_available]
+|| [check_prefer_avx128])) } {
+set et_vect_aligned_arrays 1
}
 }
+if [istarget spu-*-*] {
+   set et_vect_aligned_arrays 1
+}
 verbose "check_effective_target_vect_aligned_arrays:\
-returning $et_vect_aligned_arrays_saved($et_index)" 2
-return $et_vect_aligned_arrays_saved($et_index)
+returning $et_vect_aligned_arrays" 2
+return $et_vect_aligned_arrays
 }
 
 # Return 1 if types of size 32 bit or less are naturally aligned
@@ -5382,74 +5372,43 @@ proc check_effective_target_natural_alignment_64 { } {
 
 # Return 1 if all vector types are naturally aligned (aligned to their
 # type-size), 0 otherwise.
-#
-# This won't change for different subtargets so cache the result.
 
 proc check_effective_target_vect_natural_alignment { } {
-global et_vect_natural_alignment_saved
-global et_index
-
-if [info exists et_vect_natural_alignment_saved($et_index)] {
-verbose "check_effective_target_vect_natural_alignment: using cached 
result" 2
-} else {
-   set et_vect_natural_alignment_saved($et_index) 1
-if { [check_effective_target_arm_eabi]
-|| [istarget nvptx-*-*]
-|| [istarget s390*-*-*] } {
-   set et_vect_natural_alignment_saved($et_index) 0
-}
+set et_vect_natural_alignment 1
+if { [check_effective_target_arm_eabi]
+|| [istarget nvptx-*-*]
+|| [istarget s390*-*-*] } {
+   set et_vect_natural_alignment 0
 }
 verbose "check_effective_target_vect_natural_alignment:\
-returning $et_vect_natural_alignment_saved($et_index)" 2
-return $et_vect_natural_alignment_saved($et_index)
+returning $et_vect_natural_alignment" 2
+return $et_vect_natural_alignment
 }
 
 # 

Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-08-15 Thread Trevor Saunders
On Tue, Jul 26, 2016 at 01:51:33PM +, Robert Suchanek wrote:
> Hi,
> 
> > On May 5, 2016, at 8:14 AM, Robert Suchanek  
> > wrote:
> > >
> > > I'm resending this patch as it has been rebased and updated.  I reverted a
> > change
> > > to check_effective_target_vect_call_lrint procedure because it does not 
> > > use
> > > cached result.
> > 
> > Ok.
> > 
> > Please ensure that the compilation flag is mixed into the test case name so
> > that as you iterate over them, the test case names are unique.
> 
> An effective target is likely to have a unique flag to enable a given set of
> SIMD operations and this is mixed into test case names.
> 
> I double-checked this with mips-mti-linux-gnu where auto-vectorization tests
> can be run twice i.e. for -mmsa and -mpaired-single.
> 
> The patch was rebased once again and tested on x86_64-unknown-linux-gnu.
> 
> Committed as r238755.

unfortunately this broke make check-c
RUNTESTFLAGS='vect.exp=*no-vfa-vect-dv-2.c
--target_board=unix\{-m32,-m64\}', causing the check if
vect_aligned_arrays to be cached between the -m64 and -m32 variants
which is incorrect at least on my machine if you actually run that test
for -m32 and -m64 you get different results.  In both case et_index is 0
so you use the cached value the second time, but that's not correct
because the options changed.

I suspect this also causes some random vectorizer tests to appear and
disappear during regression testing with the same -m64 and -m32, but I'm
not absolutely sure of that part.

Thanks!

Trev

> 
> Thanks and regards,
> Robert
> 


RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-07-26 Thread Robert Suchanek
Hi,

> On May 5, 2016, at 8:14 AM, Robert Suchanek  
> wrote:
> >
> > I'm resending this patch as it has been rebased and updated.  I reverted a
> change
> > to check_effective_target_vect_call_lrint procedure because it does not use
> > cached result.
> 
> Ok.
> 
> Please ensure that the compilation flag is mixed into the test case name so
> that as you iterate over them, the test case names are unique.

An effective target is likely to have a unique flag to enable a given set of
SIMD operations and this is mixed into test case names.

I double-checked this with mips-mti-linux-gnu where auto-vectorization tests
can be run twice i.e. for -mmsa and -mpaired-single.

The patch was rebased once again and tested on x86_64-unknown-linux-gnu.

Committed as r238755.

Thanks and regards,
Robert



Re: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-06-30 Thread Mike Stump
On May 5, 2016, at 8:14 AM, Robert Suchanek  wrote:
> 
> I'm resending this patch as it has been rebased and updated.  I reverted a 
> change
> to check_effective_target_vect_call_lrint procedure because it does not use
> cached result.

Ok.

Please ensure that the compilation flag is mixed into the test case name so 
that as you iterate over them, the test case names are unique.

RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-06-29 Thread Richard Biener
On Wed, 29 Jun 2016, Matthew Fortune wrote:

> Robert Suchanek  writes:
> > I'm resending this patch as it has been rebased and updated.  I reverted a 
> > change
> > to check_effective_target_vect_call_lrint procedure because it does not use
> > cached result.
> 
> Hi Richard,
> 
> Do you know who might be best to ask for a review for this vect.exp testsuite
> change? 

Mike may be - you need a TCL speaking reviewer ;)

Richard.

> Thanks,
> Matthew
> 
> > 
> > Regards,
> > Robert
> > 
> > > -Original Message-
> > > From: gcc-patches-ow...@gcc.gnu.org 
> > > [mailto:gcc-patches-ow...@gcc.gnu.org] On
> > > Behalf Of Robert Suchanek
> > > Sent: 10 August 2015 13:15
> > > To: catherine_mo...@mentor.com; Matthew Fortune
> > > Cc: gcc-patches@gcc.gnu.org
> > > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for 
> > > multiple
> > > effective targets
> > >
> > > Hi,
> > >
> > > This patch allows to run auto-vectorization tests for more than one 
> > > effective
> > > target.  The initial proposal
> > >
> > > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> > >
> > > had some issues that have been addressed and should work as expected now.
> > >
> > > The idea was to add a wrapper procedure that would:
> > > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa, 
> > > mpaired_single.
> > > 2. Add necessary compile time options for each effective target.
> > > 3. Check if it's possible to compile and/or run on a target, and set
> > >dg-do-what-default accordingly.
> > > 4. Set the target index to tell check_effective_target_vect_* which 
> > > target is
> > >currently being processed.
> > > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as 
> > > normal.
> > >
> > > The above required that every vector feature e.g. vect_int that caches the
> > > result is
> > > capable of tracking what target supports a feature.  The result is saved 
> > > to a
> > > list
> > > at an index controlled by the wrapper (et-dg-runtest).  Ports not using 
> > > this
> > > feature,
> > > set DEFAULT_VECTFLAGS and the tests should run as they used to.
> > >
> > > The patch was additionally tested on x86_64-unknown-linux-gnu and aarch64-
> > > linux-gnu.
> > >
> > > Regards,
> > > Robert
> > >
> > > gcc/testsuite/ChangeLog:
> > >
> > >   * g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
> > >   g++-dg-runtest via et-dg-runtest.
> > >   * gcc.dg/graphite/graphite.exp: Likewise, but for dg-runtest.
> > >   * gcc.dg/vect/vect.exp: Likewise.
> > >   * gfortran.dg/graphite/graphite.exp: Likewise, but for
> > >   gfortran-dg-runtest.
> > >   * gfortran.dg/vect/vect.exp: Likewise.
> > >   * lib/target-supports.exp (check_mpaired_single_hw_available): New.
> > >   (check_mips_loongson_hw_available): Likewise.
> > >   (check_effective_target_mpaired_single_runtime): Likewise.
> > >   (check_effective_target_mips_loongson_runtime): Likewise.
> > >   (add_options_for_mpaired_single): Likewise.
> > >   (check_effective_target_vect_int): Add global et_index.
> > >   Check and save the supported feature for a target selected by
> > >   the et_index target.  Break long lines where appropriate.  Call
> > >   et-is-effective-target for MIPS with an argument instead of
> > >   check_effective_target_* where appropriate.
> > >   (check_effective_target_vect_intfloat_cvt): Likewise.
> > >   (check_effective_target_vect_uintfloat_cvt): Likewise.
> > >   (check_effective_target_vect_floatint_cvt): Likewise.
> > >   (check_effective_target_vect_floatuint_cvt): Likewise.
> > >   (check_effective_target_vect_simd_clones): Likewise.
> > >   (check_effective_target_vect_shift): ewise.
> > >   (check_effective_target_whole_vector_shift): Likewise.
> > >   (check_effective_target_vect_bswap): Likewise.
> > >   (check_effective_target_vect_shift_char): Likewise.
> > >   (check_effective_target_vect_long): Likewise.
> > >   (check_effective_target_vect_float): Likewise.
> > >   (check_effective_target_vect_double): Likewise.
> > >   (check_effective_target_vect_long_long): Likewise.
> > >   (check_effective_target_vect_no_int_max): Likewise.
> > >   (check_effective_target_vect_no_int_add): Likewise.
> > >   (check_effective_target_vect_no_bitwise): Likewise.
> > >   (check_effective_target_vect_widen_shift): Likewise.
> > >   (check_effective_target_vect_no_align): Likewise.
> > >   (check_effective_target_vect_hw_misalign): Likewise.
> > >   (check_effective_target_vect_element_align): Likewise.
> > >   (check_effective_target_vect_condition): Likewise.
> > >   (check_effective_target_vect_cond_mixed): Likewise.
> > >   (check_effective_target_vect_char_mult): Likewise.
> > >   (check_effective_target_vect_short_mult): Likewise.
> > >   (check_effective_target_vect_int_mult): Likewise.
> > >   (check_effective_target_vect_extract_even_odd): Likewise.
> > >   (check_effective_target_vect_interleave): Likewise.
> > >   

RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-06-29 Thread Matthew Fortune
Robert Suchanek  writes:
> I'm resending this patch as it has been rebased and updated.  I reverted a 
> change
> to check_effective_target_vect_call_lrint procedure because it does not use
> cached result.

Hi Richard,

Do you know who might be best to ask for a review for this vect.exp testsuite
change? 

Thanks,
Matthew

> 
> Regards,
> Robert
> 
> > -Original Message-
> > From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-ow...@gcc.gnu.org] 
> > On
> > Behalf Of Robert Suchanek
> > Sent: 10 August 2015 13:15
> > To: catherine_mo...@mentor.com; Matthew Fortune
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for 
> > multiple
> > effective targets
> >
> > Hi,
> >
> > This patch allows to run auto-vectorization tests for more than one 
> > effective
> > target.  The initial proposal
> >
> > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> >
> > had some issues that have been addressed and should work as expected now.
> >
> > The idea was to add a wrapper procedure that would:
> > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa, mpaired_single.
> > 2. Add necessary compile time options for each effective target.
> > 3. Check if it's possible to compile and/or run on a target, and set
> >dg-do-what-default accordingly.
> > 4. Set the target index to tell check_effective_target_vect_* which target 
> > is
> >currently being processed.
> > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as 
> > normal.
> >
> > The above required that every vector feature e.g. vect_int that caches the
> > result is
> > capable of tracking what target supports a feature.  The result is saved to 
> > a
> > list
> > at an index controlled by the wrapper (et-dg-runtest).  Ports not using this
> > feature,
> > set DEFAULT_VECTFLAGS and the tests should run as they used to.
> >
> > The patch was additionally tested on x86_64-unknown-linux-gnu and aarch64-
> > linux-gnu.
> >
> > Regards,
> > Robert
> >
> > gcc/testsuite/ChangeLog:
> >
> > * g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
> > g++-dg-runtest via et-dg-runtest.
> > * gcc.dg/graphite/graphite.exp: Likewise, but for dg-runtest.
> > * gcc.dg/vect/vect.exp: Likewise.
> > * gfortran.dg/graphite/graphite.exp: Likewise, but for
> > gfortran-dg-runtest.
> > * gfortran.dg/vect/vect.exp: Likewise.
> > * lib/target-supports.exp (check_mpaired_single_hw_available): New.
> > (check_mips_loongson_hw_available): Likewise.
> > (check_effective_target_mpaired_single_runtime): Likewise.
> > (check_effective_target_mips_loongson_runtime): Likewise.
> > (add_options_for_mpaired_single): Likewise.
> > (check_effective_target_vect_int): Add global et_index.
> > Check and save the supported feature for a target selected by
> > the et_index target.  Break long lines where appropriate.  Call
> > et-is-effective-target for MIPS with an argument instead of
> > check_effective_target_* where appropriate.
> > (check_effective_target_vect_intfloat_cvt): Likewise.
> > (check_effective_target_vect_uintfloat_cvt): Likewise.
> > (check_effective_target_vect_floatint_cvt): Likewise.
> > (check_effective_target_vect_floatuint_cvt): Likewise.
> > (check_effective_target_vect_simd_clones): Likewise.
> > (check_effective_target_vect_shift): ewise.
> > (check_effective_target_whole_vector_shift): Likewise.
> > (check_effective_target_vect_bswap): Likewise.
> > (check_effective_target_vect_shift_char): Likewise.
> > (check_effective_target_vect_long): Likewise.
> > (check_effective_target_vect_float): Likewise.
> > (check_effective_target_vect_double): Likewise.
> > (check_effective_target_vect_long_long): Likewise.
> > (check_effective_target_vect_no_int_max): Likewise.
> > (check_effective_target_vect_no_int_add): Likewise.
> > (check_effective_target_vect_no_bitwise): Likewise.
> > (check_effective_target_vect_widen_shift): Likewise.
> > (check_effective_target_vect_no_align): Likewise.
> > (check_effective_target_vect_hw_misalign): Likewise.
> > (check_effective_target_vect_element_align): Likewise.
> > (check_effective_target_vect_condition): Likewise.
> > (check_effective_target_vect_cond_mixed): Likewise.
> > (check_effective_target_vect_char_mult): Likewise.
> > (check_effective_target_vect_short_mult): Likewise.
> > (check_effective_target_vect_int_mult): Likewise.
> > (check_effective_target_vect_extract_even_odd): Likewise.
> > (check_effective_target_vect_interleave): Likewise.
> > (check_effective_target_vect_stridedN): Likewise.
> > (check_effective_target_vect_multiple_sizes): Likewise.
> > (check_effective_target_vect64): Likewise.
> > (check_effective_target_vect_call_copysignf): Likewise.
> > (check_effective_target_vect_call_sqrtf): 

RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-05-06 Thread Matthew Fortune
Robert Suchanek  writes:
> I'm resending this patch as it has been rebased and updated.  I reverted
> a change to check_effective_target_vect_call_lrint procedure because it
> does not use cached result.

Conceptually I think this is a good idea and to the extent that I can
follow TCL code it looks OK. I can't approve this though so need a global
reviewer to comment.

Thanks,
Matthew

> 
> Regards,
> Robert
> 
> > -Original Message-
> > From: gcc-patches-ow...@gcc.gnu.org
> > [mailto:gcc-patches-ow...@gcc.gnu.org] On Behalf Of Robert Suchanek
> > Sent: 10 August 2015 13:15
> > To: catherine_mo...@mentor.com; Matthew Fortune
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for
> > multiple effective targets
> >
> > Hi,
> >
> > This patch allows to run auto-vectorization tests for more than one
> > effective target.  The initial proposal
> >
> > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> >
> > had some issues that have been addressed and should work as expected
> now.
> >
> > The idea was to add a wrapper procedure that would:
> > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa,
> mpaired_single.
> > 2. Add necessary compile time options for each effective target.
> > 3. Check if it's possible to compile and/or run on a target, and set
> >dg-do-what-default accordingly.
> > 4. Set the target index to tell check_effective_target_vect_* which
> target is
> >currently being processed.
> > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as
> normal.
> >
> > The above required that every vector feature e.g. vect_int that caches
> > the result is capable of tracking what target supports a feature.  The
> > result is saved to a list at an index controlled by the wrapper
> > (et-dg-runtest).  Ports not using this feature, set DEFAULT_VECTFLAGS
> > and the tests should run as they used to.
> >
> > The patch was additionally tested on x86_64-unknown-linux-gnu and
> > aarch64- linux-gnu.
> >
> > Regards,
> > Robert
> >
> > gcc/testsuite/ChangeLog:
> >
> > * g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS.
> Call
> > g++-dg-runtest via et-dg-runtest.
> > * gcc.dg/graphite/graphite.exp: Likewise, but for dg-runtest.
> > * gcc.dg/vect/vect.exp: Likewise.
> > * gfortran.dg/graphite/graphite.exp: Likewise, but for
> > gfortran-dg-runtest.
> > * gfortran.dg/vect/vect.exp: Likewise.
> > * lib/target-supports.exp (check_mpaired_single_hw_available): New.
> > (check_mips_loongson_hw_available): Likewise.
> > (check_effective_target_mpaired_single_runtime): Likewise.
> > (check_effective_target_mips_loongson_runtime): Likewise.
> > (add_options_for_mpaired_single): Likewise.
> > (check_effective_target_vect_int): Add global et_index.
> > Check and save the supported feature for a target selected by
> > the et_index target.  Break long lines where appropriate.  Call
> > et-is-effective-target for MIPS with an argument instead of
> > check_effective_target_* where appropriate.
> > (check_effective_target_vect_intfloat_cvt): Likewise.
> > (check_effective_target_vect_uintfloat_cvt): Likewise.
> > (check_effective_target_vect_floatint_cvt): Likewise.
> > (check_effective_target_vect_floatuint_cvt): Likewise.
> > (check_effective_target_vect_simd_clones): Likewise.
> > (check_effective_target_vect_shift): ewise.
> > (check_effective_target_whole_vector_shift): Likewise.
> > (check_effective_target_vect_bswap): Likewise.
> > (check_effective_target_vect_shift_char): Likewise.
> > (check_effective_target_vect_long): Likewise.
> > (check_effective_target_vect_float): Likewise.
> > (check_effective_target_vect_double): Likewise.
> > (check_effective_target_vect_long_long): Likewise.
> > (check_effective_target_vect_no_int_max): Likewise.
> > (check_effective_target_vect_no_int_add): Likewise.
> > (check_effective_target_vect_no_bitwise): Likewise.
> > (check_effective_target_vect_widen_shift): Likewise.
> > (check_effective_target_vect_no_align): Likewise.
> > (check_effective_target_vect_hw_misalign): Likewise.
> > (check_effective_target_vect_element_align): Likewise.
> > (check_effective_target_vect_condition): Likewise.
> > (check_effective_target_vect_cond_mixed): Likewise.
> > (check_effective_target_vect_char_mult): Likewise.
> > (check_effective_target_vect_short_mult): Likewise.
> > (check_effective_target_vect_int_mult): Likewise.
> > (check_effective_target_vect_extract_even_odd): Likewise.
> > (check_effective_target_vect_interleave): Likewise.
> > (check_effective_target_vect_stridedN): Likewise.
> > (check_effective_target_vect_multiple_sizes): Likewise.
> > (check_effective_target_vect64): Likewise.
> > (check_effective_target_vect_call_copysignf): Likewise.
> > 

RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-01-11 Thread Matthew Fortune
Hi Robert,

Do you have an updated version of this patch? It no longer applies cleanly.

Thanks,
Matthew

> -Original Message-
> From: Robert Suchanek
> Sent: 05 January 2016 16:17
> To: catherine_mo...@mentor.com; Matthew Fortune
> Cc: gcc-patches@gcc.gnu.org
> Subject: RE: [PATCH 3/4] Add support to run auto-vectorization tests for
> multiple effective targets
> 
> Ping.
> 
> > -Original Message-
> > From: gcc-patches-ow...@gcc.gnu.org
> > [mailto:gcc-patches-ow...@gcc.gnu.org] On Behalf Of Robert Suchanek
> > Sent: 10 August 2015 13:15
> > To: catherine_mo...@mentor.com; Matthew Fortune
> > Cc: gcc-patches@gcc.gnu.org
> > Subject: [PATCH 3/4] Add support to run auto-vectorization tests for
> > multiple effective targets
> >
> > Hi,
> >
> > This patch allows to run auto-vectorization tests for more than one
> > effective target.  The initial proposal
> >
> > https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> >
> > had some issues that have been addressed and should work as expected
> now.
> >
> > The idea was to add a wrapper procedure that would:
> > 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa,
> mpaired_single.
> > 2. Add necessary compile time options for each effective target.
> > 3. Check if it's possible to compile and/or run on a target, and set
> >dg-do-what-default accordingly.
> > 4. Set the target index to tell check_effective_target_vect_* which
> target is
> >currently being processed.
> > 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as
> normal.
> >
> > The above required that every vector feature e.g. vect_int that caches
> > the result is capable of tracking what target supports a feature.  The
> > result is saved to a list at an index controlled by the wrapper
> > (et-dg-runtest).  Ports not using this feature, set DEFAULT_VECTFLAGS
> > and the tests should run as they used to.
> >
> > The patch was additionally tested on x86_64-unknown-linux-gnu and
> > aarch64- linux-gnu.
> >
> > Regards,
> > Robert
> >
> > gcc/testsuite/ChangeLog:
> >
> > * g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS.
> Call
> > g++-dg-runtest via et-dg-runtest.
> > * gcc.dg/graphite/graphite.exp: Likewise, but for dg-runtest.
> > * gcc.dg/vect/vect.exp: Likewise.
> > * gfortran.dg/graphite/graphite.exp: Likewise, but for
> > gfortran-dg-runtest.
> > * gfortran.dg/vect/vect.exp: Likewise.
> > * lib/target-supports.exp (check_mpaired_single_hw_available): New.
> > (check_mips_loongson_hw_available): Likewise.
> > (check_effective_target_mpaired_single_runtime): Likewise.
> > (check_effective_target_mips_loongson_runtime): Likewise.
> > (add_options_for_mpaired_single): Likewise.
> > (check_effective_target_vect_int): Add global et_index.
> > Check and save the supported feature for a target selected by
> > the et_index target.  Break long lines where appropriate.  Call
> > et-is-effective-target for MIPS with an argument instead of
> > check_effective_target_* where appropriate.
> > (check_effective_target_vect_intfloat_cvt): Likewise.
> > (check_effective_target_vect_uintfloat_cvt): Likewise.
> > (check_effective_target_vect_floatint_cvt): Likewise.
> > (check_effective_target_vect_floatuint_cvt): Likewise.
> > (check_effective_target_vect_simd_clones): Likewise.
> > (check_effective_target_vect_shift): ewise.
> > (check_effective_target_whole_vector_shift): Likewise.
> > (check_effective_target_vect_bswap): Likewise.
> > (check_effective_target_vect_shift_char): Likewise.
> > (check_effective_target_vect_long): Likewise.
> > (check_effective_target_vect_float): Likewise.
> > (check_effective_target_vect_double): Likewise.
> > (check_effective_target_vect_long_long): Likewise.
> > (check_effective_target_vect_no_int_max): Likewise.
> > (check_effective_target_vect_no_int_add): Likewise.
> > (check_effective_target_vect_no_bitwise): Likewise.
> > (check_effective_target_vect_widen_shift): Likewise.
> > (check_effective_target_vect_no_align): Likewise.
> > (check_effective_target_vect_hw_misalign): Likewise.
> > (check_effective_target_vect_element_align): Likewise.
> > (check_effective_target_vect_condition): Likewise.
> > (check_effective_target_vect_cond_mixed): Likewise.
> > (check_effective_target_vect_char_mult): Likewise.
> >

RE: [PATCH 3/4] Add support to run auto-vectorization tests for multiple effective targets

2016-01-05 Thread Robert Suchanek
Ping.

> -Original Message-
> From: gcc-patches-ow...@gcc.gnu.org [mailto:gcc-patches-ow...@gcc.gnu.org] On
> Behalf Of Robert Suchanek
> Sent: 10 August 2015 13:15
> To: catherine_mo...@mentor.com; Matthew Fortune
> Cc: gcc-patches@gcc.gnu.org
> Subject: [PATCH 3/4] Add support to run auto-vectorization tests for multiple
> effective targets
> 
> Hi,
> 
> This patch allows to run auto-vectorization tests for more than one effective
> target.  The initial proposal
> 
> https://gcc.gnu.org/ml/gcc-patches/2015-01/msg02289.html
> 
> had some issues that have been addressed and should work as expected now.
> 
> The idea was to add a wrapper procedure that would:
> 1. Iterative over a list of EFFECTIVE_TARGETS e.g. mips_msa, mpaired_single.
> 2. Add necessary compile time options for each effective target.
> 3. Check if it's possible to compile and/or run on a target, and set
>dg-do-what-default accordingly.
> 4. Set the target index to tell check_effective_target_vect_* which target is
>currently being processed.
> 5. Invoke {gfortran-,g++-,}dg-runtest with the list of vector tests as normal.
> 
> The above required that every vector feature e.g. vect_int that caches the
> result is
> capable of tracking what target supports a feature.  The result is saved to a
> list
> at an index controlled by the wrapper (et-dg-runtest).  Ports not using this
> feature,
> set DEFAULT_VECTFLAGS and the tests should run as they used to.
> 
> The patch was additionally tested on x86_64-unknown-linux-gnu and aarch64-
> linux-gnu.
> 
> Regards,
> Robert
> 
> gcc/testsuite/ChangeLog:
> 
>   * g++.dg/vect/vect.exp: Add and set new global EFFECTIVE_TARGETS. Call
>   g++-dg-runtest via et-dg-runtest.
>   * gcc.dg/graphite/graphite.exp: Likewise, but for dg-runtest.
>   * gcc.dg/vect/vect.exp: Likewise.
>   * gfortran.dg/graphite/graphite.exp: Likewise, but for
>   gfortran-dg-runtest.
>   * gfortran.dg/vect/vect.exp: Likewise.
>   * lib/target-supports.exp (check_mpaired_single_hw_available): New.
>   (check_mips_loongson_hw_available): Likewise.
>   (check_effective_target_mpaired_single_runtime): Likewise.
>   (check_effective_target_mips_loongson_runtime): Likewise.
>   (add_options_for_mpaired_single): Likewise.
>   (check_effective_target_vect_int): Add global et_index.
>   Check and save the supported feature for a target selected by
>   the et_index target.  Break long lines where appropriate.  Call
>   et-is-effective-target for MIPS with an argument instead of
>   check_effective_target_* where appropriate.
>   (check_effective_target_vect_intfloat_cvt): Likewise.
>   (check_effective_target_vect_uintfloat_cvt): Likewise.
>   (check_effective_target_vect_floatint_cvt): Likewise.
>   (check_effective_target_vect_floatuint_cvt): Likewise.
>   (check_effective_target_vect_simd_clones): Likewise.
>   (check_effective_target_vect_shift): ewise.
>   (check_effective_target_whole_vector_shift): Likewise.
>   (check_effective_target_vect_bswap): Likewise.
>   (check_effective_target_vect_shift_char): Likewise.
>   (check_effective_target_vect_long): Likewise.
>   (check_effective_target_vect_float): Likewise.
>   (check_effective_target_vect_double): Likewise.
>   (check_effective_target_vect_long_long): Likewise.
>   (check_effective_target_vect_no_int_max): Likewise.
>   (check_effective_target_vect_no_int_add): Likewise.
>   (check_effective_target_vect_no_bitwise): Likewise.
>   (check_effective_target_vect_widen_shift): Likewise.
>   (check_effective_target_vect_no_align): Likewise.
>   (check_effective_target_vect_hw_misalign): Likewise.
>   (check_effective_target_vect_element_align): Likewise.
>   (check_effective_target_vect_condition): Likewise.
>   (check_effective_target_vect_cond_mixed): Likewise.
>   (check_effective_target_vect_char_mult): Likewise.
>   (check_effective_target_vect_short_mult): Likewise.
>   (check_effective_target_vect_int_mult): Likewise.
>   (check_effective_target_vect_extract_even_odd): Likewise.
>   (check_effective_target_vect_interleave): Likewise.
>   (check_effective_target_vect_stridedN): Likewise.
>   (check_effective_target_vect_multiple_sizes): Likewise.
>   (check_effective_target_vect64): Likewise.
>   (check_effective_target_vect_call_copysignf): Likewise.
>   (check_effective_target_vect_call_sqrtf): Likewise.
>   (check_effective_target_vect_call_lrint): Likewise.
>   (check_effective_target_vect_call_btrunc): Likewise.
>   (check_effective_target_vect_call_btruncf): Likewise.
>   (check_effective_target_vect_call_ceil): Likewise.
>   (check_effective_target_vect_call_ceilf): Likewise.
>   (check_effective_target_vect_call_floor): Likewise.
>   (check_effective_target_vect_call_floorf): Likewise.
>   (check_effective_target_vect_call_lceil):