[PATCH] D16993: Add documentation for bitreverse builtins

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 8 09:02:18 PST 2016


arsenm created this revision.
arsenm added a subscriber: cfe-commits.

Description copied from intrinsic

http://reviews.llvm.org/D16993

Files:
  docs/LanguageExtensions.rst

Index: docs/LanguageExtensions.rst
===================================================================
--- docs/LanguageExtensions.rst
+++ docs/LanguageExtensions.rst
@@ -1505,6 +1505,31 @@
 
 Query for this feature with ``__has_builtin(__builtin_convertvector)``.
 
+``__builtin_bitreverse``
+---------------------
+
+* ``__builtin_bitreverse16``
+* ``__builtin_bitreverse32``
+* ``__builtin_bitreverse64``
+
+**Syntax**:
+
+.. code-block:: c++
+     __builtin_bitreverse32(x)
+
+**Examples**:
+
+.. code-block:: c++
+      uint16_t rev_x = __builtin_bitreverse16(x);
+      uint32_t rev_y = __builtin_bitreverse32(y);
+      uint64_t rev_z = __builtin_bitreverse64(z);
+
+**Description**:
+
+The '``__builtin_bitreverse``' family of builtins is used to reverse
+the bitpattern of an integer value; for example ``0b1234567`` becomes
+``0b7654321``.
+
 ``__builtin_unreachable``
 -------------------------
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16993.47215.patch
Type: text/x-patch
Size: 908 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160208/84ffca2e/attachment.bin>


More information about the cfe-commits mailing list