From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25986 invoked by alias); 27 Nov 2017 12:25:35 -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 25972 invoked by uid 89); 27 Nov 2017 12:25:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.7 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= 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; Mon, 27 Nov 2017 12:25: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 03DC380D; Mon, 27 Nov 2017 04:25:27 -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 1316B3F24A; Mon, 27 Nov 2017 04:25:25 -0800 (PST) Message-ID: <5A1C0434.5000109@foss.arm.com> Date: Mon, 27 Nov 2017 12:39: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: Sudi Das , "gcc-patches@gcc.gnu.org" CC: nd , Ramana Radhakrishnan , Richard Earnshaw Subject: Re: [PATCH][ARM] Fix wrong code by arm_final_prescan with fp16 move instructions References: <4db1e5be-24b1-bab7-d351-b00ef5332728@arm.com> In-Reply-To: <4db1e5be-24b1-bab7-d351-b00ef5332728@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-11/txt/msg02290.txt.bz2 Hi Sudi, On 24/11/17 14:57, Sudi Das wrote: > Hi > > For the following test case: > __fp16 > test_select (__fp16 a, __fp16 b, __fp16 c) > { > return (a < b) ? b : c; > } > > when compiled with -mfpu=fp-armv8 -march=armv8.2-a+fp16 -marm > -mfloat-abi=hard trunk generates wrong code: > > test_select: > @ args = 0, pretend = 0, frame = 0 > @ frame_needed = 0, uses_anonymous_args = 0 > @ link register save eliminated. > vcvtb.f32.f16 s0, s0 > vcvtb.f32.f16 s15, s1 > vcmpe.f32 s0, s15 > vmrs APSR_nzcv, FPSCR > // <------ No conditional branch! > vmov s1, s2 @ __fp16 > .L2: > vmov s0, s1 @ __fp16 > bx lr > > There should have been a conditional branch there to skip one of the > VMOVs. > This patch fixes this problem by making *movhf_vfp_fp16 unconditional > wherever needed. > > Testing done: Add a new test case and checked for regressions > arm-none-linux-gnueabihf. > > Is this ok for trunk? > This is ok after assuming a bootstrap on arm-none-linux-gnueabihf passes as well. Does this bug appear on the GCC 7 branch? If so, could you please test this patch on that branch as well if so? Thanks, Kyrill > Sudi > > ChangeLog entry are as follow: > > *** gcc/ChangeLog *** > > 2017-11-24 Sudakshina Das > > * config/arm/vfp.md (*movhf_vfp_fp16): Add conds attribute. > > *** gcc/testsuite/ChangeLog *** > > 2017-11-24 Sudakshina Das > > * gcc.target/arm/armv8_2-fp16-move-2.c: New test.