Lines Matching refs:width
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()
421 const auto mask = MaskLeastSignificant<T>(width); 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()
447 if (width != 0u) { in BitFieldInsert()
448 DCHECK_GE(MaxInt<T2>(width), data) << "Data out of range [too large] for bitwidth"; in BitFieldInsert()
449 DCHECK_LE(MinInt<T2>(width), data) << "Data out of range [too small] for bitwidth"; in BitFieldInsert()
453 const auto data_mask = MaskLeastSignificant<T2>(width); 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()
487 static_cast<T>((val >> lsb) & MaskLeastSignificant<T>(width)); in BitFieldExtract()
490 if (width == 0) { // Avoid underflow. in BitFieldExtract()
492 } else if (bitfield_unsigned & (1 << (width - 1))) { // Detect if sign bit was set. in BitFieldExtract()
495 const auto ones_negmask = ~MaskLeastSignificant<T>(width); in BitFieldExtract()