예제 #1
0
파일: Nx1Partition.cs 프로젝트: 0xCM/arrows
 /// <summary>
 /// Partitions 32 bits from the source into 16 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 BitBlock16 part16x1(ushort src, ref BitBlock16 dst)
 {
     dst.Bit0  = project <byte>(select(src, Part32x1.Part0), Part32x1.First);
     dst.Bit1  = project <byte>(select(src, Part32x1.Part1), Part32x1.First);
     dst.Bit2  = project <byte>(select(src, Part32x1.Part2), Part32x1.First);
     dst.Bit3  = project <byte>(select(src, Part32x1.Part3), Part32x1.First);
     dst.Bit4  = project <byte>(select(src, Part32x1.Part4), Part32x1.First);
     dst.Bit5  = project <byte>(select(src, Part32x1.Part5), Part32x1.First);
     dst.Bit6  = project <byte>(select(src, Part32x1.Part6), Part32x1.First);
     dst.Bit7  = project <byte>(select(src, Part32x1.Part7), Part32x1.First);
     dst.Bit8  = project <byte>(select(src, Part32x1.Part8), Part32x1.First);
     dst.Bit9  = project <byte>(select(src, Part32x1.Part9), Part32x1.First);
     dst.Bit10 = project <byte>(select(src, Part32x1.Part10), Part32x1.First);
     dst.Bit11 = project <byte>(select(src, Part32x1.Part11), Part32x1.First);
     dst.Bit12 = project <byte>(select(src, Part32x1.Part12), Part32x1.First);
     dst.Bit13 = project <byte>(select(src, Part32x1.Part13), Part32x1.First);
     dst.Bit14 = project <byte>(select(src, Part32x1.Part14), Part32x1.First);
     dst.Bit15 = project <byte>(select(src, Part32x1.Part15), Part32x1.First);
     return(ref dst);
 }
예제 #2
0
파일: BitBlock16.cs 프로젝트: 0xCM/arrows
 public static ref byte uint8(ref BitBlock16 src, BitPos i)
 => ref Unsafe.Add(ref Unsafe.As <BitBlock16, byte>(ref src), i);
예제 #3
0
파일: BitBlock16.cs 프로젝트: 0xCM/arrows
 public static ref ulong uint64(ref BitBlock16 src, N1 hi)
 => ref Unsafe.As <BitBlock8, ulong>(ref src.Block8x1);