From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4464 invoked by alias); 2 Dec 2014 21:45:41 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 4454 invoked by uid 89); 2 Dec 2014 21:45:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f47.google.com Received: from mail-qg0-f47.google.com (HELO mail-qg0-f47.google.com) (209.85.192.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 02 Dec 2014 21:45:39 +0000 Received: by mail-qg0-f47.google.com with SMTP id z60so9871397qgd.20 for ; Tue, 02 Dec 2014 13:45:37 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.229.118.1 with SMTP id t1mr2193851qcq.17.1417556737251; Tue, 02 Dec 2014 13:45:37 -0800 (PST) Received: by 10.140.21.102 with HTTP; Tue, 2 Dec 2014 13:45:37 -0800 (PST) Reply-To: ramrad01@arm.com In-Reply-To: <547DC637.5060906@arm.com> References: <5414B99D.3020202@codesourcery.com> <5416B580.9070208@arm.com> <5416C5C3.8070603@codesourcery.com> <20140923082716.GA28745@arm.com> <547DC637.5060906@arm.com> Date: Tue, 02 Dec 2014 21:45:00 -0000 Message-ID: Subject: Re: [arm][patch] fix arm_neon_ok check on !arm_arch7 From: Ramana Radhakrishnan To: Kyrill Tkachov Cc: James Greenhalgh , Andrew Stubbs , Richard Earnshaw , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00214.txt.bz2 On Tue, Dec 2, 2014 at 2:01 PM, Kyrill Tkachov wrote: > > On 23/09/14 09:27, James Greenhalgh wrote: >> >> On Mon, Sep 15, 2014 at 11:56:03AM +0100, Andrew Stubbs wrote: >>> >>> On 15/09/14 10:46, Richard Earnshaw wrote: >>>> >>>> Hmm, I wonder if arm_override_options should reject neon + (arch < 7). >>> >>> Is this more to your taste? >> >> Is this really such a good idea? It causes carnage throughout the >> testsuite if you have configured with support for Neon and the testcase >> is written with dg-options for a pre-armv7-a -march value. >> >> For example in: >> testsuite/gcc.target/arm/di-longlong64-sync-withhelpers.c >> >> Which forces -march=armv5. >> >> Perhaps you just have to fix the effective-target-ok tests - but then >> we lose swathes of test coverage. > > > This also causes subtle Linux kernel compile failures. > Over there they use make rules where they check if the compiler supports > -march=armv5te and if not use -march=armv4t. > With this patch if the compiler is configured with something like > --with-fpu=neon the test will fail with your error message, > even though the compiler supports -march=armv5te. I've spent some time this evening pondering over your patch. Firstly it appears that the current behaviour is going to cause more breakage than originally expected. If this is to go in we'd have a number of users having to add -mfloat-abi=soft to the command line option to ensure that -march=armv5te works just fine on the files where march=armv5te in the first places. I'm not sure that the original patch is enough. The tools have always allowed us to drop down the arch to march=armv5te along with using -mfpu=neon. We are now changing command line behaviour, so an inform in terms of diagnostics to the user would be useful as it states that we don't really have mfpu=neon generating neon code any more because of this particular case. If we are to do this then the original patch is probably not enough as it then doesn't handle the case of TARGET_VFP3 / TARGET_VFP5 / TARGET_NEON_FP16 / TARGET_FP16 / TARGET_FPU_ARMV8 etc. etc. etc. regards Ramana > > Kyrill > > > >> >> Thanks, >> James >> >>> Andrew >>> >>> P.S. arm_override_options was renamed in 2010. >>> 2014-09-15 Andrew Stubbs >>> >>> * gcc/config/arm/arm.c (arm_option_override): Reject -mfpu=neon >>> when architecture is older than ARMv7. >>> >>> Index: gcc/config/arm/arm.c >>> =================================================================== >>> --- gcc/config/arm/arm.c (revision 215228) >>> +++ gcc/config/arm/arm.c (working copy) >>> @@ -2845,6 +2845,9 @@ >>> arm_fpu_desc = &all_fpus[arm_fpu_index]; >>> + if (TARGET_NEON && !arm_arch7) >>> + error ("target CPU does not support NEON"); >>> + >>> switch (arm_fpu_desc->model) >>> { >>> case ARM_FP_MODEL_VFP: > > >