diff options
author | Owen Anderson <resistor@mac.com> | 2010-01-27 01:22:36 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-01-27 01:22:36 +0000 |
commit | 029eb7d24354dad4902bd7bec2731720b5f864f8 (patch) | |
tree | 48676e4e1dc90fe75ef32b8b46cedd83763f98ab /clang/docs/LanguageExtensions.html | |
parent | b473083fcd36df34ed58a4f7316c131fc2f70025 (diff) | |
download | bcm5719-llvm-029eb7d24354dad4902bd7bec2731720b5f864f8.tar.gz bcm5719-llvm-029eb7d24354dad4902bd7bec2731720b5f864f8.zip |
Clarify the documentation of ext_vector, and add a small example. Hopefully
this will alleviate some confusion about the existence of this feature.
Comments/improvements welcome.
llvm-svn: 94645
Diffstat (limited to 'clang/docs/LanguageExtensions.html')
-rw-r--r-- | clang/docs/LanguageExtensions.html | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/clang/docs/LanguageExtensions.html b/clang/docs/LanguageExtensions.html index e2a44eaed0b..d32842b5d23 100644 --- a/clang/docs/LanguageExtensions.html +++ b/clang/docs/LanguageExtensions.html @@ -205,12 +205,28 @@ is used in the file argument.</p> <h2 id="vectors">Vectors and Extended Vectors</h2> <!-- ======================================================================= --> -<p>Supports the GCC vector extensions, plus some stuff like V[1]. ext_vector -with V.xyzw syntax and other tidbits. See also <a -href="#__builtin_shufflevector">__builtin_shufflevector</a>.</p> +<p>Supports the GCC vector extensions, plus some stuff like V[1].</p> + +<p>Also supports <tt>ext_vector</tt>, which additionally support for V.xyzw +syntax and other tidbits as seen in OpenCL. An example is:</p> + +<blockquote> +<pre> +typedef float float4 <b>__attribute__((ext_vector_type(4)))</b>; +typedef float float2 <b>__attribute__((ext_vector_type(2)))</b>; + +float4 foo(float2 a, float2 b) { + float4 c; + c.xz = a; + c.yw = b; + return c; +} +</blockquote> <p>Query for this feature with __has_feature(attribute_ext_vector_type).</p> +<p>See also <a href="#__builtin_shufflevector">__builtin_shufflevector</a>.</p> + <!-- ======================================================================= --> <h2 id="checking_language_features">Checks for Standard Language Features</h2> <!-- ======================================================================= --> |