<br> Hi,<br><br>  If I'm writing a JIT, and want to access the TLS variables of the app containing the JIT, I can't<br>use thread_local since that only works for variables declared in LLVM IL and/or managed by<br>the ExecutionEngine. While this patch allows a JIT to generate the TLS accesses itself, if<br>
it knows the tls offset of the variable in question.<br><br>                  Zoltan<br><br><div class="gmail_quote">On Tue, May 5, 2009 at 12:16 AM, Dan Gohman <span dir="ltr"><<a href="mailto:gohman@apple.com">gohman@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br>
<br>
The preferred way to do TLS is to use the thread_local keyword.<br>
There is x86-64 support for thread_local on ELF; if you need<br>
it for other targets, I recommend looking at adapting it.<br>
<br>
Dan<br>
<div class="im"><br>
On May 4, 2009, at 2:59 PM, Zoltan Varga wrote:<br>
<br>
> Hi,<br>
><br>
>   Here is an updated version of the patch using address space 257.<br>
><br>
>                 Zoltan<br>
><br>
> On Mon, May 4, 2009 at 11:36 PM, Shantonu Sen <<a href="mailto:ssen@apple.com">ssen@apple.com</a>> wrote:<br>
> Maybe 257 would be better (or other unused), because of r70197,<br>
> which gives special behavior for <256<br>
><br>
> Shantonu Sen<br>
> <a href="mailto:ssen@apple.com">ssen@apple.com</a><br>
><br>
> Sent from my Mac Pro<br>
><br>
><br>
> On May 4, 2009, at 2:28 PM, Zoltan Varga wrote:<br>
><br>
> Hi,<br>
><br>
>  The attached patch adds support for accessing the FS segment<br>
> register using address space 255, similarly to the way the GS<br>
> segment register can be accessed. This is useful for generating TLS<br>
> access code on amd64 for example.<br>
><br>
>              Zoltan<br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
><br>
><br>
</div>> <fs.diff>_______________________________________________<br>
<div><div></div><div class="h5">> LLVM Developers mailing list<br>
> <a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br>