Example #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));
 }
Example #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);
Example #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);
        }
Example #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);
 }
Example #5
0
 public static XMM vpblendw(XMM xmm2, XMM xmm3, Imm8 imm8)
 {
     return(Blend(vload <ushort>(ref xmm2), vload <ushort>(ref xmm3), imm8));
 }
Example #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);
Example #7
0
File: Reg.cs Project: 0xCM/arrows
 public static ref XMM move <T>(Vector128 <T> src, ref XMM dst)
     where T : unmanaged
 {
     dst = XMM.From(src);
     return(ref dst);
 }
Example #8
0
 XMEM(XMM xmm)
     : this()
 {
     this.xmm = xmm;
 }
Example #9
0
 public static XMM pxor(XMM xmm0, XMM xmm1)
 => Xor(vload <ulong>(ref xmm0), vload <ulong>(ref xmm1));
Example #10
0
 public unsafe static ref XMEM movdqa(XMM src, ref XMEM dst)
 {
     dst = vload <ulong>(ref src);
     return(ref dst);
 }
Example #11
0
 public static XMM vpcmpeqb(XMM xmm0, XMM xmm1)
 => CompareEqual(vload <byte>(ref xmm0), vload <byte>(ref xmm1));
Example #12
0
 public static XMM pmovzxbd32(XMM a)
 => ConvertToVector128Int32(vload <byte>(ref a));
Example #13
0
 public static XMM pmovzxdq(XMM a)
 => ConvertToVector128Int64(vload <uint>(ref a));
Example #14
0
 public static XMM pmovzxwd(XMM a)
 => ConvertToVector128Int32(vload <ushort>(ref a));
Example #15
0
 static ref XMM pmovzxbd_out_xmm(XMM a, out XMM dst)
 {
     dst = ConvertToVector128Int32(vload <byte>(ref a));
     return(ref dst);
 }