From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110262 invoked by alias); 17 Dec 2015 16:21:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 110244 invoked by uid 89); 17 Dec 2015 16:21:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=H*RU:8.3.389.2, H*r:ip*8.3.389.2, H*r:8.3.389, Hx-spam-relays-external:8.3.389.2 X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 17 Dec 2015 16:21:49 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.14.5/8.14.5) with SMTP id tBHGJDBm004995; Thu, 17 Dec 2015 17:21:41 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 1yu93k6g09-1 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 17 Dec 2015 17:21:41 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CA07E31; Thu, 17 Dec 2015 16:21:02 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas4.st.com [10.75.90.69]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CC8B55A25; Thu, 17 Dec 2015 16:21:39 +0000 (GMT) Received: from [164.129.122.197] (164.129.122.197) by webmail-eu.st.com (10.75.90.13) with Microsoft SMTP Server (TLS) id 8.3.389.2; Thu, 17 Dec 2015 17:21:39 +0100 Subject: Re: [PATCH, ARM] PR65835 Fix LTO support for neon builtins To: Ramana Radhakrishnan References: <5666D2BC.5030105@st.com> CC: Ramana Radhakrishnan , Kyrylo Tkachov , gcc-patches From: Christian Bruel X-No-Archive: yes Message-ID: <5672E113.7040801@st.com> Date: Thu, 17 Dec 2015 16:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------080802050806000207020608" X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.15.21,1.0.33,0.0.0000 definitions=2015-12-17_02:2015-12-17,2015-12-17,1970-01-01 signatures=0 X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg01786.txt.bz2 --------------080802050806000207020608 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 390 This is the new version of the patch that removes the "lto1 target specific builtin not available" error message happening in the LTO streamer-in while loading the NEON intrinsic in the global context, without arm_fpu_index being set with the current FPU mode. nb: Needs https://gcc.gnu.org/ml/gcc-patches/2015-12/msg01714.html to pass Also robustified the associated test. Thanks, --------------080802050806000207020608 Content-Type: text/x-patch; name="lto-neon.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="lto-neon.patch" Content-length: 3692 2015-12-17 Christian Bruel PR target/65837 * arm-builtins.c (ARM_BUILTIN_CRYPTO_BASE): New enum. (arm_init_neon_builtins): Move neon_set_p and neon_crypto_set_p... (arm_init_neon_builtins_internal, arm_init_crypto_builtins_internal): Here. * arm_builtin_decl (arm_init_neon_builtins_internal) (arm_init_crypto_builtins_internal): Call if needed. 2015-12-17 Christian Bruel PR target/65837 * gcc.target/arm/lto/pr65837_0.c: Robustify dg tests. Use intrinsinc name from arm_neon.h. Index: config/arm/arm-builtins.c =================================================================== --- config/arm/arm-builtins.c (revision 231774) +++ config/arm/arm-builtins.c (working copy) @@ -519,6 +519,8 @@ enum arm_builtins #undef CRYPTO2 #undef CRYPTO3 + ARM_BUILTIN_CRYPTO_BASE, + #define CRYPTO1(L, U, M1, M2) \ ARM_BUILTIN_CRYPTO_##U, #define CRYPTO2(L, U, M1, M2, M3) \ @@ -893,11 +895,19 @@ arm_init_simd_builtin_scalar_types (void "__builtin_neon_uti"); } +static bool neon_set_p = false; +static bool neon_crypto_set_p = false; + static void arm_init_neon_builtins_internal (void) { unsigned int i, fcode = ARM_BUILTIN_NEON_PATTERN_START; + if (neon_set_p) + return; + + neon_set_p = true; + arm_init_simd_builtin_types (); /* Strong-typing hasn't been implemented for all AdvSIMD builtin intrinsics. @@ -1020,6 +1030,11 @@ arm_init_neon_builtins_internal (void) static void arm_init_crypto_builtins_internal (void) { + if (neon_crypto_set_p) + return; + + neon_crypto_set_p = true; + tree V16UQI_type_node = arm_simd_builtin_type (V16QImode, true, false); @@ -1098,23 +1113,13 @@ arm_init_crypto_builtins_internal (void) #undef FT3 } -static bool neon_set_p = false; -static bool neon_crypto_set_p = false; - void arm_init_neon_builtins (void) { - if (! neon_set_p) - { - neon_set_p = true; - arm_init_neon_builtins_internal (); - } + arm_init_neon_builtins_internal (); - if (! neon_crypto_set_p && TARGET_CRYPTO && TARGET_HARD_FLOAT) - { - neon_crypto_set_p = true; - arm_init_crypto_builtins_internal (); - } + if (TARGET_CRYPTO && TARGET_HARD_FLOAT) + arm_init_crypto_builtins_internal (); } #undef NUM_DREG_TYPES @@ -1802,11 +1807,22 @@ arm_init_builtins (void) /* Return the ARM builtin for CODE. */ tree -arm_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED) +arm_builtin_decl (unsigned code, bool initialize_p) { if (code >= ARM_BUILTIN_MAX) return error_mark_node; + if (! arm_builtin_decls[code] && initialize_p) + { + /* arm_fpu_index is not set to test global features here. */ + if (code >= ARM_BUILTIN_CRYPTO_BASE) + { + arm_init_neon_builtins_internal (); + if (code < ARM_BUILTIN_NEON_BASE) + arm_init_crypto_builtins_internal (); + } + } + return arm_builtin_decls[code]; } Index: testsuite/gcc.target/arm/lto/pr65837_0.c =================================================================== --- testsuite/gcc.target/arm/lto/pr65837_0.c (revision 231774) +++ testsuite/gcc.target/arm/lto/pr65837_0.c (working copy) @@ -1,5 +1,7 @@ /* { dg-lto-do run } */ -/* { dg-lto-options {{-flto -mfpu=neon}} } */ +/* { dg-require-effective-target arm_neon_ok } */ +/* { dg-skip-if "need hardfp ABI" { *-*-* } { "-mfloat-abi=soft" } { "" } } */ +/* { dg-lto-options {{-flto -mfpu=neon -mfloat-abi=hard}} } */ /* { dg-suppress-ld-options {-mfpu=neon} } */ #include "arm_neon.h" @@ -8,7 +10,8 @@ float32x2_t a, b, c, e; int main() { - e = __builtin_neon_vmls_lanev2sf (a, b, c, 0); + e = vmls_lane_f32 (a, b, c, 0); return 0; } --------------080802050806000207020608--