================ @@ -3680,6 +3680,37 @@ 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 treated as an unsigned value and taken modulo the bit-width of the +value being rotated. Negative rotation counts are converted to their unsigned +equivalent before the modulo operation. These builtins can be used within ---------------- philnik777 wrote:
Wouldn't it make more sense to simply reject signed types? https://github.com/llvm/llvm-project/pull/160259 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits