Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::CountZeros< uint64_t > Struct Reference

Static Public Member Functions

static idx_t Leading (const uint64_t value_in)
 
static idx_t Trailing (uint64_t value_in)
 

Member Function Documentation

◆ Leading()

static idx_t duckdb::CountZeros< uint64_t >::Leading ( const uint64_t  value_in)
inlinestatic
48088 {
48089 if (!value_in) {
48090 return 64;
48091 }
48092
48093 uint64_t value = value_in;
48094
48095 constexpr uint64_t index64msb[] = {0, 47, 1, 56, 48, 27, 2, 60, 57, 49, 41, 37, 28, 16, 3, 61,
48096 54, 58, 35, 52, 50, 42, 21, 44, 38, 32, 29, 23, 17, 11, 4, 62,
48097 46, 55, 26, 59, 40, 36, 15, 53, 34, 51, 20, 43, 31, 22, 10, 45,
48098 25, 39, 14, 33, 19, 30, 9, 24, 13, 18, 8, 12, 7, 6, 5, 63};
48099
48100 constexpr uint64_t debruijn64msb = 0X03F79D71B4CB0A89;
48101
48102 value |= value >> 1;
48103 value |= value >> 2;
48104 value |= value >> 4;
48105 value |= value >> 8;
48106 value |= value >> 16;
48107 value |= value >> 32;
48108 auto result = 63 - index64msb[(value * debruijn64msb) >> 58];
48109#ifdef __clang__
48110 D_ASSERT(result == static_cast<uint64_t>(__builtin_clzl(value_in)));
48111#endif
48112 return result;
48113 }
::uint64_t uint64_t

◆ Trailing()

static idx_t duckdb::CountZeros< uint64_t >::Trailing ( uint64_t  value_in)
inlinestatic
48114 {
48115 if (!value_in) {
48116 return 64;
48117 }
48118 uint64_t value = value_in;
48119
48120 constexpr uint64_t index64lsb[] = {63, 0, 58, 1, 59, 47, 53, 2, 60, 39, 48, 27, 54, 33, 42, 3,
48121 61, 51, 37, 40, 49, 18, 28, 20, 55, 30, 34, 11, 43, 14, 22, 4,
48122 62, 57, 46, 52, 38, 26, 32, 41, 50, 36, 17, 19, 29, 10, 13, 21,
48123 56, 45, 25, 31, 35, 16, 9, 12, 44, 24, 15, 8, 23, 7, 6, 5};
48124 constexpr uint64_t debruijn64lsb = 0x07EDD5E59A4E28C2ULL;
48125 auto result = index64lsb[((value & -value) * debruijn64lsb) >> 58];
48126#ifdef __clang__
48127 D_ASSERT(result == static_cast<uint64_t>(__builtin_ctzl(value_in)));
48128#endif
48129 return result;
48130 }

The documentation for this struct was generated from the following file: