Theoretica
Scientific Computing
Loading...
Searching...
No Matches
bits.h File Reference

Operations on bits. More...

#include <cstdint>
#include "./core_traits.h"

Go to the source code of this file.

Namespaces

namespace  theoretica
 Main namespace of the library which contains all functions and objects.
 
namespace  theoretica::bits
 Operations on bits.
 

Functions

constexpr void theoretica::bits::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 theoretica::bits::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 theoretica::bits::bit_rotate (UnsignedIntType x, unsigned int i)
 Bit rotation of unsigned integer types using shifts.
 
template<typename Vector , enable_vector< Vector > = true>
constexpr void theoretica::bits::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.
 

Detailed Description

Operations on bits.