================ @@ -3679,6 +3679,35 @@ the arguments. Both arguments and the result have the bitwidth specified by the name of the builtin. These builtins can be used within constant expressions. +``__builtin_stdc_rotate_left`` and ``__builtin_stdc_rotate_right`` +------------------------------------------------------------------ + +**Syntax**: + +.. code-block:: c + + __builtin_stdc_rotate_left(value, count) + __builtin_stdc_rotate_right(value, count) + +**Description**: + +These builtins rotate the bits in ``value`` by ``count`` positions. The +``__builtin_stdc_rotate_left`` builtin rotates bits to the left, while +``__builtin_stdc_rotate_right`` rotates bits to the right. These builtins +accept any unsigned integer type, including ``_BitInt`` types. The rotation +count is taken modulo the bit-width of the value being rotated. These builtins +can be used within constant expressions. ---------------- efriedma-quic wrote:
What happens if the count is negative? https://github.com/llvm/llvm-project/pull/160259 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
