From patchwork Thu Jul 6 12:40:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Preudhomme X-Patchwork-Id: 785156 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 3x3HQn0HQ1z9s75 for ; Thu, 6 Jul 2017 22:40:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ozRC5iNQ"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:references:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=DKKgjimq6JvsV3gCH d/ALTAm3oRFjm7iMM60UhlmNtgSs14Qy0O5ocza5+sHOKUSFrPNzdiu0fLT3nUiA bLEq39bNzUl9a/aqvhx2aTHXp64uGVtposeMVWYEKypvgJoIcxZazWPix0UoiAUG TADTFXg5KmPAoAU0Fjo1vl5xe4= 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:from:to:references:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=lHb1Y/nXsRpb9FCCpEq27sx eljI=; b=ozRC5iNQpezpG7nFKRqsuvGO3Ra77h2kZ+9GJWNZWDGUmAnt1wbS8ex eC6b9AubsdtI0HLRcxfzVweev5okveWCCmRt+UC85wHxEd/MBz73tVRbdMpNffw4 OexVu3HQ+imKQOCDfMtCwmnDrUDVfjtPiVvnTEW12JWKfnwM70bM= Received: (qmail 75533 invoked by alias); 6 Jul 2017 12:40:38 -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 75519 invoked by uid 89); 6 Jul 2017 12:40:37 -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, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=STRONG, d32 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; Thu, 06 Jul 2017 12:40:35 +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 2DE4F2B; Thu, 6 Jul 2017 05:40:34 -0700 (PDT) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 698963F557; Thu, 6 Jul 2017 05:40:33 -0700 (PDT) Subject: Re: [PATCH 2/3, GCC/ARM] Add support for ARMv8-R architecture From: Thomas Preudhomme To: Kyrill Tkachov , Ramana Radhakrishnan , Richard Earnshaw , "gcc-patches@gcc.gnu.org" References: <9ab04ae2-a65a-11cc-dfaf-1a20a8137e4e@foss.arm.com> <53339781-42d0-005c-d4bf-5a48b394f328@foss.arm.com> Message-ID: <654b960e-5492-8f51-e125-58e51999eecc@foss.arm.com> Date: Thu, 6 Jul 2017 13:40:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <53339781-42d0-005c-d4bf-5a48b394f328@foss.arm.com> X-IsSubscribed: yes Please find an updated patch in attachment. ChangeLog entry are now as follows: *** gcc/ChangeLog *** 2017-07-06 Thomas Preud'homme * config/arm/arm-cpus.in (armv8-r): Add new entry. * config/arm/arm-isa.h (ISA_ARMv8r): Define macro. * config/arm/arm-tables.opt: Regenerate. * config/arm/arm.h (enum base_architecture): Add BASE_ARCH_8R enumerator. * doc/invoke.texi: Mention -march=armv8-r and its extensions. *** gcc/testsuite/ChangeLog *** 2017-01-31 Thomas Preud'homme * lib/target-supports.exp: Generate check_effective_target_arm_arch_v8r_ok, add_options_for_arm_arch_v8r and check_effective_target_arm_arch_v8r_multilib. *** libgcc/ChangeLog *** 2017-01-31 Thomas Preud'homme * config/arm/lib1funcs.S: Defined __ARM_ARCH__ to 8 for ARMv8-R. Tested by building an arm-none-eabi GCC cross-compiler targetting ARMv8-R. Is this ok for stage1? Best regards, Thomas Best regards, Thomas On 29/06/17 16:13, Thomas Preudhomme wrote: > Please ignore this patch. I'll respin the patch on a more recent GCC. > > Best regards, > > Thomas > > On 29/06/17 14:55, Thomas Preudhomme wrote: >> Hi, >> >> This patch adds support for ARMv8-R architecture [1] which was recently >> announced. User level instructions for ARMv8-R are the same as those in >> ARMv8-A Aarch32 mode so this patch define ARMv8-R to have the same >> features as ARMv8-A in ARM backend. >> >> [1] >> https://developer.arm.com/products/architecture/r-profile/docs/ddi0568/latest/arm-architecture-reference-manual-supplement-armv8-for-the-armv8-r-aarch32-architecture-profile >> >> >> ChangeLog entries are as follow: >> >> *** gcc/ChangeLog *** >> >> 2017-01-31 Thomas Preud'homme >> >> * config/arm/arm-cpus.in (armv8-r, armv8-r+rcr): Add new entry. >> * config/arm/arm-cpu-cdata.h: Regenerate. >> * config/arm/arm-cpu-data.h: Regenerate. >> * config/arm/arm-isa.h (ISA_ARMv8r): Define macro. >> * config/arm/arm-tables.opt: Regenerate. >> * config/arm/arm.h (enum base_architecture): Add BASE_ARCH_8R >> enumerator. >> * config/arm/bpabi.h (BE8_LINK_SPEC): Add entry for ARMv8-R and >> ARMv8-R with CRC extensions. >> * doc/invoke.texi: Mention -march=armv8-r and -march=armv8-r+crc >> options. Document meaning of -march=armv8-r+rcr. >> >> *** gcc/testsuite/ChangeLog *** >> >> 2017-01-31 Thomas Preud'homme >> >> * lib/target-supports.exp: Generate >> check_effective_target_arm_arch_v8r_ok, add_options_for_arm_arch_v8r >> and check_effective_target_arm_arch_v8r_multilib. >> >> *** libgcc/ChangeLog *** >> >> 2017-01-31 Thomas Preud'homme >> >> * config/arm/lib1funcs.S: Defined __ARM_ARCH__ to 8 for ARMv8-R. >> >> Tested by building an arm-none-eabi GCC cross-compiler targetting >> ARMv8-R. >> >> Is this ok for stage1? >> >> Best regards, >> >> Thomas diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in index 946d543ebb29416da9b4928161607cccacaa78a7..f35128acb7d68c6a0592355b9d3d56ee8f826aca 100644 --- a/gcc/config/arm/arm-cpus.in +++ b/gcc/config/arm/arm-cpus.in @@ -380,6 +380,22 @@ begin arch armv8-m.main option nodsp remove bit_ARMv7em end arch armv8-m.main +begin arch armv8-r + tune for cortex-r4 + tune flags CO_PROC + base 8R + profile R + isa ARMv8r + option crc add bit_crc32 +# fp.sp => fp-armv8 (d16); simd => simd + fp-armv8 + d32 + double precision +# note: no fp option for fp-armv8 (d16) + double precision at the moment + option fp.sp add FP_ARMv8 + option simd add FP_ARMv8 NEON + option crypto add FP_ARMv8 CRYPTO + option nocrypto remove ALL_CRYPTO + option nofp remove ALL_FP +end arch armv8-r + begin arch iwmmxt tune for iwmmxt tune flags LDSCHED STRONG XSCALE diff --git a/gcc/config/arm/arm-isa.h b/gcc/config/arm/arm-isa.h index c0c2ccee330f2313951e980c5d399ae5d21005d6..0d66a0400c517668db023fc66ff43e26d43add51 100644 --- a/gcc/config/arm/arm-isa.h +++ b/gcc/config/arm/arm-isa.h @@ -127,6 +127,7 @@ enum isa_feature #define ISA_ARMv8_2a ISA_ARMv8_1a, isa_bit_ARMv8_2 #define ISA_ARMv8m_base ISA_ARMv6m, isa_bit_ARMv8, isa_bit_cmse, isa_bit_tdiv #define ISA_ARMv8m_main ISA_ARMv7m, isa_bit_ARMv8, isa_bit_cmse +#define ISA_ARMv8r ISA_ARMv8a /* List of all cryptographic extensions to stripout if crypto is disabled. Currently, that's trivial, but we define it anyway for diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt index 5e2df9dd0716293fb551b6582a8c9c2c46fdaa90..51678c2566e841894c5c0e9c613c8c0f832e9988 100644 --- a/gcc/config/arm/arm-tables.opt +++ b/gcc/config/arm/arm-tables.opt @@ -455,10 +455,13 @@ EnumValue Enum(arm_arch) String(armv8-m.main) Value(30) EnumValue -Enum(arm_arch) String(iwmmxt) Value(31) +Enum(arm_arch) String(armv8-r) Value(31) EnumValue -Enum(arm_arch) String(iwmmxt2) Value(32) +Enum(arm_arch) String(iwmmxt) Value(32) + +EnumValue +Enum(arm_arch) String(iwmmxt2) Value(33) Enum Name(arm_fpu) Type(enum fpu_type) diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index c803d4461c08436ef5f8468f6018e3226ccf33f8..315622212a5ce10d0c771535fe31f63c3be16444 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -384,7 +384,8 @@ enum base_architecture BASE_ARCH_7EM = 7, BASE_ARCH_8A = 8, BASE_ARCH_8M_BASE = 8, - BASE_ARCH_8M_MAIN = 8 + BASE_ARCH_8M_MAIN = 8, + BASE_ARCH_8R = 8 }; /* The major revision number of the ARM Architecture implemented by the target. */ diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 3e5cee8649ef9452e2a7e5a8603318ce11e2baff..d0b90503cedaae32bc83c7fd1fdd78b2a4d7184b 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -15218,6 +15218,7 @@ Permissible names are: @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv7-r}, +@samp{armv8-r}, @samp{armv6-m}, @samp{armv6s-m}, @samp{armv7-m}, @samp{armv7e-m}, @samp{armv8-m.base}, @samp{armv8-m.main}, @@ -15484,7 +15485,20 @@ The single- and double-precision floating-point instructions. @item +nofp Disable the floating-point extension. +@end table +@item armv8-r +@table @samp +@item +crc +The Cyclic Redundancy Check (CRC) instructions. +@item +simd +The ARMv8 Advanced SIMD and floating-point instructions. +@item +crypto +The cryptographic instructions. +@item +nocrypto +Disable the cryptographic isntructions. +@item +nofp +Disable the floating-point, Advanced SIMD and cryptographic instructions. @end table @end table diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index fe5e77756404d603f04d674bb5ca872956d4b7ad..83d0c7ca441570dbf4d52641d12073f17d06e025 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3890,7 +3890,8 @@ foreach { armfunc armflag armdefs } { v8_2a "-march=armv8.2a" __ARM_ARCH_8A__ v8m_base "-march=armv8-m.base -mthumb -mfloat-abi=soft" __ARM_ARCH_8M_BASE__ - v8m_main "-march=armv8-m.main -mthumb" __ARM_ARCH_8M_MAIN__ } { + v8m_main "-march=armv8-m.main -mthumb" __ARM_ARCH_8M_MAIN__ + v8r "-march=armv8-r" __ARM_ARCH_8R__ } { eval [string map [list FUNC $armfunc FLAG $armflag DEFS $armdefs ] { proc check_effective_target_arm_arch_FUNC_ok { } { if { [ string match "*-marm*" "FLAG" ] && diff --git a/libgcc/config/arm/lib1funcs.S b/libgcc/config/arm/lib1funcs.S index 89ebebcd68a790c6bec140e4a8bd5a3b44dce291..8d8c3cead5f77f6dfeb2887e68483119ee3a400a 100644 --- a/libgcc/config/arm/lib1funcs.S +++ b/libgcc/config/arm/lib1funcs.S @@ -109,7 +109,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #endif #if defined(__ARM_ARCH_8A__) || defined(__ARM_ARCH_8M_BASE__) \ - || defined(__ARM_ARCH_8M_MAIN__) + || defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8R__) # define __ARM_ARCH__ 8 #endif