This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/2] Enable ILP32 mode on aarch64
- From: Steve Ellcey <sellcey at caviumnetworks dot com>
- To: Richard Henderson <rth at twiddle dot net>, <libc-alpha at sourceware dot org>
- Date: Tue, 29 Nov 2016 14:12:24 -0800
- Subject: Re: [PATCH 2/2] Enable ILP32 mode 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: <1480445512.14808.18.camel@caviumnetworks.com> <3f9a6bd4-0c4e-9f88-4106-fd393488a08c@twiddle.net>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Tue, 2016-11-29 at 11:14 -0800, Richard Henderson wrote:
> On 11/29/2016 10:51 AM, Steve Ellcey wrote:
> >
> > +#define TLS_IE(x) \
> > + ({ register unsigned long __result asm ("x0"); \
> > + register unsigned long __t; \
> > + asm ("mrs %1, tpidr_el0; " \
> > + "adrp %0, :gottprel:" #x "; "
> > \
> > + "ldr w0, [%0, #:gottprel_lo12:" #x "]; " \
> > + "add %0, %0, %1" \
> > + : "=r" (__result), "=r" (__t)); \
> > + (int *) (__result); })
> > +#endif
> Why are you forcing x0 for __result? You can use %w0 for the ldr
> destination
> instead. (I actually didn't see the asm register specification at
> first and
> thought this was a bug.)
>
>
> r~
I was just copying what the orignal (LP64) version of TLS_IE did. But
you are right, there is no reason to force __result into x0 and the
tests work fine if I do not do that and then use %w0 as the ldr
destination. I also changed the LP64 version to not force the use of
x0 and that seems fine too.
Note that this macro is not used in glibc itself anywhere, it is only
used by four elf tests; tst-tls1, tst-tls2, tst-tls3, and tst-tlsmod1.
I will make this change if I need to respin the patch, but for now I
want to see if I get more feedback on any other issues.
Steve Ellcey
sellcey@caviumnetworks.com