LLVM 20.0.0git
|
This file implements methods to test, set and extract typed bits from packed unsigned integers. More...
#include <cassert>
#include <climits>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <type_traits>
Go to the source code of this file.
Classes | |
struct | llvm::bitfields_details::BitPatterns< T, Bits > |
A struct defining useful bit patterns for n-bits integer types. More... | |
struct | llvm::bitfields_details::Compressor< T, Bits, bool > |
Compressor is used to manipulate the bits of a (possibly signed) integer type so it can be packed and unpacked into a bits sized integer, Compressor is specialized on signed-ness so no runtime cost is incurred. More... | |
struct | llvm::bitfields_details::Compressor< T, Bits, false > |
struct | llvm::bitfields_details::Impl< Bitfield, StorageType > |
Impl is where Bifield description and Storage are put together to interact with values. More... | |
struct | llvm::bitfields_details::ResolveUnderlyingType< T, bool > |
Bitfield deals with the following type: More... | |
struct | llvm::bitfields_details::ResolveUnderlyingType< T, false > |
struct | llvm::bitfields_details::ResolveUnderlyingType< bool, false > |
struct | llvm::Bitfield |
Holds functions to get, set or test bitfields. More... | |
struct | llvm::Bitfield::Element< T, Offset, Size, MaxValue > |
Describes an element of a Bitfield. More... | |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
namespace | llvm::bitfields_details |
This file implements methods to test, set and extract typed bits from packed unsigned integers.
C++ bitfields do not offer control over the bit layout nor consistent behavior when it comes to out of range values. For instance, the layout is implementation defined and adjacent bits may be packed together but are not required to. This is problematic when storage is sparse and data must be stored in a particular integer type.
The methods provided in this file ensure precise control over the layout/storage as well as protection against out of range values.
Definition in file Bitfields.h.