This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Enable ILP32 mode on aarch64


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]