Operations on bits.
More...
|
| constexpr void | mul_uint128 (uint64_t a, uint64_t b, uint64_t &c_low, uint64_t &c_high) |
| | Multiply two 64-bit unsigned integers and store the result in two 64-bit variables, keeping 128 bits of the result.
|
| |
| constexpr uint64_t | mix_mum (uint64_t a, uint64_t b) |
| | MUM bit mixing function, computes the 128-bit product of a and b and the XOR of their high and low 64-bit parts.
|
| |
| template<typename UnsignedIntType > |
| constexpr UnsignedIntType | bit_rotate (UnsignedIntType x, unsigned int i) |
| | Bit rotation of unsigned integer types using shifts.
|
| |
| template<typename Vector , enable_vector< Vector > = true> |
| constexpr void | swap_bit_reverse (Vector &x, unsigned int m) |
| | Swap the elements of a vector pair-wise, by exchanging elements with indices related by bit reversion (e.g.
|
| |
◆ bit_rotate()
Bit rotation of unsigned integer types using shifts.
- Parameters
-
| x | The unsigned integer to rotate the bits of |
| i | The index of the rotated bits |
- Returns
- The unsigned integer with the given bits rotated
◆ mix_mum()
MUM bit mixing function, computes the 128-bit product of a and b and the XOR of their high and low 64-bit parts.
- Parameters
-
| a | The first operand |
| b | The second operand |
- Returns
- The XOR of the high and low bits of the 128-bit product of a and b.
◆ mul_uint128()
Multiply two 64-bit unsigned integers and store the result in two 64-bit variables, keeping 128 bits of the result.
- Parameters
-
| a | The first number to multiply |
| b | The second number to multiply |
| c_low | The variable to store the lowest 64 bits of the result. |
| c_high | The variable to store the highest 64 bits of the result. |
◆ swap_bit_reverse()
Swap the elements of a vector pair-wise, by exchanging elements with indices related by bit reversion (e.g.
\(110_2\) and \(011_2\)).
- Parameters
-
| x | The vector of elements to swap in-place |
| m | The maximum bit to consider when computing bit reversion |