Static Value-Flow Analysis
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
SVF::LeadingZerosCounter< T, SizeOfT > Struct Template Reference

#include <SparseBitVector.h>

Static Public Member Functions

static unsigned count (T Val, ZeroBehavior)
 

Detailed Description

template<typename T, std::size_t SizeOfT>
struct SVF::LeadingZerosCounter< T, SizeOfT >

Definition at line 146 of file SparseBitVector.h.

Member Function Documentation

◆ count()

template<typename T , std::size_t SizeOfT>
static unsigned SVF::LeadingZerosCounter< T, SizeOfT >::count ( T  Val,
ZeroBehavior   
)
inlinestatic

Definition at line 148 of file SparseBitVector.h.

149 {
150 if (!Val)
151 return std::numeric_limits<T>::digits;
152
153 // Bisection method.
154 unsigned ZeroBits = 0;
155 for (T Shift = std::numeric_limits<T>::digits >> 1; Shift; Shift >>= 1)
156 {
157 T Tmp = Val >> Shift;
158 if (Tmp)
159 Val = Tmp;
160 else
161 ZeroBits |= Shift;
162 }
163 return ZeroBits;
164 }
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

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