Beispiel #1
0
 public void vpblendw_check()
 {
     xmm(2) = XMM.FromCells <ushort>(1, 2, 3, 4, 5, 6, 7, 8);
     xmm(3) = XMM.FromCells <ushort>(9, 10, 11, 12, 13, 14, 15, 16);
     xmm(0) = XMM.FromCells <ushort>(9, 2, 11, 4, 13, 6, 15, 8);
     xmm(1) = vpblendw(xmm(2), xmm(3), imm8(1, 0, 1, 0, 1, 0, 1, 0));
 }
Beispiel #2
0
        void xmm_create <T>()
            where T : unmanaged
        {
            var cellcount = XMM.CellCount <T>();

            Claim.eq(cellcount, Vec128 <T> .Length);

            var xmmWidth = XMM.BitWidth;

            Claim.eq(xmmWidth, Vec128 <T> .ByteCount * 8);

            var cellwidth = XMM.CellWidth <T>();

            Claim.eq(cellwidth, bitsize <T>());

            var celldata = Random.Array <T>(cellcount);
            var xmm      = XMM.FromCells(celldata);

            for (var i = 0; i < cellcount; i++)
            {
                Claim.eq(xmm.Cell <T>(i), celldata[i]);
            }

            var bitmap = XMM.BitMap <T>();

            Claim.eq(bitmap.CellCount, cellcount);
            Claim.eq(bitmap.CellWidth, cellwidth);
            check_bitmap(bitmap);

            for (int i = 0, k = 0; i < bitmap.CellCount; i++)
            {
                ref readonly var index = ref bitmap.Cell(i * bitmap.CellWidth);
Beispiel #3
0
        public string vpblendw_report()
        {
            var report = sbuild();

            xmm(2) = XMM.FromCells <ushort>(1, 2, 3, 4, 5, 6, 7, 8);
            report.AppendLine(FormatXmm <ushort>(2));

            xmm(3) = XMM.FromCells <ushort>(9, 10, 11, 12, 13, 14, 15, 16);
            report.AppendLine(FormatXmm <ushort>(3));

            var imm = imm8(1, 0, 1, 0, 1, 0, 1, 0);

            report.AppendLine(FormatImm <ushort>(imm));

            xmm(1) = vpblendw(xmm(2), xmm(3), imm);

            report.Append(FormatXmm <ushort>(1));

            var text = report.ToString();

            Trace(text);
            return(text);
        }
Beispiel #4
0
 public void xmm_cpu()
 {
     xmm(4) = XMM.FromCells(5ul, 10ul);
     Claim.eq(xmm(4).Cell <ulong>(0), 5ul);
     Claim.eq(xmm(4).Cell <ulong>(1), 10ul);
 }
Beispiel #5
0
 public static XMM vpblendw(XMM xmm2, XMM xmm3, Imm8 imm8)
 {
     return(Blend(vload <ushort>(ref xmm2), vload <ushort>(ref xmm3), imm8));
 }
Beispiel #6
0
 public static XMM Xmm <T>(this IPolyrand random, Interval <T> domain, Func <T, bool> filter = null)
     where T : unmanaged
 => XMM.From(random.Span128 <T>(1, domain, filter).Unblocked);
Beispiel #7
0
 public static ref XMM move <T>(Vector128 <T> src, ref XMM dst)
     where T : unmanaged
 {
     dst = XMM.From(src);
     return(ref dst);
 }
Beispiel #8
0
 XMEM(XMM xmm)
     : this()
 {
     this.xmm = xmm;
 }
Beispiel #9
0
 public static XMM pxor(XMM xmm0, XMM xmm1)
 => Xor(vload <ulong>(ref xmm0), vload <ulong>(ref xmm1));
Beispiel #10
0
 public unsafe static ref XMEM movdqa(XMM src, ref XMEM dst)
 {
     dst = vload <ulong>(ref src);
     return(ref dst);
 }
Beispiel #11
0
 public static XMM vpcmpeqb(XMM xmm0, XMM xmm1)
 => CompareEqual(vload <byte>(ref xmm0), vload <byte>(ref xmm1));
Beispiel #12
0
 public static XMM pmovzxbd32(XMM a)
 => ConvertToVector128Int32(vload <byte>(ref a));
Beispiel #13
0
 public static XMM pmovzxdq(XMM a)
 => ConvertToVector128Int64(vload <uint>(ref a));
Beispiel #14
0
 public static XMM pmovzxwd(XMM a)
 => ConvertToVector128Int32(vload <ushort>(ref a));
Beispiel #15
0
 static ref XMM pmovzxbd_out_xmm(XMM a, out XMM dst)
 {
     dst = ConvertToVector128Int32(vload <byte>(ref a));
     return(ref dst);
 }