thread-local data access
Richard Henderson
rth@twiddle.net
Fri Sep 29 18:12:00 GMT 2000
On Wed, Sep 27, 2000 at 05:25:21PM +0200, schwidefsky@de.ibm.com wrote:
> Access register 0 is unused anywhere so we could just use this one.
> We can't address data directly with this register but we can load it to a
> normal register in one cycle. I will take a look at the pthread
> implementation and give it a try.
This is very similar to Alpha's situation (though it takes more
like 5-10 cycles to get into PALmode and back out again with
the value. Certainly it's faster than playing stack games
(which wouldn't even work with the stuff we're now discussing)).
To be sure, ideally you'd teach gcc about this register, and how to
move data to and from. You'd mark it fixed, since you're reserving
it for the thread ABI. Then you can implement pthreads with
register struct _pthread_descr_struct *__thread_self __asm__("acc0");
#define THREAD_SELF __thread_self
Now gcc can properly schedule the code, which would not be true
with inline assembly.
r~
More information about the Libc-hacker
mailing list