Exemple #1
0
 /// <summary>
 /// Partitions 8 bits of a source into 8 target segments of effective width 1
 /// </summary>
 /// <param name="src">The source value</param>
 /// <param name="dst">A target span of sufficient length</param>
 public static ref BitBlock8 part8x1(uint src, ref BitBlock8 dst)
 {
     dst.Bit1 = project <byte>(select(src, Part8x1.Part0), Part8x1.First);
     dst.Bit2 = project <byte>(select(src, Part8x1.Part1), Part8x1.First);
     dst.Bit3 = project <byte>(select(src, Part8x1.Part2), Part8x1.First);
     dst.Bit4 = project <byte>(select(src, Part8x1.Part3), Part8x1.First);
     dst.Bit5 = project <byte>(select(src, Part8x1.Part4), Part8x1.First);
     dst.Bit6 = project <byte>(select(src, Part8x1.Part5), Part8x1.First);
     dst.Bit7 = project <byte>(select(src, Part8x1.Part6), Part8x1.First);
     return(ref dst);
 }
Exemple #2
0
 static ref ulong uint64(ref BitBlock8 src)
 => ref Unsafe.As <BitBlock8, ulong>(ref src);