From patchwork Mon Jan 8 17:55:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 856995 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-470450-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="nJAN1Vzq"; dkim-atps=neutral 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 3zFjcC5cKjz9s7v for ; Tue, 9 Jan 2018 04:55:39 +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=ByKAvQaypJJIIX2tcZtflUieZ5hG3v3iitkR9hBp7n8 0EYsakhk0q7JDMQKE6pjMdjycORWpLucMDY6IQ1sZhvfZblmvd0k/rKsRwJnQXP/ Tim4TBgNwnrGI8Gflm7o517wiVsr/z5EQtO03AuiCLcYfmm8jz93NhxvCCUvHWjY = 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=/O6xvRUuV/YJGHB3acf9tug+E5c=; b=nJAN1VzqCut5lzxY0 oAtKyiH18ojj877PEl2GNyejKRYph5N3v+XI8L7gg4yObdmXLs4haP32BxIjuF6L dAgWWm+CUDGlUbUp355kaeyRjCMTFelDnpmkk1mGPymuoONzTpnfK/r8+niTHOoT CTrbMWFofb9xfKGXSFoqjVkVt8= Received: (qmail 117461 invoked by alias); 8 Jan 2018 17:55:32 -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 117448 invoked by uid 89); 8 Jan 2018 17:55:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_LOTSOFHASH, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 08 Jan 2018 17:55:29 +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 7E67A80D; Mon, 8 Jan 2018 09:55:28 -0800 (PST) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 09BC43F487; Mon, 8 Jan 2018 09:55:27 -0800 (PST) Message-ID: <5A53B08E.6030702@foss.arm.com> Date: Mon, 08 Jan 2018 17:55:26 +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@gcc.gnu.org" CC: Christophe Lyon Subject: [PATCH][arm][1/3] Add -march=armv8.4-a option [resending due to mailer problems...] Hi all, This patch adds support for the Armv8.4-A architecture [1] in the arm backend. This is done through the new -march=armv8.4-a option. With this patch armv8.4-a is recognised as an argument and supports the extensions: simd, fp16, crypto, nocrypto, nofp with the familiar meaning of these options. Worth noting that there is no dotprod option like in armv8.2-a and armv8.3-a because Dot Product support is mandatory in Armv8.4-A when simd is available, so when using +simd (of fp16 which enables +simd), the +dotprod is implied. The various multilib selection makefile fragments are updated too and the mutlilib.exp test gets a few armv8.4-a combination tests. Bootstrapped and tested on arm-none-linux-gnueabihf. Christophe: Can I ask you for a huge favour to give these 3 patches a run through your testing infrastructure if you get the chance? The changes should be fairly self-contained (i.e. touching only -march=armv8.4-a support) but I've gotten various edge cases with testsuite setup wrong in the past... Thanks, Kyrill [1] https://community.arm.com/processors/b/blog/posts/introducing-2017s-extensions-to-the-arm-architecture 2017-01-08 Kyrylo Tkachov * config/arm/arm-cpus.in (armv8_4): New feature. (ARMv8_4a): New fgroup. (armv8.4-a): New arch. * config/arm/arm-tables.opt: Regenerate. * config/arm/t-aprofile: Add matching rules for -march=armv8.4-a. * config/arm/t-arm-elf (all_v8_archs): Add armv8.4-a. * config/arm/t-multilib (v8_4_a_simd_variants): New variable. Add matching rules for -march=armv8.4-a and extensions. * doc/invoke.texi (ARM Options): Document -march=armv8.4-a. 2017-01-08 Kyrylo Tkachov * gcc.target/arm/multilib.exp: Add some -march=armv8.4-a combination tests. diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index 281ec162db8c982128462d8efac2be1d21959cf7..0967b9d2277a0d211452b7cd4d579db1774f29b3 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -120,6 +120,9 @@ define feature armv8_2 # Architecture rel 8.3. define feature armv8_3 +# Architecture rel 8.4. +define feature armv8_4 + # M-Profile security extensions. define feature cmse @@ -242,6 +245,7 @@ define fgroup ARMv8a ARMv7ve armv8 define fgroup ARMv8_1a ARMv8a crc32 armv8_1 define fgroup ARMv8_2a ARMv8_1a armv8_2 define fgroup ARMv8_3a ARMv8_2a armv8_3 +define fgroup ARMv8_4a ARMv8_3a armv8_4 define fgroup ARMv8m_base ARMv6m armv8 cmse tdiv define fgroup ARMv8m_main ARMv7m armv8 cmse define fgroup ARMv8r ARMv8a @@ -597,6 +601,19 @@ begin arch armv8.3-a option dotprod add FP_ARMv8 DOTPROD end arch armv8.3-a +begin arch armv8.4-a + tune for cortex-a53 + tune flags CO_PROC + base 8A + profile A + isa ARMv8_4a + option simd add FP_ARMv8 DOTPROD + option fp16 add fp16 FP_ARMv8 DOTPROD + option crypto add FP_ARMv8 CRYPTO DOTPROD + option nocrypto remove ALL_CRYPTO + option nofp remove ALL_FP +end arch armv8.4-a + begin arch armv8-m.base tune for cortex-m23 base 8M_BASE diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt index f7937256cd79296ba33d109232bcf0d6f7b03917..b8ebec668b1404fd3f9a71dd1f0d48d1261bcf53 100644 --- a/gcc/config/arm/arm-tables.opt +++ b/gcc/config/arm/arm-tables.opt @@ -455,19 +455,22 @@ EnumValue Enum(arm_arch) String(armv8.3-a) Value(29) EnumValue -Enum(arm_arch) String(armv8-m.base) Value(30) +Enum(arm_arch) String(armv8.4-a) Value(30) EnumValue -Enum(arm_arch) String(armv8-m.main) Value(31) +Enum(arm_arch) String(armv8-m.base) Value(31) EnumValue -Enum(arm_arch) String(armv8-r) Value(32) +Enum(arm_arch) String(armv8-m.main) Value(32) EnumValue -Enum(arm_arch) String(iwmmxt) Value(33) +Enum(arm_arch) String(armv8-r) Value(33) EnumValue -Enum(arm_arch) String(iwmmxt2) Value(34) +Enum(arm_arch) String(iwmmxt) Value(34) + +EnumValue +Enum(arm_arch) String(iwmmxt2) Value(35) Enum Name(arm_fpu) Type(enum fpu_type) diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile index a4bf04794e71381256e1489cdad71e966306477f..167a49d16e468be3c222a50abec57b6a68bc561e 100644 --- a/gcc/config/arm/t-aprofile +++ b/gcc/config/arm/t-aprofile @@ -96,6 +96,13 @@ MULTILIB_MATCHES += $(foreach ARCH, $(v8_2_a_simd_variants), \ march?armv8-a+simd=march?armv8.2-a$(ARCH) \ march?armv8-a+simd=march?armv8.3-a$(ARCH)) +# Baseline v8.4-a: map down to baseline v8-a +MULTILIB_MATCHES += march?armv8-a=march?armv8.4-a + +# Map all v8.4-a SIMD variants to v8-a+simd +MULTILIB_MATCHES += $(foreach ARCH, $(v8_4_a_simd_variants), \ + march?armv8-a+simd=march?armv8.4-a$(ARCH)) + # Use Thumb libraries for everything. MULTILIB_REUSE += mthumb/march.armv7-a/mfloat-abi.soft=marm/march.armv7-a/mfloat-abi.soft diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf index a15fb2df12f7b0d637976f3912432740ecd104bd..3e721ec789806335c6097d4088642150abf1003a 100644 --- a/gcc/config/arm/t-arm-elf +++ b/gcc/config/arm/t-arm-elf @@ -46,7 +46,7 @@ all_early_arch := armv5e armv5tej armv6 armv6j armv6k armv6z armv6kz \ all_v7_a_r := armv7-a armv7ve armv7-r -all_v8_archs := armv8-a armv8-a+crc armv8.1-a armv8.2-a armv8.3-a +all_v8_archs := armv8-a armv8-a+crc armv8.1-a armv8.2-a armv8.3-a armv8.4-a # No floating point variants, require thumb1 softfp all_nofp_t := armv6-m armv6s-m armv8-m.base diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib index cc8caa45e118890c5dbe4adbd1a83b8c856ab22e..26b8ae15da74b275e5617b3054572d2a7e8cfe49 100644 --- a/gcc/config/arm/t-multilib +++ b/gcc/config/arm/t-multilib @@ -69,7 +69,7 @@ v8_a_nosimd_variants := +crc v8_a_simd_variants := $(call all_feat_combs, simd crypto) v8_1_a_simd_variants := $(call all_feat_combs, simd crypto) v8_2_a_simd_variants := $(call all_feat_combs, simd fp16 crypto dotprod) - +v8_4_a_simd_variants := $(call all_feat_combs, simd fp16 crypto) ifneq (,$(HAS_APROFILE)) include $(srcdir)/config/arm/t-aprofile @@ -147,6 +147,13 @@ MULTILIB_MATCHES += $(foreach ARCH, $(v8_2_a_simd_variants), \ march?armv7+fp=march?armv8.2-a$(ARCH) \ march?armv7+fp=march?armv8.3-a$(ARCH)) +# Baseline v8.4-a: map down to baseline v8-a +MULTILIB_MATCHES += march?armv7=march?armv8.4-a + +# Map all v8.4-a SIMD variants +MULTILIB_MATCHES += $(foreach ARCH, $(v8_4_a_simd_variants), \ + march?armv7+fp=march?armv8.4-a$(ARCH)) + # Use Thumb libraries for everything. MULTILIB_REUSE += mthumb/march.armv7/mfloat-abi.soft=marm/march.armv7/mfloat-abi.soft diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 283eab82d0533f427bb1821d1e29341f367ae690..9c2388aae2b813c675bf4b697cfd80e79cbfdb78 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -15655,6 +15655,7 @@ Permissible names are: @samp{armv6z}, @samp{armv6zk}, @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a}, +@samp{armv8.4-a}, @samp{armv7-r}, @samp{armv8-r}, @samp{armv6-m}, @samp{armv6s-m}, @@ -15876,6 +15877,28 @@ Disable the cryptographic extension. Disable the floating-point, Advanced SIMD and cryptographic instructions. @end table +@item armv8.4-a +@table @samp +@item +fp16 +The half-precision floating-point data processing instructions. +This also enables the Advanced SIMD and floating-point instructions as well +as the Dot Product extension. + +@item +simd +The ARMv8.3-A Advanced SIMD and floating-point instructions as well as the +Dot Product extension. + +@item +crypto +The cryptographic instructions. This also enables the Advanced SIMD and +floating-point instructions as well as the Dot Product extension. + +@item +nocrypto +Disable the cryptographic extension. + +@item +nofp +Disable the floating-point, Advanced SIMD and cryptographic instructions. +@end table + @item armv7-r @table @samp @item +fp.sp diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp index 8ab7ca8853c1228c1cdfe0d80930165b7e56350b..b210f32f680a673bedd3dc16ae74fefe70a403e4 100644 --- a/gcc/testsuite/gcc.target/arm/multilib.exp +++ b/gcc/testsuite/gcc.target/arm/multilib.exp @@ -92,6 +92,14 @@ if {[multilib_config "aprofile"] } { {-march=armv8.3-a+simd+dotprod -mfloat-abi=softfp} "thumb/v8-a+simd/softfp" {-march=armv8.3-a+simd+dotprod+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp" {-march=armv8.3-a+simd+nofp+dotprod -mfloat-abi=softfp} "thumb/v8-a+simd/softfp" + {-march=armv8.4-a+crypto -mfloat-abi=soft} "thumb/v8-a/nofp" + {-march=armv8.4-a+simd+crypto -mfloat-abi=softfp} "thumb/v8-a+simd/softfp" + {-march=armv8.4-a+simd+crypto+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp" + {-march=armv8.4-a+simd+nofp+crypto -mfloat-abi=softfp} "thumb/v8-a+simd/softfp" + {-march=armv8.4-a+fp16 -mfloat-abi=soft} "thumb/v8-a/nofp" + {-march=armv8.4-a+simd+fp16 -mfloat-abi=softfp} "thumb/v8-a+simd/softfp" + {-march=armv8.4-a+simd+fp16+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp" + {-march=armv8.4-a+simd+nofp+fp16 -mfloat-abi=softfp} "thumb/v8-a+simd/softfp" {-mcpu=cortex-a53+crypto -mfloat-abi=hard} "thumb/v8-a+simd/hard" {-mcpu=cortex-a53+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp" {-march=armv8-a+crc -mfloat-abi=hard -mfpu=vfp} "thumb/v8-a+simd/hard"