14template <
typename AddressType,
unsigned MW,
unsigned MAX_E>
15AddressType RVYCapabilityFormat<AddressType, MW, MAX_E>::getAlignmentMaskImpl(
17 static constexpr unsigned int IE_TAKE_BITS = 3;
23 uint64_t Slice =
static_cast<uint64_t
>(
Length) >> (MW - 1);
27 bool IE = (
E != 0) || ((
static_cast<uint64_t
>(
Length) >> (MW - 2)) & 1);
29 unsigned int Eprime =
IE ? (
E + IE_TAKE_BITS) : 0;
31 assert(
E <= MAX_E &&
"Raw exponent exceeds architecture maximum");
32 assert(Eprime <=
sizeof(AddressType) * 8 &&
33 "Shift amount exceeds integer width");
46uint32_t CHERIoTCapabilityFormat::getAlignmentMaskImpl(uint32_t
Length) {
48 constexpr uint32_t NINE_SET_BITS = 511;
50 if (
Length > NINE_SET_BITS << 14)
54 if (
Length > NINE_SET_BITS <<
E)
56 assert(
E <= 14 &&
"CHERIoT capabilities cannot encode E between 14 and 24");
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file implements the C++20 <bit> header.
This is an optimization pass for GlobalISel generic memory operations.
int countl_zero(T Val)
Count number of 0's from the most significant bit to the least stopping at the first 1.