From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75971 invoked by alias); 6 Jul 2015 17:08:21 -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 75955 invoked by uid 89); 6 Jul 2015 17:08:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Jul 2015 17:08:19 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-27-U1MrDNaFTLSYaVhBB6yuLA-1 Received: from [10.2.207.50] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 6 Jul 2015 18:08:13 +0100 Message-ID: <559AB5FE.6030200@arm.com> Date: Mon, 06 Jul 2015 17:08:00 -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: Renlin Li , Christophe Lyon CC: "gcc-patches@gcc.gnu.org" , Ramana Radhakrishnan , Richard Earnshaw Subject: Re: [PATCH] Enable two UNSIGNED_FLOAT simplifications in simplify_unary_operation_1 References: <550C52ED.9040100@arm.com> <55893868.8050200@arm.com> In-Reply-To: <55893868.8050200@arm.com> X-MC-Unique: U1MrDNaFTLSYaVhBB6yuLA-1 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00385.txt.bz2 On 23/06/15 11:43, Renlin Li wrote: > Hi Christophe, > > Yes, we have also noticed this failure. > > Here I have a simple patch to remove the mfloat-abi option for > hard-float toolchain. The default abi is used. > For non-hardfloat toolchain, softfp abi is specified. > > I have checked with arm-none-eabi and arm-none-linux-gnueabihf > toolchain, this problem should be resolved by this patch. > > Okay to commit? Ok. Thanks, Kyrill > > > gcc/testsuite/ChangeLog: > > 2015-06-23 Renlin Li > > * gcc.target/arm/unsigned-float.c: Different options for hf toolcha= in. > > > On 16/06/15 14:33, Christophe Lyon wrote: >> On 20 March 2015 at 18:03, Renlin Li wrote: >>> Hi all, >>> >>> This is a simple patch to enable two simplifications for UNSIGNED_FLOAT >>> expression. >>> >>> For the following rtx patterns, they can be simplified when the integer= x >>> can be >>> represented in float mode without precision loss: >>> >>> float_truncate (float x) --> float x >>> float_extend (float x) --> float x >>> >>> Those two simplifications are also applicable to UNSIGNED_FLOAT express= ion. >>> >>> For example, compile the following code using aarch64-none-elf toolchain >>> with -O1 flag. >>> double >>> f1 (uint16_t x) >>> { >>> return (double)(float)x; >>> } >>> Before the change, the compiler generates the following code: >>> f1: >>> uxth w0, w0 >>> ucvtf s0, w0 >>> fcvt d0, s0 >>> ret >>> After the change, the following simplified asm code snipts are generate= d. >>> f1: >>> uxth w0, w0 >>> ucvtf d0, w0 >>> ret >>> >>> >>> aarch64-none-elf regression test runs Okay. x86_64 bootstraps Okay. >>> Okay to commit? >>> >>> gcc/ChangeLog: >>> >>> 2015-03-20 Renlin Li >>> >>> * simplify-rtx.c (simplify_unary_operation_1): Fix a typo. Enable= two >>> simplifications for UNSIGNED_FLOAT. >>> >>> gcc/testsuite/ChangeLog: >>> >>> 2015-03-20 Renlin Li >>> >>> * gcc.target/aarch64/unsigned-float.c: New. >>> * gcc.target/arm/unsigned-float.c: New. >> This new test fails on ARM targets defaulting to hard-float which have >> no softfp multilib. >> I'm not sure about the best way to fix this. >> >> Note that dg-require-effective-target arm_vfp_ok passes, but the >> testcase fails because it includes stdint.h, leading to: >> sysroot-arm-none-linux-gnueabihf/usr/include/gnu/stubs.h:7:29: fatal >> error: gnu/stubs-soft.h: No such file or directory >> >> Christophe. >>