diff options
author | Dan Gohman <gohman@apple.com> | 2009-05-05 20:48:47 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-05-05 20:48:47 +0000 |
commit | d26795a034aef970392e789d782333528b128006 (patch) | |
tree | 6f3f778237ee206557314cd51c3527e4135df6b5 /docs/CodeGenerator.html | |
parent | f9a9b51429b284ad85f1162592a10918c5665733 (diff) | |
download | llvm-d26795a034aef970392e789d782333528b128006.tar.gz llvm-d26795a034aef970392e789d782333528b128006.tar.bz2 llvm-d26795a034aef970392e789d782333528b128006.tar.xz |
Add some more documentation for x86 special address spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71012 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/CodeGenerator.html')
-rw-r--r-- | docs/CodeGenerator.html | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/docs/CodeGenerator.html b/docs/CodeGenerator.html index e620c1782e..dd9cd4a45b 100644 --- a/docs/CodeGenerator.html +++ b/docs/CodeGenerator.html @@ -1838,7 +1838,8 @@ OperandTy: VirtReg, | VirtReg, UnsImm, VirtReg, SignExtImm <div class="doc_text"> -<p>x86 has the ability to perform loads and stores to different address spaces +<p>x86 has an experimental feature which provides + the ability to perform loads and stores to different address spaces via the x86 segment registers. A segment override prefix byte on an instruction causes the instruction's memory access to go to the specified segment. LLVM address space 0 is the default address space, which includes @@ -1848,9 +1849,30 @@ OperandTy: VirtReg, | VirtReg, UnsImm, VirtReg, SignExtImm address space 257. Other x86 segments have yet to be allocated address space numbers.</p> -<p>Some operating systems use the FS/GS-segment to implement TLS, so care - should be taken when reading and writing to address space 256/257 on these - platforms.</p> +<p>While these address spaces may seem similar to TLS via the + <tt>thread_local</tt> keyword, and often use the same underlying hardware, + there are some fundamental differences.</p> + +<p>The <tt>thread_local</tt> keyword applies to global variables and + specifies that they are to be allocated in thread-local memory. There are + no type qualifiers involved, and these variables can be pointed to with + normal pointers and accessed with normal loads and stores. + The <tt>thread_local</tt> keyword is target-independent at the LLVM IR + level (though LLVM doesn't yet have implementations of it for some + configurations).<p> + +<p>Special address spaces, in contrast, apply to static types. Every + load and store has a particular address space in its address operand type, + and this is what determines which address space is accessed. + LLVM ignores these special address space qualifiers on global variables, + and does not provide a way to directly allocate storage in them. + At the LLVM IR level, the behavior of these special address spaces depends + in part on the underlying OS or runtime environment, and they are specific + to x86 (and LLVM doesn't yet handle them correctly in some cases).</p> + +<p>Some operating systems and runtime environments use (or may in the future + use) the FS/GS-segment registers for various low-level purposes, so care + should be taken when considering them.</p> </div> |