From patchwork Mon Apr 7 13:46:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 337468 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 001AB140078 for ; Mon, 7 Apr 2014 23:47:02 +1000 (EST) 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=MHsotMfbCfu0OrJwNCj1/C9HZQf7Gw/aKIMiYQEv/JV VMxibGgV4X7oUXvZjQN2HLDGRPh/N7l8Q4IigXmGWes5RAuW4SQmifPusgeRNIpp qrFoW9TbMUB2PvW2WycNdE1mrZrVEFM8SiPsQL5HTlkEyvKn+GfhQ8xroiTZVhmw = 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=I3p75F88b9s0siNrv2Ac6T67Q6Y=; b=TtJjMPQQc7ZhlTBkl iJiFdRyp+xqe/qyRiQrcT3pE63FMoel5SVj71QZ35WAGX3iGngR2FyEw5dUe4ndV oKfFODSWtirLSVIBlbz3HHVfVPfty9rNOxb/5i/RnWl0InARpFbi/2CreOLAiKQb tjIDerKBx1NWufg2Cpz5Wn11sE= Received: (qmail 28773 invoked by alias); 7 Apr 2014 13:46:54 -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 28762 invoked by uid 89); 7 Apr 2014 13:46:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, 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; Mon, 07 Apr 2014 13:46:53 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Mon, 07 Apr 2014 14:46:50 +0100 Received: from [10.1.208.24] ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 7 Apr 2014 14:47:02 +0100 Message-ID: <5342AC47.7030009@arm.com> Date: Mon, 07 Apr 2014 14:46:47 +0100 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: GCC Patches CC: Richard Earnshaw , Marcus Shawcroft Subject: [PATCH][AArch64] Wire up TARGET_SIMD and TARGET_FLOAT properly X-MC-Unique: 114040714465000501 X-IsSubscribed: yes Hi all, Currently if we specify something like -march=armv8-a+nosimd or -mcpu=+nosimd the backend will not use it properly to setup the TARGET_SIMD internal boolean that the backend checks for SIMD availability. In the end, the only effective way of disabling SIMD instructions was to specify -mgeneral-regs-only. This patch fixes the situation by wiring up TARGET_SIMD (and TARGET_FLOAT and TARGET_CRYPTO) to take ito account the relevant AARCH64_ISA_* flags. This is a bug-fix for an issue that exists in 4.8 as well. Patch for that branch coming soon. In the meantime I think this should go in at this stage. Ok for trunk? Thanks, Kyrill 2014-04-04 Kyrylo Tkachov * config/aarch64/aarch64.h (TARGET_CPU_CPP_BUILTINS): Check TARGET_SIMD rather than TARGET_GENERAL_REGS_ONLY. (TARGET_SIMD): Take AARCH64_ISA_SIMD into account. (TARGET_FLOAT): Take AARCH64_ISA_FP into account. (TARGET_CRYPTO): Take TARGET_SIMD into account. diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 7962aa4..2fd6df4 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -32,7 +32,7 @@ else \ builtin_define ("__AARCH64EL__"); \ \ - if (!TARGET_GENERAL_REGS_ONLY) \ + if (TARGET_SIMD) \ builtin_define ("__ARM_NEON"); \ \ switch (aarch64_cmodel) \ @@ -83,9 +83,9 @@ #define WORDS_BIG_ENDIAN (BYTES_BIG_ENDIAN) /* AdvSIMD is supported in the default configuration, unless disabled by - -mgeneral-regs-only. */ -#define TARGET_SIMD !TARGET_GENERAL_REGS_ONLY -#define TARGET_FLOAT !TARGET_GENERAL_REGS_ONLY + -mgeneral-regs-only or by the +nosimd extension. */ +#define TARGET_SIMD (!TARGET_GENERAL_REGS_ONLY && AARCH64_ISA_SIMD) +#define TARGET_FLOAT (!TARGET_GENERAL_REGS_ONLY && AARCH64_ISA_FP) #define UNITS_PER_WORD 8 @@ -185,8 +185,8 @@ extern unsigned long aarch64_isa_flags; extern unsigned long aarch64_tune_flags; #define AARCH64_TUNE_SLOWMUL (aarch64_tune_flags & AARCH64_FL_SLOWMUL) -/* Crypto is an optional feature. */ -#define TARGET_CRYPTO AARCH64_ISA_CRYPTO +/* Crypto is an optional extension to AdvSIMD. */ +#define TARGET_CRYPTO (TARGET_SIMD && AARCH64_ISA_CRYPTO) /* Standard register usage. */