mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 10:47:35 +02:00
Add FMT_CONSTEXPR to rotr instead
This commit is contained in:
committed by
Victor Zverovich
parent
dba99bc860
commit
083510f0f0
@ -818,11 +818,11 @@ struct uint128_wrapper {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Compilers should be able to optimize this into the ror instruction.
|
// 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;
|
r &= 31;
|
||||||
return (n >> r) | (n << (32 - r));
|
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;
|
r &= 63;
|
||||||
return (n >> r) | (n << (64 - r));
|
return (n >> r) | (n << (64 - r));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user