25#ifndef MY_BIT_INCLUDED
26#define MY_BIT_INCLUDED
49 for (bit = 0; value > 1; value >>= 1, bit++)
55#if SIZEOF_LONG_LONG > 4
58 ulong v2 = (ulong)(v >> 32);
136template <
typename IntType>
155 return bits != 0 && (bits & (bits - 1)) == 0;
static uint32 my_round_up_to_next_power(uint32 v)
Definition: my_bit.h:101
static uint my_bit_log2(ulong value)
Definition: my_bit.h:47
static uint my_count_bits(ulonglong v)
Definition: my_bit.h:54
static uint32 my_reverse_bits(uint32 key)
Definition: my_bit.h:121
const uchar _my_bits_reverse_table[256]
Definition: my_bit.cc:52
static uint my_count_bits_uint32(uint32 v)
Definition: my_bit.h:75
const char _my_bits_nbits[256]
Definition: my_bit.cc:35
constexpr bool is_single_bit(IntType bits)
Determine if a single bit is set among some bits.
Definition: my_bit.h:137
static uint32 my_clear_highest_bit(uint32 v)
Definition: my_bit.h:111
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
uint32_t uint32
Definition: my_inttypes.h:67
required string key
Definition: replication_asynchronous_connection_failover.proto:60
unsigned int uint
Definition: uca9-dump.cc:75