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: Steve Ellcey <sellcey at cavium dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Cc: nd at arm dot com
- Date: Wed, 30 Aug 2017 10:25:36 -0700
- Subject: Re: [Patch][aarch64] Use IFUNCs to enable LSE instructions in libatomic on aarch64
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Steve dot Ellcey at cavium dot com;
- References: <1502138666.3962.95.camel@cavium.com> <59A03627.4060106@arm.com> <1503944731.28672.134.camel@cavium.com> <59A54F1C.3010806@arm.com>
- Reply-to: sellcey at cavium dot com
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Tue, 2017-08-29 at 12:25 +0100, Szabolcs Nagy wrote:
>
> it's a general bug that most ifunc users (e.g. in binutils
> tests) declare the ifunc resolvers incorrectly, the correct
> prototype is the way the dynamic linker invokes the resolver
> in sysdeps/aarch64/dl-irel.h:
>
> static inline ElfW(Addr)
> __attribute ((always_inline))
> elf_ifunc_invoke (ElfW(Addr) addr)
> {
> return ((ElfW(Addr) (*) (unsigned long int)) (addr))
> (GLRO(dl_hwcap));
> }
>
> (that argument should be uint64_t for ilp32, but that's a
> separate issue)
>
> in glibc the hwcap is not used, because it has accesses to
> cached dispatch info, but in libatomic using the hwcap
> argument is the right way.
OK, I changed my patch to use the argument and it did work but
since the type of the argument should be uint64_t instead of 'unsigned
long int' for aarch64 I think I will send a patch to libc-alpha
first to fix this before sending an updated libatomic patch. That way
I won't have to update GCC when glibc changes the type. I see that
different platforms use different types for the resolver argument so I
think I will have to update the libatomic configure.tgt script as well
to set the resolver arg type when I resbumit the gcc libatomic patch so
that we can have the correct prototype in libatomic_i.h.
Steve Ellcey
sellcey@cavium.com