This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] PPC64 enable with-tls
- From: Steven Munroe <sjmunroe at vnet dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 24 Feb 2003 17:06:48 -0600
- Subject: Re: [PATCH] PPC64 enable with-tls
- Reply-to: sjmunroe at us dot ibm dot com
Roland McGrath writes:
> Wouldn't it be better to use a global register variable and C arithmetic
> for THREAD_SELF? i.e.
>
> register uintptr_t __thread_register asm ("13");
> #define THREAD_SELF \
> ((pthread_descr) (__thread_register + 0x7000 + TLS_TCB_SIZE +
TLS_PRE_TCB_SIZE))
>
> Then THREAD_GETMEM(,foo) => THREAD_SELF->foo allows the compiler to
>combine
> the constant register bias and the member offset in one insn.
I can do that:
# define THREAD_SELF \
((pthread_descr) (((char *)__thread_self) \
- (0x7000 + TLS_TCB_SIZE + TLS_PRE_TCB_SIZE)))
I plan leave the other macros as is until ppc64 gets gcc support for
__builtin_thread_pointer ...