Patchwork [testsuite] : Add -mprefer-avx128 to DEFAULT_VECTCFLAGS

login
register
mail settings
Submitter Uros Bizjak
Date May 9, 2011, 4:44 p.m.
Message ID <BANLkTim3=3C785iuNA4q_fBAE7VzKBAxMQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/94823/
State New
Headers show

Comments

Uros Bizjak - May 9, 2011, 4:44 p.m.
Hello!

Vectorizer testsuite assumes 128bit vector widths. AVX breaks this
assumption and that results in various spurious testsuite failures.

Attached patch clears all failures on AVX target.

2011-05-09  Uros Bizjak  <ubizjak@gmail.com>

	* lib/target-supports.exp (check_vect_support_and_set_flags)
	<i?86-*-*, x86_64-*-*>: Add -mprefer-avx128 to DEFAULT_VECTCFLAGS.

Uros.
H.J. Lu - May 9, 2011, 5:54 p.m.
On Mon, May 9, 2011 at 9:44 AM, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> Vectorizer testsuite assumes 128bit vector widths. AVX breaks this
> assumption and that results in various spurious testsuite failures.
>
> Attached patch clears all failures on AVX target.
>
> 2011-05-09  Uros Bizjak  <ubizjak@gmail.com>
>
>        * lib/target-supports.exp (check_vect_support_and_set_flags)
>        <i?86-*-*, x86_64-*-*>: Add -mprefer-avx128 to DEFAULT_VECTCFLAGS.
>
> Uros.
>
> Index: lib/target-supports.exp
> ===================================================================
> --- lib/target-supports.exp     (revision 173569)
> +++ lib/target-supports.exp     (working copy)
> @@ -3845,6 +3845,8 @@
>         set dg-do-what-default run
>     } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
>         lappend DEFAULT_VECTCFLAGS "-msse2"
> +       # FIXME: Vectorizer testsuite assumes 128bit vector widths.
> +       lappend DEFAULT_VECTCFLAGS "-mprefer-avx128"
>         if { [check_effective_target_sse2_runtime] } {
>             set dg-do-what-default run
>         } else {
>

That means 256bit vectorizer won't be tested. I think we
should investigate each testcase and update it if needed.

Thanks.
Joseph S. Myers - May 9, 2011, 6:54 p.m.
On Mon, 9 May 2011, H.J. Lu wrote:

> > Index: lib/target-supports.exp
> > ===================================================================
> > --- lib/target-supports.exp     (revision 173569)
> > +++ lib/target-supports.exp     (working copy)
> > @@ -3845,6 +3845,8 @@
> >         set dg-do-what-default run
> >     } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
> >         lappend DEFAULT_VECTCFLAGS "-msse2"
> > +       # FIXME: Vectorizer testsuite assumes 128bit vector widths.
> > +       lappend DEFAULT_VECTCFLAGS "-mprefer-avx128"
> >         if { [check_effective_target_sse2_runtime] } {
> >             set dg-do-what-default run
> >         } else {
> >
> 
> That means 256bit vectorizer won't be tested. I think we
> should investigate each testcase and update it if needed.

I think we should work out how to get the various vectorizer testsuites to 
run multiple times, with each vector ISA variant that's available on the 
target architecture (so you'd test SSE; 128-bit AVX; 256-bit AVX; and 
maybe other variants - each variant tested with execution testing if 
there's hardware support, compile testing otherwise), like the torture 
testsuites run each test multiple times with different options.  Though 
that certainly complicates all the effective target tests for 
vectorization support, since the results may depend on the options as well 
as the target.
Richard Guenther - May 10, 2011, 8:57 a.m.
On Mon, May 9, 2011 at 8:54 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Mon, 9 May 2011, H.J. Lu wrote:
>
>> > Index: lib/target-supports.exp
>> > ===================================================================
>> > --- lib/target-supports.exp     (revision 173569)
>> > +++ lib/target-supports.exp     (working copy)
>> > @@ -3845,6 +3845,8 @@
>> >         set dg-do-what-default run
>> >     } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
>> >         lappend DEFAULT_VECTCFLAGS "-msse2"
>> > +       # FIXME: Vectorizer testsuite assumes 128bit vector widths.
>> > +       lappend DEFAULT_VECTCFLAGS "-mprefer-avx128"
>> >         if { [check_effective_target_sse2_runtime] } {
>> >             set dg-do-what-default run
>> >         } else {
>> >
>>
>> That means 256bit vectorizer won't be tested. I think we
>> should investigate each testcase and update it if needed.
>
> I think we should work out how to get the various vectorizer testsuites to
> run multiple times, with each vector ISA variant that's available on the
> target architecture (so you'd test SSE; 128-bit AVX; 256-bit AVX; and
> maybe other variants - each variant tested with execution testing if
> there's hardware support, compile testing otherwise), like the torture
> testsuites run each test multiple times with different options.  Though
> that certainly complicates all the effective target tests for
> vectorization support, since the results may depend on the options as well
> as the target.

Indeed - the above change makes testing with -mavx useless, no?  ISTR
there are not many fails with -mavx in the vectorizer testsuite.

Richard.

> --
> Joseph S. Myers
> joseph@codesourcery.com

Patch

Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 173569)
+++ lib/target-supports.exp	(working copy)
@@ -3845,6 +3845,8 @@ 
         set dg-do-what-default run
     } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
         lappend DEFAULT_VECTCFLAGS "-msse2"
+	# FIXME: Vectorizer testsuite assumes 128bit vector widths.
+	lappend DEFAULT_VECTCFLAGS "-mprefer-avx128"
         if { [check_effective_target_sse2_runtime] } {
             set dg-do-what-default run
         } else {