From patchwork Wed Jan 14 10:42:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 428936 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9DEEE14017F for ; Wed, 14 Jan 2015 21:42:44 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=pZJZhbmX/RNJImairNTWo675FRrer29kg1ueazp/Kvt mLRbNGVv716fgh+2Xheiq1tou+pNZZKChjLB41I/Nln2DB0+ctDkc03cfck0Y8Zm feRxH6ZmkSx3ZuEqhIzhY28I2WfX17thjSkV/IfWyY8y8IFSYvCiDsO7oUcbxjq4 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=wA1ueR1d06bM/R7aBzYytAYGLMQ=; b=Eyvd70KZf3kJiJVou s/SEOEl1tqyg/XDzHLBECeXRQn1zmsphOeIhkivdEWdv/F0cC9XsFTcLk8Q/szhu GkYfERnZ7gwb3PV7rkXrV4skBK8uLlU1JmlGNybyM4o1hx1VNdpe7UFYTtZmwiBN d5aJraVyEGCW16yGH77sJzbN3g= Received: (qmail 14874 invoked by alias); 14 Jan 2015 10:42:37 -0000 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 Received: (qmail 14855 invoked by uid 89); 14 Jan 2015 10:42:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Jan 2015 10:42:34 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Wed, 14 Jan 2015 10:42:31 +0000 Received: from [10.1.207.43] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 14 Jan 2015 10:42:30 +0000 Message-ID: <54B64816.9030705@arm.com> Date: Wed, 14 Jan 2015 10:42:30 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: GCC Patches CC: Marcus Shawcroft , Richard Earnshaw Subject: [PATCH][AArch64] Error out of arm_neon.h if nofp/nosimd X-MC-Unique: 115011410423107701 X-IsSubscribed: yes Hi all, In the arm version of arm_neon.h we error out early if the user tries to use that header without NEON. In aarch64 AdvancedSIMD is available by default unless the user explicitly disables it. Still it would be more helpful if we could just error out gracefully instead of dumping a long stream of type errors and other black magic in case the user disables AdvancedSIMD explicitly. So, similar to arm_neon.h in the arm port we error out in aarch64 as well. Checked that all arm_neon.h-related tests work as before. Ok for trunk? Thanks, Kyrill 2015-01-14 Kyrylo Tkachov * config/aarch64/arm_neon.h: Error out if NEON is not available. 2015-01-14 Kyrylo Tkachov * gcc.target/aarch64/arm_neon-nosimd-error.c: New test. commit 3c3d56e01ec55f8387bf447e57cdc7f94b0e119b Author: Kyrylo Tkachov Date: Thu Dec 11 15:09:56 2014 +0000 [AArch64] Error out of arm_neon.h if nofp/nosimd diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 319cd8c..22dfb0b 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -27,6 +27,10 @@ #ifndef _AARCH64_NEON_H_ #define _AARCH64_NEON_H_ +#ifndef __ARM_NEON +#error You must enable AdvancedSIMD instructions to use arm_neon.h +#else + #include #define __AARCH64_UINT64_C(__C) ((uint64_t) __C) @@ -25209,3 +25213,5 @@ __INTERLEAVE_LIST (zip) #undef __aarch64_vdupq_laneq_u64 #endif + +#endif diff --git a/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c b/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c new file mode 100644 index 0000000..6c508ec --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/arm_neon-nosimd-error.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-mgeneral-regs-only" } */ +/* { dg-excess-errors "You must enable" } */ + +#include "arm_neon.h" + +int +foo () +{ + return 0; +}