This is the mail archive of the libc-alpha@sources.redhat.com 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] PPC64 enable with-tls


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 ...


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