Lines Matching refs:width

42         public static ulong Bits(int position, int width)  in Bits()  argument
45 var pow2 = width < 64 ? (1UL << width) : 0; in Bits()
61 public static uint SetBitsFrom(uint source, uint newValue, int position, int width) in SetBitsFrom() argument
63 var mask = ((1u << width) - 1) << position; in SetBitsFrom()
68 public static ulong SetBitsFrom(ulong source, ulong newValue, int position, int width) in SetBitsFrom() argument
70 var mask = ((1UL << width) - 1) << position; in SetBitsFrom()
95 public static void ClearBits(ref uint reg, int position, int width) in ClearBits() argument
98 for(var i = 0; i < width; i++) in ClearBits()
105 public static void ClearBits(ref ulong reg, int position, int width) in ClearBits() argument
108 for(var i = 0; i < width; i++) in ClearBits()
115 public static void SetBits(ref uint reg, int position, int width) in SetBits() argument
118 for(var i = 0; i < width; i++) in SetBits()
125 public static void SetBits(ref ulong reg, int position, int width) in SetBits() argument
128 for(var i = 0; i < width; i++) in SetBits()
135 …public static void ReplaceBits(ref uint destination, uint source, int width, int destinationPositi… in ReplaceBits() argument
137 if(width < 0 || width > 32) in ReplaceBits()
141 uint mask = (uint)((1ul << width) - 1); in ReplaceBits()
151 …public static void ReplaceBits(ref ulong destination, ulong source, int width, int destinationPosi… in ReplaceBits() argument
153 if(width < 0 || width > 64) in ReplaceBits()
157 ulong mask = (width == 64) in ReplaceBits()
159 : (ulong)((1ul << width) - 1); in ReplaceBits()
170 …public static byte ReplaceBits(this byte destination, byte source, int width, int destinationPosit… in ReplaceBits() argument
172 if(width < 0 || width > 8) in ReplaceBits()
176 var mask = (byte)((1u << width) - 1); in ReplaceBits()
186 …public static uint ReplaceBits(this uint destination, uint source, int width, int destinationPosit… in ReplaceBits() argument
188 if(width < 0 || width > 32) in ReplaceBits()
192 uint mask = (uint)((1ul << width) - 1); in ReplaceBits()
202 …public static ulong ReplaceBits(this ulong destination, ulong source, int width, int destinationPo… in ReplaceBits() argument
204 if(width < 0 || width > 64) in ReplaceBits()
208 ulong mask = (width == 64 ? 0 : (1ul << width)) - 1; in ReplaceBits()
218 public static bool AreAnyBitsSet(uint reg, int position, int width) in AreAnyBitsSet() argument
220 var mask = CalculateMask(width, position); in AreAnyBitsSet()
224 public static bool AreAnyBitsSet(ulong reg, int position, int width) in AreAnyBitsSet() argument
226 var mask = CalculateQuadWordMask(width, position); in AreAnyBitsSet()
230 public static bool AreAllBitsSet(ulong reg, int position, int width) in AreAllBitsSet() argument
232 var mask = CalculateQuadWordMask(width, position); in AreAllBitsSet()
236 public static void UpdateWithShifted(ref uint reg, uint newValue, int position, int width) in UpdateWithShifted() argument
238 UpdateWith(ref reg, newValue << position, position, width); in UpdateWithShifted()
241 public static void UpdateWithShifted(ref ulong reg, ulong newValue, int position, int width) in UpdateWithShifted() argument
243 UpdateWith(ref reg, newValue << position, position, width); in UpdateWithShifted()
256 public static void UpdateWith(ref uint reg, uint newValue, int position, int width) in UpdateWith() argument
258 var mask = CalculateMask(width, position); in UpdateWith()
262 public static void UpdateWith(ref ulong reg, ulong newValue, int position, int width) in UpdateWith() argument
264 var mask = CalculateQuadWordMask(width, position); in UpdateWith()
268 public static void OrWith(ref uint reg, uint newValue, int position, int width) in OrWith() argument
270 var mask = CalculateMask(width, position); in OrWith()
274 public static void OrWith(ref ulong reg, ulong newValue, int position, int width) in OrWith() argument
276 var mask = CalculateQuadWordMask(width, position); in OrWith()
280 public static void AndWithNot(ref uint reg, uint newValue, int position, int width) in AndWithNot() argument
282 var mask = CalculateMask(width, position); in AndWithNot()
286 public static void AndWithNot(ref ulong reg, ulong newValue, int position, int width) in AndWithNot() argument
288 var mask = CalculateQuadWordMask(width, position); in AndWithNot()
292 public static void XorWith(ref uint reg, uint newValue, int position, int width) in XorWith() argument
294 var mask = CalculateMask(width, position); in XorWith()
298 public static void XorWith(ref ulong reg, ulong newValue, int position, int width) in XorWith() argument
300 var mask = CalculateQuadWordMask(width, position); in XorWith()
637 public static uint CalculateMask(int width, int position) in CalculateMask() argument
640 AssertMaskParameters(width, position, MaxWidth); in CalculateMask()
641 if(width == MaxWidth && position == 0) in CalculateMask()
645 return (1u << width) - 1 << position; in CalculateMask()
649 public static ulong CalculateQuadWordMask(int width, int position) in CalculateQuadWordMask() argument
652 AssertMaskParameters(width, position, MaxWidth); in CalculateQuadWordMask()
653 if(width == MaxWidth && position == 0) in CalculateQuadWordMask()
657 return (1ul << width) - 1 << position; in CalculateQuadWordMask()
733 private static void AssertMaskParameters(int width, int position, int maxWidth) in AssertMaskParameters() argument
735 …DebugHelper.Assert(width >= 0 && position >= 0, $"Width (0x{width:X}) and position (0x{position:X}… in AssertMaskParameters()
736 …DebugHelper.Assert(checked(width + position) <= maxWidth, $"Sum of width (0x{width:X}) and positio… in AssertMaskParameters()