From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26404 invoked by alias); 23 Dec 2014 16:46:48 -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 26377 invoked by uid 89); 23 Dec 2014 16:46:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Dec 2014 16:46:45 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Y3SbZ-0007GG-32 from Andrew_Stubbs@mentor.com ; Tue, 23 Dec 2014 08:46:41 -0800 Received: from [172.30.88.176] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Tue, 23 Dec 2014 16:46:39 +0000 Message-ID: <54999C6B.9040400@codesourcery.com> Date: Tue, 23 Dec 2014 17:32:00 -0000 From: Andrew Stubbs User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: , Kyrill Tkachov CC: James Greenhalgh , Richard Earnshaw , "gcc-patches@gcc.gnu.org" Subject: Re: [arm][patch] fix arm_neon_ok check on !arm_arch7 References: <5414B99D.3020202@codesourcery.com> <5416B580.9070208@arm.com> <5416C5C3.8070603@codesourcery.com> <20140923082716.GA28745@arm.com> <547DC637.5060906@arm.com> <547F2646.7020308@mentor.com> In-Reply-To: <547F2646.7020308@mentor.com> Content-Type: multipart/mixed; boundary="------------070300010109060106070103" X-SW-Source: 2014-12/txt/msg01816.txt.bz2 --------------070300010109060106070103 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1515 On 03/12/14 15:03, Andrew Stubbs wrote: >> 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. > > I'll take a look at those shortly. Or, not so shortly. It seems that, on ARM, the arch/CPU setting is basically orthogonal to the FPU setting, and the compiler doesn't even try to match the one to the other. The assembler does the same. In fact, the testcases that James refers to, that have hard-coded -march options, really do emit armv4 code with Neon, say, although most probably don't have vectorizable code. They only work because they're most likely executed on Neon hardware. This means that there's no obvious patch to fix the issue, in the compiler. It's easy to reject Neon for pre-v7 CPUs, but that has consequences, as we've seen. We'd have to have a table of fall-back FPUs or something, and that doesn't seem straight-forward (and anyway, I'm not sure what values to enter into that table). So, I've attacked the problem from the other end, and updated the compiler check. OK to commit? Andrew --------------070300010109060106070103 Content-Type: text/x-patch; name="arm-neon-ok-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="arm-neon-ok-2.patch" Content-length: 693 2014-12-23 Andrew Stubbs gcc/testsuite/ * lib/target-supports.exp (check_effective_target_arm_neon_ok_nocache): Don't try to test Neon on ARM architures before v7. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (revision 219043) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -2565,6 +2565,9 @@ if { [check_no_compiler_messages_nocache arm_neon_ok object { #include "arm_neon.h" int dummy; + #if __ARM_ARCH < 7 + #error Architecture too old for NEON. + #endif } "$flags"] } { set et_arm_neon_flags $flags return 1 --------------070300010109060106070103--