From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8031 invoked by alias); 2 Jun 2011 15:35:26 -0000 Received: (qmail 7792 invoked by uid 22791); 2 Jun 2011 15:35:25 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (94.185.240.25) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 02 Jun 2011 15:35:07 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 02 Jun 2011 16:35:04 +0100 Received: from [10.1.67.34] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 2 Jun 2011 16:35:26 +0100 Subject: Re: [PATCH, ARM] Fix ABI for double-precision helpers on single-float-only CPUs From: Richard Earnshaw To: Julian Brown Cc: gcc-patches@gcc.gnu.org, paul@codesourcery.com, Ramana Radhakrishnan In-Reply-To: <20110527173238.630c95b8@rex.config> References: <20110527173238.630c95b8@rex.config> Date: Thu, 02 Jun 2011 15:35:00 -0000 Message-Id: <1307028902.17090.6.camel@e102346-lin.cambridge.arm.com> Mime-Version: 1.0 X-MC-Unique: 111060216350403201 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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 X-SW-Source: 2011-06/txt/msg00157.txt.bz2 On Fri, 2011-05-27 at 17:32 +0100, Julian Brown wrote: > The helper functions used to implement double-precision arithmetic on > ARM processors that only support single-precision arithmetic in hardware > should use the soft-float ABI (i.e. passing and returning floating-point > arguments in core registers), even when -mfloat-abi=3Dhard is in effect. > This patch tweaks the ABI for the affected functions so that is true. >=20 > Tested with cross to ARM EABI, and by manually observing compiler > output. We've also been carrying this patch in our local tree for some > time without issue. >=20 > OK to apply? >=20 > Thanks, >=20 > Julian >=20 > ChangeLog >=20 > gcc/ > * config/arm/arm.c (arm_libcall_uses_aapcs_base) > (arm_init_cumulative_args): Use correct ABI for double-precision > helper functions in hard-float mode if only single-precision > arithmetic is supported in hardware. I see Paul has already approved this, but I've just spotted one potential problem that might cause latent bugs sometime in the future. The code to register the libcalls is only run once, the first time we try to look up a libcall. If we ever end up allowing dynamic changing of CPU and optimization options, not registering the other libcalls will lead to subtle problems at run time. I suggest that these functions be unconditionally added along with the other libcalls. I also don't understand why all the tests are needed in arm_init_cumulative_args? Surely arm_libcall_uses_aapcs_base() will already have run that test. R.