Skip to content

Commit

Permalink
Add FMT_CONSTEXPR to rotr instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jk-jeon authored and vitaut committed Feb 13, 2022
1 parent dba99bc commit 083510f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fmt/format-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -818,11 +818,11 @@ struct uint128_wrapper {
};

// Compilers should be able to optimize this into the ror instruction.
inline uint32_t rotr(uint32_t n, uint32_t r) noexcept {
FMT_CONSTEXPR inline uint32_t rotr(uint32_t n, uint32_t r) noexcept {
r &= 31;
return (n >> r) | (n << (32 - r));
}
inline uint64_t rotr(uint64_t n, uint32_t r) noexcept {
FMT_CONSTEXPR inline uint64_t rotr(uint64_t n, uint32_t r) noexcept {
r &= 63;
return (n >> r) | (n << (64 - r));
}
Expand Down

0 comments on commit 083510f

Please sign in to comment.