diff --git a/docs/CodeGenerator.html b/docs/CodeGenerator.html index e620c1782e9..dd9cd4a45ba 100644 --- a/docs/CodeGenerator.html +++ b/docs/CodeGenerator.html @@ -1838,7 +1838,8 @@ OperandTy: VirtReg, | VirtReg, UnsImm, VirtReg, SignExtImm
-

x86 has the ability to perform loads and stores to different address spaces +

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.

-

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.

+

While these address spaces may seem similar to TLS via the + thread_local keyword, and often use the same underlying hardware, + there are some fundamental differences.

+ +

The thread_local 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 thread_local keyword is target-independent at the LLVM IR + level (though LLVM doesn't yet have implementations of it for some + configurations).

+ +

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).

+ +

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.