v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::base::bits Namespace Reference

Classes

class  BitsIterator
 

Functions

template<typename T >
auto IterateBits (T bits)
 
template<typename T >
auto IterateBitsBackwards (T bits)
 
int32_t SignedMulHigh32 (int32_t lhs, int32_t rhs)
 
int64_t SignedMulHigh64 (int64_t u, int64_t v)
 
uint64_t UnsignedMulHigh64 (uint64_t u, uint64_t v)
 
uint32_t UnsignedMulHigh32 (uint32_t lhs, uint32_t rhs)
 
int32_t SignedMulHighAndAdd32 (int32_t lhs, int32_t rhs, int32_t acc)
 
int32_t SignedDiv32 (int32_t lhs, int32_t rhs)
 
int64_t SignedDiv64 (int64_t lhs, int64_t rhs)
 
int32_t SignedMod32 (int32_t lhs, int32_t rhs)
 
int64_t SignedMod64 (int64_t lhs, int64_t rhs)
 
int64_t SignedSaturatedAdd64 (int64_t lhs, int64_t rhs)
 
int64_t SignedSaturatedSub64 (int64_t lhs, int64_t rhs)
 
template<typename T >
requires (std::is_unsigned<T>::value && sizeof(T) <= 8)
constexpr unsigned CountPopulation (T value)
 
template<typename T >
T ReverseBits (T value)
 
template<typename T >
T ReverseBytes (T value)
 
template<class T >
constexpr std::make_unsigned_t< TUnsigned (T value)
 
template<class T >
constexpr std::make_signed_t< TSigned (T value)
 
template<typename T , unsigned bits = sizeof(T) * 8>
requires (std::is_unsigned<T>::value && sizeof(T) <= 8)
constexpr unsigned CountLeadingZeros (T value)
 
constexpr unsigned CountLeadingZeros32 (uint32_t value)
 
constexpr unsigned CountLeadingZeros64 (uint64_t value)
 
template<class T >
constexpr unsigned CountLeadingSignBits (T value)
 
template<typename T , unsigned bits = sizeof(T) * 8>
requires (std::is_integral<T>::value && sizeof(T) <= 8)
constexpr unsigned CountTrailingZeros (T value)
 
constexpr unsigned CountTrailingZeros32 (uint32_t value)
 
constexpr unsigned CountTrailingZeros64 (uint64_t value)
 
template<typename T , unsigned bits = sizeof(T) * 8>
requires (std::is_integral<T>::value && sizeof(T) <= 8)
constexpr unsigned CountTrailingZerosNonZero (T value)
 
template<typename T >
requires (std::is_integral<T>::value || std::is_enum<T>::value)
constexpr bool IsPowerOfTwo (T value)
 
template<typename T >
requires std::is_integral<T>::value
constexpr int WhichPowerOfTwo (T value)
 
V8_BASE_EXPORT constexpr uint32_t RoundUpToPowerOfTwo32 (uint32_t value)
 
V8_BASE_EXPORT constexpr uint64_t RoundUpToPowerOfTwo64 (uint64_t value)
 
constexpr size_t RoundUpToPowerOfTwo (size_t value)
 
uint32_t RoundDownToPowerOfTwo32 (uint32_t value)
 
constexpr uint32_t RotateRight32 (uint32_t value, uint32_t shift)
 
constexpr uint32_t RotateLeft32 (uint32_t value, uint32_t shift)
 
constexpr uint64_t RotateRight64 (uint64_t value, uint64_t shift)
 
constexpr uint64_t RotateLeft64 (uint64_t value, uint64_t shift)
 
bool SignedAddOverflow32 (int32_t lhs, int32_t rhs, int32_t *val)
 
bool SignedSubOverflow32 (int32_t lhs, int32_t rhs, int32_t *val)
 
bool SignedMulOverflow32 (int32_t lhs, int32_t rhs, int32_t *val)
 
bool SignedAddOverflow64 (int64_t lhs, int64_t rhs, int64_t *val)
 
bool SignedSubOverflow64 (int64_t lhs, int64_t rhs, int64_t *val)
 
bool SignedMulOverflow64 (int64_t lhs, int64_t rhs, int64_t *val)
 
bool UnsignedAddOverflow32 (uint32_t lhs, uint32_t rhs, uint32_t *val)
 
uint32_t UnsignedDiv32 (uint32_t lhs, uint32_t rhs)
 
uint64_t UnsignedDiv64 (uint64_t lhs, uint64_t rhs)
 
uint32_t UnsignedMod32 (uint32_t lhs, uint32_t rhs)
 
uint64_t UnsignedMod64 (uint64_t lhs, uint64_t rhs)
 
int32_t WraparoundAdd32 (int32_t lhs, int32_t rhs)
 
int32_t WraparoundNeg32 (int32_t x)
 
template<class T >
V8_BASE_EXPORT constexpr int BitWidth (T x)
 

Function Documentation

◆ BitWidth()

template<class T >
V8_BASE_EXPORT constexpr int v8::base::bits::BitWidth ( T x)
constexpr

Definition at line 486 of file bits.h.

Here is the call graph for this function:

◆ CountLeadingSignBits()

template<class T >
unsigned v8::base::bits::CountLeadingSignBits ( T value)
constexpr

Definition at line 132 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CountLeadingZeros()

template<typename T , unsigned bits = sizeof(T) * 8>
requires (std::is_unsigned<T>::value && sizeof(T) <= 8)
unsigned v8::base::bits::CountLeadingZeros ( T value)
inlineconstexpr

Definition at line 100 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CountLeadingZeros32()

unsigned v8::base::bits::CountLeadingZeros32 ( uint32_t value)
inlineconstexpr

Definition at line 122 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CountLeadingZeros64()

unsigned v8::base::bits::CountLeadingZeros64 ( uint64_t value)
inlineconstexpr

Definition at line 125 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CountPopulation()

template<typename T >
requires (std::is_unsigned<T>::value && sizeof(T) <= 8)
unsigned v8::base::bits::CountPopulation ( T value)
inlineconstexpr

Definition at line 26 of file bits.h.

Here is the caller graph for this function:

◆ CountTrailingZeros()

template<typename T , unsigned bits = sizeof(T) * 8>
requires (std::is_integral<T>::value && sizeof(T) <= 8)
unsigned v8::base::bits::CountTrailingZeros ( T value)
inlineconstexpr

Definition at line 144 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CountTrailingZeros32()

unsigned v8::base::bits::CountTrailingZeros32 ( uint32_t value)
inlineconstexpr

Definition at line 161 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CountTrailingZeros64()

unsigned v8::base::bits::CountTrailingZeros64 ( uint64_t value)
inlineconstexpr

Definition at line 164 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CountTrailingZerosNonZero()

template<typename T , unsigned bits = sizeof(T) * 8>
requires (std::is_integral<T>::value && sizeof(T) <= 8)
unsigned v8::base::bits::CountTrailingZerosNonZero ( T value)
inlineconstexpr

Definition at line 173 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsPowerOfTwo()

template<typename T >
requires (std::is_integral<T>::value || std::is_enum<T>::value)
bool v8::base::bits::IsPowerOfTwo ( T value)
inlineconstexpr

Definition at line 187 of file bits.h.

◆ IterateBits()

template<typename T >
auto v8::base::bits::IterateBits ( T bits)

Definition at line 43 of file bits-iterator.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IterateBitsBackwards()

template<typename T >
auto v8::base::bits::IterateBitsBackwards ( T bits)

Definition at line 49 of file bits-iterator.h.

Here is the call graph for this function:

◆ ReverseBits()

template<typename T >
T v8::base::bits::ReverseBits ( T value)

Definition at line 61 of file bits.h.

◆ ReverseBytes()

template<typename T >
T v8::base::bits::ReverseBytes ( T value)

Definition at line 74 of file bits.h.

Here is the caller graph for this function:

◆ RotateLeft32()

uint32_t v8::base::bits::RotateLeft32 ( uint32_t value,
uint32_t shift )
inlineconstexpr

Definition at line 279 of file bits.h.

Here is the caller graph for this function:

◆ RotateLeft64()

uint64_t v8::base::bits::RotateLeft64 ( uint64_t value,
uint64_t shift )
inlineconstexpr

Definition at line 289 of file bits.h.

Here is the caller graph for this function:

◆ RotateRight32()

uint32_t v8::base::bits::RotateRight32 ( uint32_t value,
uint32_t shift )
inlineconstexpr

Definition at line 274 of file bits.h.

Here is the caller graph for this function:

◆ RotateRight64()

uint64_t v8::base::bits::RotateRight64 ( uint64_t value,
uint64_t shift )
inlineconstexpr

Definition at line 284 of file bits.h.

Here is the caller graph for this function:

◆ RoundDownToPowerOfTwo32()

uint32_t v8::base::bits::RoundDownToPowerOfTwo32 ( uint32_t value)
inline

Definition at line 265 of file bits.h.

Here is the call graph for this function:

◆ RoundUpToPowerOfTwo()

size_t v8::base::bits::RoundUpToPowerOfTwo ( size_t value)
inlineconstexpr

Definition at line 252 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RoundUpToPowerOfTwo32()

V8_BASE_EXPORT constexpr uint32_t v8::base::bits::RoundUpToPowerOfTwo32 ( uint32_t value)
constexpr

Definition at line 219 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RoundUpToPowerOfTwo64()

V8_BASE_EXPORT constexpr uint64_t v8::base::bits::RoundUpToPowerOfTwo64 ( uint64_t value)
constexpr

Definition at line 235 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Signed()

template<class T >
std::make_signed_t< T > v8::base::bits::Signed ( T value)
inlineconstexpr

Definition at line 91 of file bits.h.

◆ SignedAddOverflow32()

bool v8::base::bits::SignedAddOverflow32 ( int32_t lhs,
int32_t rhs,
int32_t * val )
inline

Definition at line 296 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignedAddOverflow64()

bool v8::base::bits::SignedAddOverflow64 ( int64_t lhs,
int64_t rhs,
int64_t * val )
inline

Definition at line 338 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignedDiv32()

V8_BASE_EXPORT int32_t v8::base::bits::SignedDiv32 ( int32_t lhs,
int32_t rhs )

Definition at line 69 of file bits.cc.

Here is the caller graph for this function:

◆ SignedDiv64()

V8_BASE_EXPORT int64_t v8::base::bits::SignedDiv64 ( int64_t lhs,
int64_t rhs )

Definition at line 75 of file bits.cc.

Here is the caller graph for this function:

◆ SignedMod32()

V8_BASE_EXPORT int32_t v8::base::bits::SignedMod32 ( int32_t lhs,
int32_t rhs )

Definition at line 81 of file bits.cc.

Here is the caller graph for this function:

◆ SignedMod64()

V8_BASE_EXPORT int64_t v8::base::bits::SignedMod64 ( int64_t lhs,
int64_t rhs )

Definition at line 86 of file bits.cc.

Here is the caller graph for this function:

◆ SignedMulHigh32()

V8_BASE_EXPORT int32_t v8::base::bits::SignedMulHigh32 ( int32_t lhs,
int32_t rhs )

Definition at line 15 of file bits.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignedMulHigh64()

V8_BASE_EXPORT int64_t v8::base::bits::SignedMulHigh64 ( int64_t u,
int64_t v )

Definition at line 24 of file bits.cc.

Here is the caller graph for this function:

◆ SignedMulHighAndAdd32()

V8_BASE_EXPORT int32_t v8::base::bits::SignedMulHighAndAdd32 ( int32_t lhs,
int32_t rhs,
int32_t acc )

Definition at line 62 of file bits.cc.

Here is the call graph for this function:

◆ SignedMulOverflow32()

bool v8::base::bits::SignedMulOverflow32 ( int32_t lhs,
int32_t rhs,
int32_t * val )
inline

Definition at line 323 of file bits.h.

Here is the caller graph for this function:

◆ SignedMulOverflow64()

bool v8::base::bits::SignedMulOverflow64 ( int64_t lhs,
int64_t rhs,
int64_t * val )
inline

Definition at line 365 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignedSaturatedAdd64()

V8_BASE_EXPORT int64_t v8::base::bits::SignedSaturatedAdd64 ( int64_t lhs,
int64_t rhs )

Definition at line 91 of file bits.cc.

Here is the caller graph for this function:

◆ SignedSaturatedSub64()

V8_BASE_EXPORT int64_t v8::base::bits::SignedSaturatedSub64 ( int64_t lhs,
int64_t rhs )

Definition at line 100 of file bits.cc.

Here is the caller graph for this function:

◆ SignedSubOverflow32()

bool v8::base::bits::SignedSubOverflow32 ( int32_t lhs,
int32_t rhs,
int32_t * val )
inline

Definition at line 310 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SignedSubOverflow64()

bool v8::base::bits::SignedSubOverflow64 ( int64_t lhs,
int64_t rhs,
int64_t * val )
inline

Definition at line 352 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Unsigned()

template<class T >
std::make_unsigned_t< T > v8::base::bits::Unsigned ( T value)
inlineconstexpr

Definition at line 86 of file bits.h.

Here is the caller graph for this function:

◆ UnsignedAddOverflow32()

bool v8::base::bits::UnsignedAddOverflow32 ( uint32_t lhs,
uint32_t rhs,
uint32_t * val )
inline

Definition at line 432 of file bits.h.

Here is the caller graph for this function:

◆ UnsignedDiv32()

uint32_t v8::base::bits::UnsignedDiv32 ( uint32_t lhs,
uint32_t rhs )
inline

Definition at line 444 of file bits.h.

Here is the caller graph for this function:

◆ UnsignedDiv64()

uint64_t v8::base::bits::UnsignedDiv64 ( uint64_t lhs,
uint64_t rhs )
inline

Definition at line 450 of file bits.h.

Here is the caller graph for this function:

◆ UnsignedMod32()

uint32_t v8::base::bits::UnsignedMod32 ( uint32_t lhs,
uint32_t rhs )
inline

Definition at line 456 of file bits.h.

Here is the caller graph for this function:

◆ UnsignedMod64()

uint64_t v8::base::bits::UnsignedMod64 ( uint64_t lhs,
uint64_t rhs )
inline

Definition at line 462 of file bits.h.

Here is the caller graph for this function:

◆ UnsignedMulHigh32()

V8_BASE_EXPORT uint32_t v8::base::bits::UnsignedMulHigh32 ( uint32_t lhs,
uint32_t rhs )

Definition at line 56 of file bits.cc.

Here is the caller graph for this function:

◆ UnsignedMulHigh64()

V8_BASE_EXPORT uint64_t v8::base::bits::UnsignedMulHigh64 ( uint64_t u,
uint64_t v )

Definition at line 41 of file bits.cc.

Here is the caller graph for this function:

◆ WhichPowerOfTwo()

template<typename T >
requires std::is_integral<T>::value
int v8::base::bits::WhichPowerOfTwo ( T value)
inlineconstexpr

Definition at line 195 of file bits.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WraparoundAdd32()

int32_t v8::base::bits::WraparoundAdd32 ( int32_t lhs,
int32_t rhs )
inline

Definition at line 468 of file bits.h.

Here is the caller graph for this function:

◆ WraparoundNeg32()

int32_t v8::base::bits::WraparoundNeg32 ( int32_t x)
inline

Definition at line 473 of file bits.h.

Here is the caller graph for this function: