* [testsuite] ARM wmul tests: require arm_dsp_multiply @ 2011-06-23 21:40 Janis Johnson 2011-06-29 13:43 ` Richard Earnshaw 0 siblings, 1 reply; 4+ messages in thread From: Janis Johnson @ 2011-06-23 21:40 UTC (permalink / raw) To: gcc-patches; +Cc: Andrew Stubbs, bernds [-- Attachment #1: Type: text/plain, Size: 810 bytes --] Tests wmul-[1234].c and mla-2.c in gcc.target/arm require support that the arm backend identifies as TARGET_DSP_MULTIPLY. The tests all specify a -march option with that support, but it is overridden by multilib flags. This patch adds a new effective target, arm_dsp_multiply, and requires it for those tests instead of having them specify a -march value. This means that the tests will be skipped for older targets and test coverage relies on testing for some newer multilibs. The same effective target is needed for tests smlaltb-1.c, smlaltt-1.c, smlatb-1.c, and smlatt-1.c, but those also need to be renamed so the scans don't pass just because the file name is in the assembly file. OK for trunk, and later for 4.6? (btw, I'm currently testing ARM compile-only tests with 43 sets of multilib flags) [-- Attachment #2: gcc-20110623-2 --] [-- Type: text/plain, Size: 3906 bytes --] 2011-06-23 Janis Johnson <janisjo@codesourcery.com> * lib/target-supports.exp (check_effective_target_arm_dsp_multiply): New. * gcc.target/arm/wmul-1.c: Require arm_dsp_multiply, don't supply -march. * gcc.target/arm/wmul-2.c: Likewise. * gcc.target/arm/wmul-3.c: Likewise. * gcc.target/arm/wmul-4.c: Likewise. * gcc.target/arm/mla-2.c: Likewise. Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 175313) +++ lib/target-supports.exp (working copy) @@ -1902,6 +1902,33 @@ } } +# Return 1 if this is an ARM target that supports DSP multiply with +# current multilib flags. + +proc check_effective_target_arm_dsp_multiply { } { + return [check_no_compiler_messages arm_dsp_multiply assembly { + #if defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_2A__) \ + || defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__) \ + || defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) \ + || defined(__ARM_ARCH_5T__) + # error NOT_SUPPORTED + #elif defined(__thumb__) || defined(__thumb2__) + # if defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_6__) \ + || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6M__) \ + || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ + || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7M__) \ + || defined(__ARM_ARCH_IWMMXT__) || defined(__ARM_ARCH_IWMMXT2__) + # error NOT_SUPPORTED + # endif + #else + # if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_EP9312__) + # error NOT_SUPPORTED + # endif + #endif + int i; + }] +} + # Add the options needed for NEON. We need either -mfloat-abi=softfp # or -mfloat-abi=hard, but if one is already specified by the # multilib, use it. Similarly, if a -mfpu option already enables Index: gcc.target/arm/wmul-1.c =================================================================== --- gcc.target/arm/wmul-1.c (revision 175313) +++ gcc.target/arm/wmul-1.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv6t2" } */ +/* { dg-require-effective-target arm_dsp_multiply } */ +/* { dg-options "-O2" } */ int mac(const short *a, const short *b, int sqr, int *sum) { Index: gcc.target/arm/wmul-2.c =================================================================== --- gcc.target/arm/wmul-2.c (revision 175313) +++ gcc.target/arm/wmul-2.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv6t2" } */ +/* { dg-require-effective-target arm_dsp_multiply } */ +/* { dg-options "-O2" } */ void vec_mpy(int y[], const short x[], short scaler) { Index: gcc.target/arm/wmul-3.c =================================================================== --- gcc.target/arm/wmul-3.c (revision 175313) +++ gcc.target/arm/wmul-3.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv6t2" } */ +/* { dg-require-effective-target arm_dsp_multiply } */ +/* { dg-options "-O2" } */ int mac(const short *a, const short *b, int sqr, int *sum) { Index: gcc.target/arm/wmul-4.c =================================================================== --- gcc.target/arm/wmul-4.c (revision 175313) +++ gcc.target/arm/wmul-4.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv6t2" } */ +/* { dg-require-effective-target arm_dsp_multiply } */ +/* { dg-options "-O2" } */ int mac(const int *a, const int *b, long long sqr, long long *sum) { Index: gcc.target/arm/mla-2.c =================================================================== --- gcc.target/arm/mla-2.c (revision 175313) +++ gcc.target/arm/mla-2.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv7-a" } */ +/* { dg-require-effective-target arm_dsp_multiply } */ +/* { dg-options "-O2" } */ long long foolong (long long x, short *a, short *b) { ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [testsuite] ARM wmul tests: require arm_dsp_multiply 2011-06-23 21:40 [testsuite] ARM wmul tests: require arm_dsp_multiply Janis Johnson @ 2011-06-29 13:43 ` Richard Earnshaw 2011-07-06 17:34 ` Janis Johnson 0 siblings, 1 reply; 4+ messages in thread From: Richard Earnshaw @ 2011-06-29 13:43 UTC (permalink / raw) To: Janis Johnson; +Cc: gcc-patches, Andrew Stubbs, bernds, James Greenhalgh On 23/06/11 22:38, Janis Johnson wrote: > Tests wmul-[1234].c and mla-2.c in gcc.target/arm require support that > the arm backend identifies as TARGET_DSP_MULTIPLY. The tests all > specify a -march option with that support, but it is overridden by > multilib flags. > > This patch adds a new effective target, arm_dsp_multiply, and requires > it for those tests instead of having them specify a -march value. This > means that the tests will be skipped for older targets and test coverage > relies on testing for some newer multilibs. > > The same effective target is needed for tests smlaltb-1.c, smlaltt-1.c, > smlatb-1.c, and smlatt-1.c, but those also need to be renamed so the > scans don't pass just because the file name is in the assembly file. > > OK for trunk, and later for 4.6? > > (btw, I'm currently testing ARM compile-only tests with 43 sets of > multilib flags) > I've recently approved a patch from James Greenhalgh (http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01852.html) that defines __ARM_DSP_MULTIPLY when these features are available. That should simplify your target-supports change and also serve as a check that we aren't erroneously defining that macro. R. > > gcc-20110623-2 > > > 2011-06-23 Janis Johnson <janisjo@codesourcery.com> > > * lib/target-supports.exp (check_effective_target_arm_dsp_multiply): > New. > * gcc.target/arm/wmul-1.c: Require arm_dsp_multiply, don't > supply -march. > * gcc.target/arm/wmul-2.c: Likewise. > * gcc.target/arm/wmul-3.c: Likewise. > * gcc.target/arm/wmul-4.c: Likewise. > * gcc.target/arm/mla-2.c: Likewise. > > Index: lib/target-supports.exp > =================================================================== > --- lib/target-supports.exp (revision 175313) > +++ lib/target-supports.exp (working copy) > @@ -1902,6 +1902,33 @@ > } > } > > +# Return 1 if this is an ARM target that supports DSP multiply with > +# current multilib flags. > + > +proc check_effective_target_arm_dsp_multiply { } { > + return [check_no_compiler_messages arm_dsp_multiply assembly { > + #if defined(__ARM_ARCH_2__) || defined(__ARM_ARCH_2A__) \ > + || defined(__ARM_ARCH_3__) || defined(__ARM_ARCH_3M__) \ > + || defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) \ > + || defined(__ARM_ARCH_5T__) > + # error NOT_SUPPORTED > + #elif defined(__thumb__) || defined(__thumb2__) > + # if defined(__ARM_ARCH_5TE__) || defined(__ARM_ARCH_6__) \ > + || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6M__) \ > + || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ > + || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7M__) \ > + || defined(__ARM_ARCH_IWMMXT__) || defined(__ARM_ARCH_IWMMXT2__) > + # error NOT_SUPPORTED > + # endif > + #else > + # if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_EP9312__) > + # error NOT_SUPPORTED > + # endif > + #endif > + int i; > + }] > +} > + > # Add the options needed for NEON. We need either -mfloat-abi=softfp > # or -mfloat-abi=hard, but if one is already specified by the > # multilib, use it. Similarly, if a -mfpu option already enables > Index: gcc.target/arm/wmul-1.c > =================================================================== > --- gcc.target/arm/wmul-1.c (revision 175313) > +++ gcc.target/arm/wmul-1.c (working copy) > @@ -1,5 +1,6 @@ > /* { dg-do compile } */ > -/* { dg-options "-O2 -march=armv6t2" } */ > +/* { dg-require-effective-target arm_dsp_multiply } */ > +/* { dg-options "-O2" } */ > > int mac(const short *a, const short *b, int sqr, int *sum) > { > Index: gcc.target/arm/wmul-2.c > =================================================================== > --- gcc.target/arm/wmul-2.c (revision 175313) > +++ gcc.target/arm/wmul-2.c (working copy) > @@ -1,5 +1,6 @@ > /* { dg-do compile } */ > -/* { dg-options "-O2 -march=armv6t2" } */ > +/* { dg-require-effective-target arm_dsp_multiply } */ > +/* { dg-options "-O2" } */ > > void vec_mpy(int y[], const short x[], short scaler) > { > Index: gcc.target/arm/wmul-3.c > =================================================================== > --- gcc.target/arm/wmul-3.c (revision 175313) > +++ gcc.target/arm/wmul-3.c (working copy) > @@ -1,5 +1,6 @@ > /* { dg-do compile } */ > -/* { dg-options "-O2 -march=armv6t2" } */ > +/* { dg-require-effective-target arm_dsp_multiply } */ > +/* { dg-options "-O2" } */ > > int mac(const short *a, const short *b, int sqr, int *sum) > { > Index: gcc.target/arm/wmul-4.c > =================================================================== > --- gcc.target/arm/wmul-4.c (revision 175313) > +++ gcc.target/arm/wmul-4.c (working copy) > @@ -1,5 +1,6 @@ > /* { dg-do compile } */ > -/* { dg-options "-O2 -march=armv6t2" } */ > +/* { dg-require-effective-target arm_dsp_multiply } */ > +/* { dg-options "-O2" } */ > > int mac(const int *a, const int *b, long long sqr, long long *sum) > { > Index: gcc.target/arm/mla-2.c > =================================================================== > --- gcc.target/arm/mla-2.c (revision 175313) > +++ gcc.target/arm/mla-2.c (working copy) > @@ -1,5 +1,6 @@ > /* { dg-do compile } */ > -/* { dg-options "-O2 -march=armv7-a" } */ > +/* { dg-require-effective-target arm_dsp_multiply } */ > +/* { dg-options "-O2" } */ > > long long foolong (long long x, short *a, short *b) > { ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [testsuite] ARM wmul tests: require arm_dsp_multiply 2011-06-29 13:43 ` Richard Earnshaw @ 2011-07-06 17:34 ` Janis Johnson 2011-07-07 16:03 ` Richard Earnshaw 0 siblings, 1 reply; 4+ messages in thread From: Janis Johnson @ 2011-07-06 17:34 UTC (permalink / raw) To: Richard Earnshaw; +Cc: gcc-patches, Andrew Stubbs, bernds, James Greenhalgh [-- Attachment #1: Type: text/plain, Size: 1663 bytes --] On 06/29/2011 06:25 AM, Richard Earnshaw wrote: > On 23/06/11 22:38, Janis Johnson wrote: >> Tests wmul-[1234].c and mla-2.c in gcc.target/arm require support that >> the arm backend identifies as TARGET_DSP_MULTIPLY. The tests all >> specify a -march option with that support, but it is overridden by >> multilib flags. >> >> This patch adds a new effective target, arm_dsp_multiply, and requires >> it for those tests instead of having them specify a -march value. This >> means that the tests will be skipped for older targets and test coverage >> relies on testing for some newer multilibs. >> >> The same effective target is needed for tests smlaltb-1.c, smlaltt-1.c, >> smlatb-1.c, and smlatt-1.c, but those also need to be renamed so the >> scans don't pass just because the file name is in the assembly file. >> >> OK for trunk, and later for 4.6? >> >> (btw, I'm currently testing ARM compile-only tests with 43 sets of >> multilib flags) >> > > I've recently approved a patch from James Greenhalgh > (http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01852.html) that defines > __ARM_DSP_MULTIPLY when these features are available. That should > simplify your target-supports change and also serve as a check that we > aren't erroneously defining that macro. > > R. This version uses the new macro from James Greenhalgh, making the effective-target check trivial. The patch removes -march options from the tests, and adds a tab to the scans in smla*.c so the scan won't match the file name; there are other arm tests that use tab in the search target. OK for trunk, and later for 4.6? Putting this patch on 4.6 requires the new macro there as well. [-- Attachment #2: gcc-20110706-1 --] [-- Type: text/plain, Size: 5465 bytes --] 2011-07-06 Janis Johnson <janisjo@codesourcery.com> * lib/target-supports.exp (check_effective_target_arm_dsp): New. * gcc.target/arm/mla-2.c: Use it instead of specific -march. * gcc.target/arm/wmul-1.c: Likewise. * gcc.target/arm/wmul-2.c: Likewise. * gcc.target/arm/wmul-3.c: Likewise. * gcc.target/arm/wmul-4.c: Likewise. * gcc.target/arm/smlaltb-1.c: Require arm_dsp, don't specify -march, add tab after scan target. * gcc.target/arm/smlaltt-1.c: Likewise. * gcc.target/arm/smlatb-1.c: Likewise. * gcc.target/arm/smlatt-1.c: Likewise. Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 175921) +++ lib/target-supports.exp (working copy) @@ -1911,6 +1911,18 @@ } } +# Return 1 if this is an ARM target that supports DSP multiply with +# current multilib flags. + +proc check_effective_target_arm_dsp { } { + return [check_no_compiler_messages arm_dsp assembly { + #ifndef __ARM_FEATURE_DSP + #error not DSP + #endif + int i; + }] +} + # Add the options needed for NEON. We need either -mfloat-abi=softfp # or -mfloat-abi=hard, but if one is already specified by the # multilib, use it. Similarly, if a -mfpu option already enables Index: gcc.target/arm/mla-2.c =================================================================== --- gcc.target/arm/mla-2.c (revision 175921) +++ gcc.target/arm/mla-2.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv7-a" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ long long foolong (long long x, short *a, short *b) { Index: gcc.target/arm/wmul-1.c =================================================================== --- gcc.target/arm/wmul-1.c (revision 175921) +++ gcc.target/arm/wmul-1.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv6t2" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ int mac(const short *a, const short *b, int sqr, int *sum) { Index: gcc.target/arm/wmul-2.c =================================================================== --- gcc.target/arm/wmul-2.c (revision 175921) +++ gcc.target/arm/wmul-2.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv6t2" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ void vec_mpy(int y[], const short x[], short scaler) { Index: gcc.target/arm/wmul-3.c =================================================================== --- gcc.target/arm/wmul-3.c (revision 175921) +++ gcc.target/arm/wmul-3.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv6t2" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ int mac(const short *a, const short *b, int sqr, int *sum) { Index: gcc.target/arm/wmul-4.c =================================================================== --- gcc.target/arm/wmul-4.c (revision 175921) +++ gcc.target/arm/wmul-4.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv6t2" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ int mac(const int *a, const int *b, long long sqr, long long *sum) { Index: gcc.target/arm/smlaltb-1.c =================================================================== --- gcc.target/arm/smlaltb-1.c (revision 175921) +++ gcc.target/arm/smlaltb-1.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv7-a" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ long long int foo (long long x, int in) @@ -10,4 +11,4 @@ return x + b * a; } -/* { dg-final { scan-assembler "smlaltb" } } */ +/* { dg-final { scan-assembler "smlaltb\\t" } } */ Index: gcc.target/arm/smlaltt-1.c =================================================================== --- gcc.target/arm/smlaltt-1.c (revision 175921) +++ gcc.target/arm/smlaltt-1.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv7-a" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ long long int foo (long long x, int in1, int in2) @@ -10,4 +11,4 @@ return x + b * a; } -/* { dg-final { scan-assembler "smlaltt" } } */ +/* { dg-final { scan-assembler "smlaltt\\t" } } */ Index: gcc.target/arm/smlatb-1.c =================================================================== --- gcc.target/arm/smlatb-1.c (revision 175921) +++ gcc.target/arm/smlatb-1.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv7-a" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ int foo (int x, int in) @@ -10,4 +11,4 @@ return x + b * a; } -/* { dg-final { scan-assembler "smlatb" } } */ +/* { dg-final { scan-assembler "smlatb\\t" } } */ Index: gcc.target/arm/smlatt-1.c =================================================================== --- gcc.target/arm/smlatt-1.c (revision 175921) +++ gcc.target/arm/smlatt-1.c (working copy) @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv7-a" } */ +/* { dg-require-effective-target arm_dsp } */ +/* { dg-options "-O2" } */ int foo (int x, int in1, int in2) @@ -10,4 +11,4 @@ return x + b * a; } -/* { dg-final { scan-assembler "smlatt" } } */ +/* { dg-final { scan-assembler "smlatt\\t" } } */ ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [testsuite] ARM wmul tests: require arm_dsp_multiply 2011-07-06 17:34 ` Janis Johnson @ 2011-07-07 16:03 ` Richard Earnshaw 0 siblings, 0 replies; 4+ messages in thread From: Richard Earnshaw @ 2011-07-07 16:03 UTC (permalink / raw) To: Janis Johnson; +Cc: gcc-patches, Andrew Stubbs, bernds, James Greenhalgh On 06/07/11 18:33, Janis Johnson wrote: > On 06/29/2011 06:25 AM, Richard Earnshaw wrote: >> On 23/06/11 22:38, Janis Johnson wrote: >>> Tests wmul-[1234].c and mla-2.c in gcc.target/arm require support that >>> the arm backend identifies as TARGET_DSP_MULTIPLY. The tests all >>> specify a -march option with that support, but it is overridden by >>> multilib flags. >>> >>> This patch adds a new effective target, arm_dsp_multiply, and requires >>> it for those tests instead of having them specify a -march value. This >>> means that the tests will be skipped for older targets and test coverage >>> relies on testing for some newer multilibs. >>> >>> The same effective target is needed for tests smlaltb-1.c, smlaltt-1.c, >>> smlatb-1.c, and smlatt-1.c, but those also need to be renamed so the >>> scans don't pass just because the file name is in the assembly file. >>> >>> OK for trunk, and later for 4.6? >>> >>> (btw, I'm currently testing ARM compile-only tests with 43 sets of >>> multilib flags) >>> >> >> I've recently approved a patch from James Greenhalgh >> (http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01852.html) that defines >> __ARM_DSP_MULTIPLY when these features are available. That should >> simplify your target-supports change and also serve as a check that we >> aren't erroneously defining that macro. >> >> R. > > This version uses the new macro from James Greenhalgh, making the > effective-target check trivial. The patch removes -march options from > the tests, and adds a tab to the scans in smla*.c so the scan won't > match the file name; there are other arm tests that use tab in the > search target. > > OK for trunk, and later for 4.6? Putting this patch on 4.6 requires the > new macro there as well. > > I have no objections if the branch maintainers are happy with this. R. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-07 15:59 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2011-06-23 21:40 [testsuite] ARM wmul tests: require arm_dsp_multiply Janis Johnson 2011-06-29 13:43 ` Richard Earnshaw 2011-07-06 17:34 ` Janis Johnson 2011-07-07 16:03 ` Richard Earnshaw
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).