C++ Logo

std-proposals

Advanced search

Re: Rotate Bits Left or Right

From: Charles Milette <charlesmilette_at_[hidden]>
Date: Sun, 26 Jan 2020 12:05:10 -0500
There is std::rotl and std::rotr as part of C++20 <bit>

On Sun, Jan 26, 2020, 12:03 Walt Karas via Std-Proposals <
std-proposals_at_[hidden]> wrote:

>
>
>
>
>
>
> Relying on the optimizer seems a viable option:
> https://godbolt.org/z/jbJBv3
>
> ...
> Date: Sun, 26 Jan 2020 09:03:29 +0100
> From: "Kjetil Kristoffer Solberg" <post_at_[hidden]>
> To: <std-proposals_at_[hidden]>
> Subject: [std-proposals] Rotate Bits Left or Right
> Message-ID: <003701d5d41f$1a7ef420$4f7cdc60$_at_[hidden]>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi!
>
> Shouldn't there be a rotate bits left and rotate bits right operator? The
> way I have seen rotate done
>
> is pretty ugly. There are instructions in x86 and other instructions sets
> for rotation. Why not have it in the C++ standard?
>
>
>
> NB! I have not checked if this question have been asked a million times
> before.
>
>
>
> Regards
>
> Kjetil
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2020-01-26 11:07:58