This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch][aarch64] Use IFUNCs to enable LSE instructions in libatomic on aarch64
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Steve Ellcey <sellcey at cavium dot com>
- Cc: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Thu, 7 Dec 2017 09:56:45 +0000
- Subject: Re: [Patch][aarch64] Use IFUNCs to enable LSE instructions in libatomic on aarch64
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=bestguesspass action=none header.from=arm.com;
- Nodisclaimer: True
- References: <1502138666.3962.95.camel@cavium.com> <59A03627.4060106@arm.com> <1503944731.28672.134.camel@cavium.com> <59A54F1C.3010806@arm.com> <1504200277.3182.22.camel@cavium.com> <59CCDD8A.9020703@arm.com> <1506716977.15649.41.camel@cavium.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Fri, Sep 29, 2017 at 09:29:37PM +0100, Steve Ellcey wrote:
> On Thu, 2017-09-28 at 12:31 +0100, Szabolcs Nagy wrote:
> >
> > i think this should be improved, see below.
>
> diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
> index d731406..92d19c6 100644
> --- a/libatomic/Makefile.am
> +++ b/libatomic/Makefile.am
> @@ -122,6 +122,10 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix _$(s)_.lo,$(SIZEOBJS)))
>
> ## On a target-specific basis, include alternates to be selected by IFUNC.
> if HAVE_IFUNC
> +if ARCH_AARCH64_LINUX
> +IFUNC_OPTIONS = -march=armv8.1-a
> +libatomic_la_LIBADD += $(foreach s,$(SIZES),$(addsuffix _$(s)_1_.lo,$(SIZEOBJS)))
> +endif
> if ARCH_ARM_LINUX
> IFUNC_OPTIONS = -march=armv7-a -DHAVE_KERNEL64
> libatomic_la_LIBADD += $(foreach s,$(SIZES),$(addsuffix _$(s)_1_.lo,$(SIZEOBJS)))
One obvious thing I missed in the review is that this change will break
bootstrap on systems with older assemblers. Practically, that's those of
us who are holding out on Ubuntu 14.04. -march=armv8-a+lse would go back
a little further, so would be preferable, but even this won't get bootstrap
back on older systems.
Is there anything you can do to check for assembler support before turning
on IFUNCS for libatomic, or am I best to just start configuring with
--disable-gnu-indirect-function ?
Thanks,
James