20 #include <boost/utility.hpp>
21 #include <gtest/gtest.h>
54 BOOST_BINARY(1 1 1 1 1 1 1 1));
56 BOOST_BINARY(1 1 1 1 1 1 1 1));
73 static_cast<uint64_t>(0x1122334455667788)), 0x8877665544332211);
77 static_cast<int64_t>(0x1122334455667788)), 0x8877665544332211);
134 int main(
int argc,
char **argv) {
135 ::testing::InitGoogleTest(&argc, argv);
137 return RUN_ALL_TESTS();
static uint32_t RoundDownNumi64(uint32_t bits)
Returns the rounded down to 64 multiple.
static int64_t ByteSwap(int64_t value)
Swaps the byte order (i.e. endianess)
int main(int argc, char **argv)
static uint32_t RoundUpNumi32(uint32_t bits)
Returns the rounded up to 32 multiple. Used for conversions of bits to i32.
static uint64_t TrailingBits(uint64_t v, int num_bits)
Returns the 'num_bits' least-significant bits of 'v'.
static uint32_t RoundDownNumi32(uint32_t bits)
Returns the rounded up 32 multiple.
static int PopcountNoHw(uint64_t x)
static uint32_t RoundUpNumBytes(uint32_t bits)
static int RoundDownToPowerOf2(int value, int factor)
static int Ceil(int value, int divisor)
Returns the ceil of value/divisor.
static void Init()
Initialize CpuInfo.
static uint32_t RoundUpNumi64(uint32_t bits)
Returns the rounded up to 64 multiple. Used for conversions of bits to i64.
static uint32_t RoundDownNumBytes(uint32_t bits)
Returns the rounded down number of bytes that fit the number of bits.
static int Popcount(uint64_t x)
Returns the number of set bits in x.
static int RoundUpToPowerOf2(int value, int factor)
static int Log2(uint64_t x)