5#include "../platform/constexpr.hpp"
6#include "../platform/attributes.hpp"
26std::size_t
bit(std::size_t i)
noexcept;
38typename std::enable_if<std::is_unsigned<T>::value, T>::type
53typename std::enable_if<std::is_unsigned<T>::value, T&>::type
68typename std::enable_if<std::is_unsigned<T>::value, T&>::type
87typename std::enable_if<std::is_unsigned<T>::value, T>::type
105typename std::enable_if<std::is_unsigned<T>::value, T>::type
124typename std::enable_if<std::is_unsigned<T>::value, T>::type
143typename std::enable_if<std::is_unsigned<T>::value, T>::type
155typename std::enable_if<std::is_unsigned<T>::value,
bool>::type
169typename std::enable_if<std::is_unsigned<T>::value, T>::type
181typename std::enable_if<std::is_unsigned<T>::value, T>::type
193typename std::enable_if<std::is_unsigned<T>::value,
int>::type
205typename std::enable_if<std::is_unsigned<T>::value,
int>::type
217typename std::enable_if<std::is_unsigned<T>::value,
int>::type
229typename std::enable_if<std::is_unsigned<T>::value,
int>::type
241typename std::enable_if<std::is_unsigned<T>::value,
int>::type
253typename std::enable_if<std::is_unsigned<T>::value,
int>::type
268typename std::enable_if<std::is_unsigned<T>::value,
bool>::type
#define REXLIB_NODISCARD
Indicates that the return value should be used.
Definition attributes.hpp:76
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
REXLIB_NODISCARD REXLIB_CONSTEXPR std::size_t bit(std::size_t i) noexcept
Returns a std::size_t type with a single bit set at the provided index.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type mask_trailing_ones(T x) noexcept
Returns a mask for all the consecutive trailing '1'-s of the input word.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type count_leading_zeros(T x) noexcept
Counts the number of consecutive '0's from the MSB.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type bit_width(T x) noexcept
Returns the number of bits required to represent the input number.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type count_leading_ones(T x) noexcept
Counts the number of consecutive '1's from the MSB.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type rotate_left(T x, int s) noexcept
Returns the input word with a bitwise rotation towards the left.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, bool >::type parity(T x) noexcept
Computes the parity of the input word.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type bit_ceil(T x) noexcept
Returns the smallest power of 2 not less than the input word.
REXLIB_CONSTEXPR std::size_t end() noexcept
Get the value representing the end of an array to be used as count.
REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T & >::type set_lowest_zero_inplace(T &x) noexcept
Sets the lowest '0' bit to '1' in place.
REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T & >::type clear_lowest_one_inplace(T &x) noexcept
Sets the lowest '1' bit to '0' in place.
REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type count_trailing_zeros(T x) noexcept
Counts the number of consecutive '0's from the LSB.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, bool >::type has_single_bit(T x) noexcept
Checks if the input word has one and only one bit set to '1'.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type count_trailing_ones(T x) noexcept
Counts the number of consecutive '1's from the LSB.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type bit_range_mask(std::size_t start, std::size_t end) noexcept
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type rotate_right(T x, int s) noexcept
Returns the input word with a bitwise rotation towards the right.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type mask_trailing_zeros(T x) noexcept
Returns a mask for all the consecutive trailing '0'-s of the input word.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type popcount(T x) noexcept
Counts the number '1's in the input word.
REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type bit_floor(T x) noexcept
Returns the largest power of 2 not greater than the input word.