Zoltan Varga
2009-May-04 21:59 UTC
[LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
Hi, Here is an updated version of the patch using address space 257. Zoltan On Mon, May 4, 2009 at 11:36 PM, Shantonu Sen <ssen at apple.com> wrote:> Maybe 257 would be better (or other unused), because of r70197, which gives > special behavior for <256 > > Shantonu Sen > ssen at apple.com > > Sent from my Mac Pro > > > On May 4, 2009, at 2:28 PM, Zoltan Varga wrote: > > Hi, >> >> The attached patch adds support for accessing the FS segment register >> using address space 255, similarly to the way the GS segment register can be >> accessed. This is useful for generating TLS access code on amd64 for >> example. >> >> Zoltan >> >> > _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090504/78c348fb/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: fs.diff Type: text/x-diff Size: 3519 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090504/78c348fb/attachment.diff>
Dan Gohman
2009-May-04 22:16 UTC
[LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
Hello, The preferred way to do TLS is to use the thread_local keyword. There is x86-64 support for thread_local on ELF; if you need it for other targets, I recommend looking at adapting it. Dan On May 4, 2009, at 2:59 PM, Zoltan Varga wrote:> Hi, > > Here is an updated version of the patch using address space 257. > > Zoltan > > On Mon, May 4, 2009 at 11:36 PM, Shantonu Sen <ssen at apple.com> wrote: > Maybe 257 would be better (or other unused), because of r70197, > which gives special behavior for <256 > > Shantonu Sen > ssen at apple.com > > Sent from my Mac Pro > > > On May 4, 2009, at 2:28 PM, Zoltan Varga wrote: > > Hi, > > The attached patch adds support for accessing the FS segment > register using address space 255, similarly to the way the GS > segment register can be accessed. This is useful for generating TLS > access code on amd64 for example. > > Zoltan > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > <fs.diff>_______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Chris Lattner
2009-May-04 22:30 UTC
[LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
On May 4, 2009, at 3:16 PM, Dan Gohman wrote:> Hello, > > The preferred way to do TLS is to use the thread_local keyword. > There is x86-64 support for thread_local on ELF; if you need > it for other targets, I recommend looking at adapting it.That said, the X86 backend supporting access off FS is general goodness, right? -Chris
Zoltan Varga
2009-May-04 22:37 UTC
[LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
Hi, If I'm writing a JIT, and want to access the TLS variables of the app containing the JIT, I can't use thread_local since that only works for variables declared in LLVM IL and/or managed by the ExecutionEngine. While this patch allows a JIT to generate the TLS accesses itself, if it knows the tls offset of the variable in question. Zoltan On Tue, May 5, 2009 at 12:16 AM, Dan Gohman <gohman at apple.com> wrote:> Hello, > > The preferred way to do TLS is to use the thread_local keyword. > There is x86-64 support for thread_local on ELF; if you need > it for other targets, I recommend looking at adapting it. > > Dan > > On May 4, 2009, at 2:59 PM, Zoltan Varga wrote: > > > Hi, > > > > Here is an updated version of the patch using address space 257. > > > > Zoltan > > > > On Mon, May 4, 2009 at 11:36 PM, Shantonu Sen <ssen at apple.com> wrote: > > Maybe 257 would be better (or other unused), because of r70197, > > which gives special behavior for <256 > > > > Shantonu Sen > > ssen at apple.com > > > > Sent from my Mac Pro > > > > > > On May 4, 2009, at 2:28 PM, Zoltan Varga wrote: > > > > Hi, > > > > The attached patch adds support for accessing the FS segment > > register using address space 255, similarly to the way the GS > > segment register can be accessed. This is useful for generating TLS > > access code on amd64 for example. > > > > Zoltan > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > > <fs.diff>_______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090505/b81b4967/attachment.html>
Chris Lattner
2009-May-05 18:53 UTC
[LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
On May 4, 2009, at 2:59 PM, Zoltan Varga wrote:> Hi, > Here is an updated version of the patch using address space 257.Applied, thanks! http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090504/077147.html -Chris
Apparently Analagous Threads
- [LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
- [LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
- [LLVMdev] [PATCH] Add support for accessing the FS segment register on X86
- [LLVMdev] ideas for TLS implementation
- Is there some sort of "@llvm.thread_ctors."?