Message ID | 55CAE8FA.1020504@mentor.com |
---|---|
State | New |
Headers | show |
Tom de Vries <Tom_deVries@mentor.com> writes: > This follow-up patch introduces a new effective target vect_min_max, > similar to how effective target vect_bswap is implemented. > > Any comments? > > Thanks, > - Tom > > Add check_effective_target_vect_min_max > > 2015-08-12 Tom de Vries <tom@codesourcery.com> > > * lib/target-supports.exp (check_effective_target_vect_min_max): New > proc. > * gcc.dg/vect/trapv-vect-reduc-4.c: Use vect_min_max effective target. Looks good to me, but the new effective-target keyword needs documenting in sourcebuild.texi. Rainer
On 12/08/15 10:51, Rainer Orth wrote: > Tom de Vries <Tom_deVries@mentor.com> writes: > >> This follow-up patch introduces a new effective target vect_min_max, >> similar to how effective target vect_bswap is implemented. >> >> Any comments? >> >> Thanks, >> - Tom >> >> Add check_effective_target_vect_min_max >> >> 2015-08-12 Tom de Vries <tom@codesourcery.com> >> >> * lib/target-supports.exp (check_effective_target_vect_min_max): New >> proc. >> * gcc.dg/vect/trapv-vect-reduc-4.c: Use vect_min_max effective target. > > Looks good to me, but the new effective-target keyword needs documenting > in sourcebuild.texi. > Hmm, in sourcebuild.texi I found: ... @item vect_no_int_max Target does not support a vector max instruction on @code{int}. ... That looks related. [ I also found a patch introducing vect_no_uint_max here: https://gcc.gnu.org/ml/gcc-patches/2010-01/msg00152.html. ] I'm not sure where to take it from here. Should I introduce vect_no_int_min, and use that in combination with vect_no_int_max? Thanks, - Tom
Tom de Vries <Tom_deVries@mentor.com> writes: > On 12/08/15 10:51, Rainer Orth wrote: >> Tom de Vries <Tom_deVries@mentor.com> writes: >> >>> This follow-up patch introduces a new effective target vect_min_max, >>> similar to how effective target vect_bswap is implemented. >>> >>> Any comments? >>> >>> Thanks, >>> - Tom >>> >>> Add check_effective_target_vect_min_max >>> >>> 2015-08-12 Tom de Vries <tom@codesourcery.com> >>> >>> * lib/target-supports.exp (check_effective_target_vect_min_max): New >>> proc. >>> * gcc.dg/vect/trapv-vect-reduc-4.c: Use vect_min_max effective target. >> >> Looks good to me, but the new effective-target keyword needs documenting >> in sourcebuild.texi. >> > > Hmm, in sourcebuild.texi I found: > ... > @item vect_no_int_max > Target does not support a vector max instruction on @code{int}. > ... > > That looks related. [ I also found a patch introducing vect_no_uint_max > here: https://gcc.gnu.org/ml/gcc-patches/2010-01/msg00152.html. ] > > I'm not sure where to take it from here. Should I introduce > vect_no_int_min, and use that in combination with vect_no_int_max? I'd say this is something for the vectorizer maintainers to decide. Richi? Rainer
On Wed, 12 Aug 2015, Rainer Orth wrote: > Tom de Vries <Tom_deVries@mentor.com> writes: > > > On 12/08/15 10:51, Rainer Orth wrote: > >> Tom de Vries <Tom_deVries@mentor.com> writes: > >> > >>> This follow-up patch introduces a new effective target vect_min_max, > >>> similar to how effective target vect_bswap is implemented. > >>> > >>> Any comments? > >>> > >>> Thanks, > >>> - Tom > >>> > >>> Add check_effective_target_vect_min_max > >>> > >>> 2015-08-12 Tom de Vries <tom@codesourcery.com> > >>> > >>> * lib/target-supports.exp (check_effective_target_vect_min_max): New > >>> proc. > >>> * gcc.dg/vect/trapv-vect-reduc-4.c: Use vect_min_max effective target. > >> > >> Looks good to me, but the new effective-target keyword needs documenting > >> in sourcebuild.texi. > >> > > > > Hmm, in sourcebuild.texi I found: > > ... > > @item vect_no_int_max > > Target does not support a vector max instruction on @code{int}. > > ... > > > > That looks related. [ I also found a patch introducing vect_no_uint_max > > here: https://gcc.gnu.org/ml/gcc-patches/2010-01/msg00152.html. ] > > > > I'm not sure where to take it from here. Should I introduce > > vect_no_int_min, and use that in combination with vect_no_int_max? > > I'd say this is something for the vectorizer maintainers to decide. Richi? I expect the above is already effectively vect_no_int_min as well (which target would support min but not max...?). So after double-checking that you could rename it to vect_no_int_min_max. Richard.
Add check_effective_target_vect_min_max 2015-08-12 Tom de Vries <tom@codesourcery.com> * lib/target-supports.exp (check_effective_target_vect_min_max): New proc. * gcc.dg/vect/trapv-vect-reduc-4.c: Use vect_min_max effective target. --- gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c | 2 +- gcc/testsuite/lib/target-supports.exp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c b/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c index 8fd353c..1624696 100644 --- a/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c +++ b/gcc/testsuite/gcc.dg/vect/trapv-vect-reduc-4.c @@ -47,4 +47,4 @@ int main (void) } /* { dg-final { scan-tree-dump-times "Detected reduction\\." 2 "vect" } } */ -/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { ! { sparc*-*-* } } } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { vect_min_max } } } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 1988301..c585e5f 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3568,6 +3568,24 @@ proc check_effective_target_vect_bswap { } { return $et_vect_bswap_saved } +# Return 1 if the target supports vector min/max operations. + +proc check_effective_target_vect_min_max { } { + global et_vect_min_max_saved + + if [info exists et_vect_min_max_saved] { + verbose "check_effective_target_vect_min_max: using cached result" 2 + } else { + set et_vect_min_max_saved 1 + if { [istarget sparc*-*-*] } { + set et_vect_min_max_saved 0 + } + } + + verbose "check_effective_target_vect_min_max: returning $et_vect_min_max_saved" 2 + return $et_vect_min_max_saved +} + # Return 1 if the target supports hardware vector shift operation for char. proc check_effective_target_vect_shift_char { } { -- 1.9.1