mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Add some more documentation for x86 special address spaces.
llvm-svn: 71012
This commit is contained in:
parent
984da04cd0
commit
ad61ec36ad
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user