From patchwork Wed Jul 6 17:33:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janis Johnson X-Patchwork-Id: 103555 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id BCAC6B6F18 for ; Thu, 7 Jul 2011 03:33:29 +1000 (EST) Received: (qmail 19725 invoked by alias); 6 Jul 2011 17:33:26 -0000 Received: (qmail 19715 invoked by uid 22791); 6 Jul 2011 17:33:24 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, TW_MF, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jul 2011 17:33:07 +0000 Received: (qmail 20201 invoked from network); 6 Jul 2011 17:33:06 -0000 Received: from unknown (HELO ?192.168.1.5?) (janisjo@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Jul 2011 17:33:06 -0000 Message-ID: <4E149C66.2070702@codesourcery.com> Date: Wed, 06 Jul 2011 10:33:26 -0700 From: Janis Johnson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 MIME-Version: 1.0 To: Richard Earnshaw CC: "gcc-patches@gcc.gnu.org" , Andrew Stubbs , "bernds@codesourcery.com" , James Greenhalgh Subject: Re: [testsuite] ARM wmul tests: require arm_dsp_multiply References: <4E03B23D.1050808@codesourcery.com> <4E0B27B2.5080302@arm.com> In-Reply-To: <4E0B27B2.5080302@arm.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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. 2011-07-06 Janis Johnson * 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" } } */