public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Re: __tls_get_addr interface question.
@ 2003-01-07 15:00 Martin Schwidefsky
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Schwidefsky @ 2003-01-07 15:00 UTC (permalink / raw)
  To: jakub; +Cc: libc-hacker

>The question is if it should be __tls_get_addr and not say __tls_get_offset
>on s390*...
__tls_get_offset would be a better name for it. 

>Would you be passing %r12 to that routine as another argument
>or would it have some assembly wrapper which would do that?
We get the best code if __tls_get_offset would just take one parameter.
The assembler wrapper would load the got pointer of the calling object
from %r12 before going to C code. This requires that a caller of
__tls_get_offset needs to setup the got register first.
A straightforward implementation of __tls_get_offset would be to
add the got pointer to the offset in the first parameter register
(add %r12 to %r2), call __tls_get_addr and then substract the TCB pointer
from the result (substract %a0 from %r2).
If this is too ugly we could add a second argument to __tls_get_offset but
that results in slightly worse code in the caller.

blue skies,
   Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: __tls_get_addr interface question.
  2003-01-07 14:10 Martin Schwidefsky
@ 2003-01-07 14:21 ` Jakub Jelinek
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2003-01-07 14:21 UTC (permalink / raw)
  To: Martin Schwidefsky; +Cc: libc-hacker

On Tue, Jan 07, 2003 at 03:08:05PM +0100, Martin Schwidefsky wrote:
> Hi,
> we - that is Ulrich Weigand my myself - have started working on the
> TLS support for s390/s390x. I've done a preliminary binutils patch
> which seems to work. This version uses the standard IA-32 calling
> convention to __tls_get_addr. Now Ulrich came up with an idea
> how to improve the instruction sequences but this requires two
> changes to __tls_get_addr:
> 1) __tls_get_addr would be called with the got offset of a tls_index
>    structure located in the got instead of a pointer to the tls_index
>    structure. 
> 2) __tls_get_addr is to return the offset to the TCB of the variable
>    the tls_index refers to instead of the address.
> With these two changes we could improve the code quality for
> TLS accesses quite a bit.
> The question now is: can we have a s390/s390x version of
> __tls_get_addr with these changes without breaking anything?

The question is if it should be __tls_get_addr and not say __tls_get_offset
on s390*...
Would you be passing %r12 to that routine as another argument
or would it have some assembly wrapper which would do that?

	Jakub

^ permalink raw reply	[flat|nested] 3+ messages in thread

* __tls_get_addr interface question.
@ 2003-01-07 14:10 Martin Schwidefsky
  2003-01-07 14:21 ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Schwidefsky @ 2003-01-07 14:10 UTC (permalink / raw)
  To: libc-hacker

Hi,
we - that is Ulrich Weigand my myself - have started working on the
TLS support for s390/s390x. I've done a preliminary binutils patch
which seems to work. This version uses the standard IA-32 calling
convention to __tls_get_addr. Now Ulrich came up with an idea
how to improve the instruction sequences but this requires two
changes to __tls_get_addr:
1) __tls_get_addr would be called with the got offset of a tls_index
   structure located in the got instead of a pointer to the tls_index
   structure. 
2) __tls_get_addr is to return the offset to the TCB of the variable
   the tls_index refers to instead of the address.
With these two changes we could improve the code quality for
TLS accesses quite a bit.
The question now is: can we have a s390/s390x version of
__tls_get_addr with these changes without breaking anything?

blue skies,
  Martin.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-07 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-07 15:00 __tls_get_addr interface question Martin Schwidefsky
  -- strict thread matches above, loose matches on Subject: below --
2003-01-07 14:10 Martin Schwidefsky
2003-01-07 14:21 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).