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 144 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 146 of file SparseBitVector.h.

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

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