Lines Matching refs:value
33 static_assert(std::is_integral<T>::value, "T must be integral"); in BitSizeOf()
48 static_assert(std::is_integral<T>::value, "T must be integral"); in CLZ()
49 static_assert(std::is_unsigned<T>::value, "T must be unsigned"); in CLZ()
63 static_assert(std::is_integral<T>::value, "T must be integral"); in JAVASTYLE_CLZ()
70 static_assert(std::is_integral<T>::value, "T must be integral"); in CTZ()
82 static_assert(std::is_integral<T>::value, "T must be integral"); in JAVASTYLE_CTZ()
107 constexpr ssize_t MostSignificantBit(T value) { in MostSignificantBit() argument
108 static_assert(std::is_integral<T>::value, "T must be integral"); in MostSignificantBit()
109 static_assert(std::is_unsigned<T>::value, "T must be unsigned"); in MostSignificantBit()
111 return (value == 0) ? -1 : std::numeric_limits<T>::digits - 1 - CLZ(value); in MostSignificantBit()
116 constexpr ssize_t LeastSignificantBit(T value) { in LeastSignificantBit() argument
117 static_assert(std::is_integral<T>::value, "T must be integral"); in LeastSignificantBit()
118 static_assert(std::is_unsigned<T>::value, "T must be unsigned"); in LeastSignificantBit()
119 return (value == 0) ? -1 : CTZ(value); in LeastSignificantBit()
124 constexpr size_t MinimumBitsToStore(T value) { in MinimumBitsToStore() argument
125 return static_cast<size_t>(MostSignificantBit(value) + 1); in MinimumBitsToStore()
130 static_assert(std::is_integral<T>::value, "T must be integral"); in RoundUpToPowerOfTwo()
131 static_assert(std::is_unsigned<T>::value, "T must be unsigned"); in RoundUpToPowerOfTwo()
139 static_assert(std::is_integral<T>::value, "T must be integral"); in TruncToPowerOfTwo()
140 static_assert(std::is_unsigned<T>::value, "T must be unsigned"); in TruncToPowerOfTwo()
146 static_assert(std::is_integral<T>::value, "T must be integral"); in IsPowerOfTwo()
153 static_assert(std::is_integral<T>::value, "T must be integral"); in WhichPowerOf2()
216 #define CHECK_ALIGNED(value, alignment) \ argument
217 CHECK(::art::IsAligned<alignment>(value)) << reinterpret_cast<const void*>(value)
219 #define DCHECK_ALIGNED(value, alignment) \ argument
220 DCHECK(::art::IsAligned<alignment>(value)) << reinterpret_cast<const void*>(value)
222 #define CHECK_ALIGNED_PARAM(value, alignment) \ argument
223 CHECK(::art::IsAlignedParam(value, alignment)) << reinterpret_cast<const void*>(value)
225 #define DCHECK_ALIGNED_PARAM(value, alignment) \ argument
226 DCHECK(::art::IsAlignedParam(value, alignment)) << reinterpret_cast<const void*>(value)
228 inline uint16_t Low16Bits(uint32_t value) { in Low16Bits() argument
229 return static_cast<uint16_t>(value); in Low16Bits()
232 inline uint16_t High16Bits(uint32_t value) { in High16Bits() argument
233 return static_cast<uint16_t>(value >> 16); in High16Bits()
236 inline uint32_t Low32Bits(uint64_t value) { in Low32Bits() argument
237 return static_cast<uint32_t>(value); in Low32Bits()
240 inline uint32_t High32Bits(uint64_t value) { in High32Bits() argument
241 return static_cast<uint32_t>(value >> 32); in High32Bits()
246 inline bool IsInt(size_t N, T value) { in IsInt() argument
253 return (-limit <= value) && (value < limit); in IsInt()
265 constexpr bool IsInt(T value) { in IsInt() argument
268 static_assert(std::is_signed<T>::value, "Needs a signed type."); in IsInt()
273 (-GetIntLimit<T>(kBits) <= value) && (value < GetIntLimit<T>(kBits)); in IsInt()
277 constexpr bool IsUint(T value) { in IsUint() argument
280 static_assert(std::is_integral<T>::value, "Needs an integral type."); in IsUint()
286 return (0 <= value) && in IsUint()
288 (static_cast<unsigned_type>(value) <= GetIntLimit<unsigned_type>(kBits) * 2u - 1u)); in IsUint()
292 constexpr bool IsAbsoluteUint(T value) { in IsAbsoluteUint() argument
294 static_assert(std::is_integral<T>::value, "Needs an integral type."); in IsAbsoluteUint()
298 : IsUint<kBits>(value < 0 in IsAbsoluteUint()
299 ? static_cast<unsigned_type>(-1 - value) + 1u // Avoid overflow. in IsAbsoluteUint()
300 : static_cast<unsigned_type>(value)); in IsAbsoluteUint()
306 DCHECK(std::is_unsigned<T>::value || bits > 0u) << "bits cannot be zero for signed."; in MaxInt()
311 : std::is_signed<T>::value in MaxInt()
318 DCHECK(std::is_unsigned<T>::value || bits > 0) << "bits cannot be zero for signed."; in MinInt()
322 : std::is_signed<T>::value in MinInt()
418 inline static constexpr T BitFieldClear(T value, size_t lsb, size_t width) { in BitFieldClear() argument
419 DCHECK_GE(BitSizeOf(value), lsb + width) << "Bit field out of range for value"; in BitFieldClear()
420 const auto val = static_cast<std::make_unsigned_t<T>>(value); in BitFieldClear()
445 inline static constexpr T BitFieldInsert(T value, T2 data, size_t lsb, size_t width) { in BitFieldInsert() argument
446 DCHECK_GE(BitSizeOf(value), lsb + width) << "Bit field out of range for value"; in BitFieldInsert()
454 const auto value_cleared = BitFieldClear(value, lsb, width); in BitFieldInsert()
482 inline static constexpr T BitFieldExtract(T value, size_t lsb, size_t width) { in BitFieldExtract() argument
483 DCHECK_GE(BitSizeOf(value), lsb + width) << "Bit field out of range for value"; in BitFieldExtract()
484 const auto val = static_cast<std::make_unsigned_t<T>>(value); in BitFieldExtract()
488 if (std::is_signed<T>::value) { in BitFieldExtract()