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`` -------------------------