LLVM 20.0.0git
|
A struct defining useful bit patterns for n-bits integer types. More...
#include "llvm/ADT/Bitfields.h"
Public Types | |
using | Unsigned = std::make_unsigned_t< T > |
Bit patterns are forged using the equivalent Unsigned type because of undefined operations over signed types (e.g. | |
Static Public Attributes | |
static constexpr unsigned | TypeBits = sizeof(Unsigned) * CHAR_BIT |
static constexpr Unsigned | AllZeros = Unsigned(0) |
e.g. with TypeBits == 8 and Bits == 6. | |
static constexpr Unsigned | AllOnes = ~Unsigned(0) |
static constexpr Unsigned | Umin = AllZeros |
static constexpr Unsigned | Umax = AllOnes >> (TypeBits - Bits) |
static constexpr Unsigned | SignBitMask = Unsigned(1) << (Bits - 1) |
static constexpr Unsigned | Smax = Umax >> 1U |
static constexpr Unsigned | Smin = ~Smax |
static constexpr Unsigned | SignExtend = Unsigned(Smin << 1U) |
A struct defining useful bit patterns for n-bits integer types.
Definition at line 94 of file Bitfields.h.
using llvm::bitfields_details::BitPatterns< T, Bits >::Unsigned = std::make_unsigned_t<T> |
Bit patterns are forged using the equivalent Unsigned
type because of undefined operations over signed types (e.g.
Bitwise shift operators). Moreover same size casting from unsigned to signed is well defined but not the other way around.
Definition at line 99 of file Bitfields.h.
|
staticconstexpr |
Definition at line 107 of file Bitfields.h.
|
staticconstexpr |
e.g. with TypeBits == 8 and Bits == 6.
Definition at line 106 of file Bitfields.h.
|
staticconstexpr |
Definition at line 110 of file Bitfields.h.
Referenced by llvm::bitfields_details::Compressor< T, Bits, false >::unpack().
|
staticconstexpr |
Definition at line 113 of file Bitfields.h.
Referenced by llvm::bitfields_details::Compressor< T, Bits, false >::unpack().
|
staticconstexpr |
Definition at line 111 of file Bitfields.h.
Referenced by llvm::bitfields_details::Compressor< T, Bits, false >::pack().
|
staticconstexpr |
Definition at line 112 of file Bitfields.h.
Referenced by llvm::bitfields_details::Compressor< T, Bits, false >::pack().
|
staticconstexpr |
Definition at line 102 of file Bitfields.h.
|
staticconstexpr |
Definition at line 109 of file Bitfields.h.
Referenced by llvm::bitfields_details::Compressor< T, Bits, bool >::pack().
|
staticconstexpr |
Definition at line 108 of file Bitfields.h.