From: Chris Lattner
Date: Thu, 9 Apr 2009 19:58:15 +0000 (+0000)
Subject: document the x86 address space extension for GS.
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1177f91c0ade1e1b893c11935bba2137ccc85316;p=clang
document the x86 address space extension for GS.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68724 91177308-0d34-0410-b5e6-96231b3b80d8
---
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html
index 5b8518b330..d73e3026b1 100644
--- a/docs/LanguageExtensions.html
+++ b/docs/LanguageExtensions.html
@@ -27,6 +27,11 @@ td {
__builtin_shufflevector
+Target-Specific Extensions
+
+
@@ -224,6 +229,45 @@ with the same element type as vec1/vec2 but that has an element count equal to
the number of indices specified.
+
+Target-Specific Extensions
+
+
+Clang supports some language features conditionally on some targets.
+
+
+X86/X86-64 Language Extensions
+
+
+The X86 backend has these language extensions:
+
+
+Memory references off the GS segment
+
+
+Annotating a pointer with address space #256 causes it to be code generated
+relative to the X86 GS segment register.
+Note that this is a very very low-level feature that should only be used if you
+know what you're doing (for example in an OS kernel).
+
+Here is an example:
+
+
+#define GS_RELATIVE __attribute__((address_space(256)))
+int foo(int GS_RELATIVE *P) {
+ return *P;
+}
+
+
+Which compiles to (on X86-32):
+
+
+_foo:
+ movl 4(%esp), %eax
+ movl %gs:(%eax), %eax
+ ret
+
+