diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
| commit | 4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch) | |
| tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /docs/LanguageExtensions.html | |
| parent | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff) | |
Notes
Diffstat (limited to 'docs/LanguageExtensions.html')
| -rw-r--r-- | docs/LanguageExtensions.html | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/docs/LanguageExtensions.html b/docs/LanguageExtensions.html index c855a5057a62..9ac35e1dc2dc 100644 --- a/docs/LanguageExtensions.html +++ b/docs/LanguageExtensions.html @@ -27,6 +27,7 @@ td { <li><a href="#builtins">Builtin Functions</a> <ul> <li><a href="#__builtin_shufflevector">__builtin_shufflevector</a></li> + <li><a href="#__builtin_unreachable">__builtin_unreachable</a></li> </ul> </li> <li><a href="#targetspecific">Target-Specific Extensions</a> @@ -264,7 +265,7 @@ builtins that we need to implement.</p> <h3 id="__builtin_shufflevector">__builtin_shufflevector</h3> <!-- ======================================================================= --> -<p><tt>__builtin_shufflevector</tt> is used to expression generic vector +<p><tt>__builtin_shufflevector</tt> is used to express generic vector permutation/shuffle/swizzle operations. This builtin is also very important for the implementation of various target-specific header files like <tt><xmmintrin.h></tt>. @@ -310,6 +311,47 @@ with the same element type as vec1/vec2 but that has an element count equal to the number of indices specified. </p> +<p>Query for this feature with __has_builtin(__builtin_shufflevector).</p> + +<!-- ======================================================================= --> +<h3 id="__builtin_unreachable">__builtin_unreachable</h3> +<!-- ======================================================================= --> + +<p><tt>__builtin_unreachable</tt> is used to indicate that a specific point in +the program cannot be reached, even if the compiler might otherwise think it +can. This is useful to improve optimization and eliminates certain warnings. +For example, without the <tt>__builtin_unreachable</tt> in the example below, +the compiler assumes that the inline asm can fall through and prints a "function +declared 'noreturn' should not return" warning. +</p> + +<p><b>Syntax:</b></p> + +<pre> +__builtin_unreachable() +</pre> + +<p><b>Example of Use:</b></p> + +<pre> +void myabort(void) __attribute__((noreturn)); +void myabort(void) { + asm("int3"); + __builtin_unreachable(); +} +</pre> + +<p><b>Description:</b></p> + +<p>The __builtin_unreachable() builtin has completely undefined behavior. Since +it has undefined behavior, it is a statement that it is never reached and the +optimizer can take advantage of this to produce better code. This builtin takes +no arguments and produces a void result. +</p> + +<p>Query for this feature with __has_builtin(__builtin_unreachable).</p> + + <!-- ======================================================================= --> <h2 id="targetspecific">Target-Specific Extensions</h2> <!-- ======================================================================= --> |
