예제 #1
0
        public override void GenerateX86NasmAsm(StringBuilder sb)
        {
            string[] dependentLoads = new string[4];
            dependentLoads[0] = "  mov r15, [r8 + rdi * 4]";
            dependentLoads[1] = "  mov r14, [r8 + rdi * 4]";
            dependentLoads[2] = "  mov r13, [r8 + rdi * 4]";
            dependentLoads[3] = "  mov r12, [r8 + rdi * 4]";

            string[] indepLoads = new string[4];
            indepLoads[0] = "  mov r15, [r8]";
            indepLoads[1] = "  mov r14, [r8]";
            indepLoads[2] = "  mov r13, [r8]";
            indepLoads[3] = "  mov r12, [r8]";
            UarchTestHelpers.GenerateX86NasmNsqTestFuncs(sb, this.high, this.Counts, this.Prefix, dependentLoads, indepLoads, true);
        }
예제 #2
0
        public override void GenerateX86NasmAsm(StringBuilder sb)
        {
            string initInstrs    = "  movq xmm3, r11\n  xorps xmm1, xmm1\n  xorps xmm2, xmm2\n  xorps xmm4, xmm4\n  xorps xmm5, xmm5\n";
            string postLoadInstr = "  cvtsi2ss xmm0, rdi";

            string[] depAdds = new string[2];
            depAdds[0] = "  addss xmm1, xmm0";
            depAdds[1] = "  addss xmm2, xmm0";

            string[] indepAdds = new string[2];
            indepAdds[0] = "  addss xmm4, xmm3";
            indepAdds[1] = "  addss xmm5, xmm3";

            UarchTestHelpers.GenerateX86NasmNsqTestFuncs(sb, this.high, this.Counts, this.Prefix, depAdds, indepAdds, false, initInstrs, postLoadInstr);
        }
        public override void GenerateX86NasmAsm(StringBuilder sb)
        {
            string initInstrs    = "  pxor xmm3, xmm3\n  pxor xmm4, xmm4\n  movq r15, xmm5\n";
            string postLoadInstr = "  movq xmm0, rdi";

            //string postLoadInstr2 = "  movq xmm0, rsi";

            string[] depAdds = new string[2];
            depAdds[0] = "  paddd xmm1, xmm0";
            depAdds[1] = "  paddd xmm2, xmm0";

            string[] indepAdds = new string[2];
            indepAdds[0] = "  paddd xmm5, xmm3";
            indepAdds[1] = "  paddd xmm6, xmm4";
            UarchTestHelpers.GenerateX86NasmNsqTestFuncs(sb, this.high, this.Counts, this.Prefix, depAdds, indepAdds, false, initInstrs, postLoadInstr);
        }
예제 #4
0
        public override void GenerateX86NasmAsm(StringBuilder sb)
        {
            string ohnoLabelName = "jumpnsq_reallybadthing";

            string[] dependentJumps = new string[1];
            dependentJumps[0] = $"  cmp rdi, rsi\n  je {ohnoLabelName}";

            // R14 is set to 1, so the test instruction will never set the zero flag
            string[] independentJumps = new string[1];
            independentJumps[0] = $" test r14, r14\n  je {ohnoLabelName}";

            UarchTestHelpers.GenerateX86NasmNsqTestFuncs(sb, this.Counts[this.Counts.Length - 1], this.Counts, this.Prefix, dependentJumps, independentJumps, false);

            sb.AppendLine(ohnoLabelName + ":");
            sb.AppendLine("  int3");
        }
예제 #5
0
        public override void GenerateX86NasmAsm(StringBuilder sb)
        {
            string initInstrs    = "  vpcmpeqd xmm1, xmm1, xmm1\n  vpxor xmm0, xmm0, xmm1";
            string postLoadInstr = "  cvtsi2ss xmm0, rdi";

            string[] dependentStores = new string[4];
            dependentStores[0] = "  movups [r8], xmm0";
            dependentStores[1] = "  movups [r8 + r14 * 8], xmm0";
            dependentStores[2] = "  movups [r8 + r13 * 8], xmm0";
            dependentStores[3] = "  movups [r8 + r12 * 8], xmm0";

            string[] indepStores = new string[4];
            indepStores[0] = "  movups [r8], %xmm1";
            indepStores[1] = "  movups [r8 + 16], %xmm1";
            indepStores[2] = "  movups [r8 + 32], %xmm1";
            indepStores[3] = "  movups [r8 + 48], %xmm1";

            UarchTestHelpers.GenerateX86NasmNsqTestFuncs(sb, this.Counts[this.Counts.Length - 1], this.Counts, this.Prefix, dependentStores, indepStores, false, initInstrs, postLoadInstr);
        }