Segment Register use penalty?
- From: "Ira Baxter" <spamtrap@xxxxxxxxxx>
- Date: Mon, 15 Jan 2007 18:57:11 -0600
I'm using Thread Local Storage (TLS_...) under the Win32 API extremely
heavily.
It is accessible via the FS: pointer.
On a number of occasions, I can either compute the address of
an TLS variable and manipulate it directly:
mov edi,FS:[TIB_ADDRESS] ; get address of thread information
block
lea edi,tlsvar+TLS_OFFSET[edi]
<code modifying 0[edi] several times>
mov 0[edi],...
...
mov ...,0[edi]
or I can manipulate the tlsvar directly, an equal number of times:
mov FS:[tlsvar+TLS_OFFSET],...
....
mov ...,FS:[tlsvar+TLS_OFFSET],...
Is there an execution penalty to using the FS: register several times?
What is the penalty?
I mostly only care about running on x64 machines
from this point on. (I expect to be moving this code
to 64 bit world, but for the moment I'm stuck for legacy
reasons with 32 bit code, even in this 64 bit world).
--
Ira Baxter
www.semanticdesigns.com
.
- Prev by Date: Re: Display file name
- Next by Date: Re: Display file name
- Previous by thread: Display file name
- Next by thread: gcc inline asm, mmx problem
- Index(es):
Relevant Pages
|
|