From patchwork Fri Jan 6 11:33:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiong Wang X-Patchwork-Id: 90145 Delivered-To: patch@linaro.org Received: by 10.182.224.138 with SMTP id rc10csp290819obc; Fri, 6 Jan 2017 03:34:08 -0800 (PST) X-Received: by 10.98.213.202 with SMTP id d193mr60675281pfg.14.1483702448811; Fri, 06 Jan 2017 03:34:08 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s3si7394634plj.123.2017.01.06.03.34.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jan 2017 03:34:08 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-445519-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-445519-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-445519-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=sD2DGIf/3o4SXEuqA or6Jtl2Y818kqsHEvleRZ2WICJfjAIw6fgWZn+OhbvVVhcWlZbRydveI4s5uENQT VZchHikCmq5rp4uyiwxnZaQ7/31/rt2uqC42dDeLwkumeqD5p+FfMJCn13vsXyCD hS3dD7hbYQucrJJRfAUiC68tqQ= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=5gHaimzgsYwamK7tCGRTOK9 r/Kw=; b=QkXQttNEMCXrdu8QHBWcCB5PY9/2tE3SOm20aVyPb7lXuC1jPfCSSUD UM9t9MkgOlwL9aLb5UsgAHUod8K+CAAJJ54LasYBzm8JHYscqjZKgHzX8TirKYEu 9KoEjGY1eZYcujrscp5FsB/jGHPQEo/QHn0xomoMZjsORXxuen0o= Received: (qmail 507 invoked by alias); 6 Jan 2017 11:33: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 491 invoked by uid 89); 6 Jan 2017 11:33:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, KAM_LOTSOFHASH, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=authentication, H*M:1b16, treating, mandatory X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Jan 2017 11:33:43 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 791FF1596; Fri, 6 Jan 2017 03:33:41 -0800 (PST) Received: from [10.2.206.198] (e104437-lin.cambridge.arm.com [10.2.206.198]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB4A33F220; Fri, 6 Jan 2017 03:33:40 -0800 (PST) Subject: [Ping~][AArch64] Add commandline support for -march=armv8.3-a To: gcc-patches References: <4cf21d03-0a88-c6fa-df37-59ec4edf1d89@foss.arm.com> Cc: James Greenhalgh , "Richard Earnshaw (lists)" From: Jiong Wang Message-ID: <65fc4e53-a56e-1b16-89ee-871ca08afca0@foss.arm.com> Date: Fri, 6 Jan 2017 11:33:39 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: X-IsSubscribed: yes On 11/11/16 18:22, Jiong Wang wrote: > This patch add command line support for ARMv8.3-A through new architecture: > > -march=armv8.3-a > > ARMv8.3-A implies all default features of ARMv8.2-A and meanwhile it includes > the new pointer authentication extension. > > > gcc/ > 2016-11-08 Jiong Wang > > * config/aarch64/aarch64-arches.def: New entry for "armv8.3-a". > * config/aarch64/aarch64.h (AARCH64_FL_PAUTH, AARCH64_FL_V8_3, > AARCH64_FL_FOR_ARCH8_3, AARCH64_ISA_PAUTH, AARCH64_ISA_V8_3, > TARGET_PAUTH, TARGET_ARMV8_3): New. > * doc/invoke.texi (AArch64 Options): Document "armv8.3-a". Ping ~ As pointer authentication extension is defined to be mandatory extension on ARMv8.3-A and is not optional, I adjusted the patch slightly. This also let GCC treating pointer authentication extension in consistent way with Binutils. OK for trunk? gcc/ 2017-01-06 Jiong Wang * config/aarch64/aarch64-arches.def: New entry for "armv8.3-a". * config/aarch64/aarch64.h (AARCH64_FL_V8_3, AARCH64_FL_FOR_ARCH8_3, AARCH64_ISA_V8_3, TARGET_ARMV8_3): New. * doc/invoke.texi (AArch64 Options): Document "armv8.3-a". diff --git a/gcc/config/aarch64/aarch64-arches.def b/gcc/config/aarch64/aarch64-arches.def index 830a7cf545532c050847a8c915d21bef12152388..ce6f73b3e5853b3d40e07545b9581298c768edca 100644 --- a/gcc/config/aarch64/aarch64-arches.def +++ b/gcc/config/aarch64/aarch64-arches.def @@ -33,5 +33,6 @@ AARCH64_ARCH("armv8-a", generic, 8A, 8, AARCH64_FL_FOR_ARCH8) AARCH64_ARCH("armv8.1-a", generic, 8_1A, 8, AARCH64_FL_FOR_ARCH8_1) AARCH64_ARCH("armv8.2-a", generic, 8_2A, 8, AARCH64_FL_FOR_ARCH8_2) +AARCH64_ARCH("armv8.3-a", generic, 8_3A, 8, AARCH64_FL_FOR_ARCH8_3) #undef AARCH64_ARCH diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h index 584ff5c43afcd1a7918019b09165371bb88bfda1..51916c95a736ade697a823f15d483336651ac99a 100644 --- a/gcc/config/aarch64/aarch64.h +++ b/gcc/config/aarch64/aarch64.h @@ -138,6 +138,8 @@ extern unsigned aarch64_architecture_version; /* ARMv8.2-A architecture extensions. */ #define AARCH64_FL_V8_2 (1 << 8) /* Has ARMv8.2-A features. */ #define AARCH64_FL_F16 (1 << 9) /* Has ARMv8.2-A FP16 extensions. */ +/* ARMv8.3-A architecture extensions. */ +#define AARCH64_FL_V8_3 (1 << 10) /* Has ARMv8.3-A features. */ /* Has FP and SIMD. */ #define AARCH64_FL_FPSIMD (AARCH64_FL_FP | AARCH64_FL_SIMD) @@ -151,6 +153,8 @@ extern unsigned aarch64_architecture_version; (AARCH64_FL_FOR_ARCH8 | AARCH64_FL_LSE | AARCH64_FL_CRC | AARCH64_FL_V8_1) #define AARCH64_FL_FOR_ARCH8_2 \ (AARCH64_FL_FOR_ARCH8_1 | AARCH64_FL_V8_2) +#define AARCH64_FL_FOR_ARCH8_3 \ + (AARCH64_FL_FOR_ARCH8_2 | AARCH64_FL_V8_3) /* Macros to test ISA flags. */ @@ -162,6 +166,7 @@ extern unsigned aarch64_architecture_version; #define AARCH64_ISA_RDMA (aarch64_isa_flags & AARCH64_FL_V8_1) #define AARCH64_ISA_V8_2 (aarch64_isa_flags & AARCH64_FL_V8_2) #define AARCH64_ISA_F16 (aarch64_isa_flags & AARCH64_FL_F16) +#define AARCH64_ISA_V8_3 (aarch64_isa_flags & AARCH64_FL_V8_3) /* Crypto is an optional extension to AdvSIMD. */ #define TARGET_CRYPTO (TARGET_SIMD && AARCH64_ISA_CRYPTO) @@ -176,6 +181,9 @@ extern unsigned aarch64_architecture_version; #define TARGET_FP_F16INST (TARGET_FLOAT && AARCH64_ISA_F16) #define TARGET_SIMD_F16INST (TARGET_SIMD && AARCH64_ISA_F16) +/* ARMv8.3-A features. */ +#define TARGET_ARMV8_3 (AARCH64_ISA_V8_3) + /* Make sure this is always defined so we don't have to check for ifdefs but rather use normal ifs. */ #ifndef TARGET_FIX_ERR_A53_835769_DEFAULT diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 8e2f46617b8e44ccf16941c31029ab5625322867..791718831d7089c44dfadb137f5e93caa9cd05f0 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -13874,7 +13874,10 @@ more feature modifiers. This option has the form @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}. The permissible values for @var{arch} are @samp{armv8-a}, -@samp{armv8.1-a}, @samp{armv8.2-a} or @var{native}. +@samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a} or @var{native}. + +The value @samp{armv8.3-a} implies @samp{armv8.2-a} and enables compiler +support for the ARMv8.3-A architecture extensions. The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler support for the ARMv8.2-A architecture extensions.