Ejemplo n.º 1
0
        public override void GenerateX86NasmAsm(StringBuilder sb)
        {
            string[] dependentStores = new string[4];
            dependentStores[0] = "  mov [r8 + rdi * 4], r15d";
            dependentStores[1] = "  mov [r8 + rdi * 4], r15d";
            dependentStores[2] = "  mov [r8 + rdi * 4], r15d";
            dependentStores[3] = "  mov [r8 + rdi * 4], r15d";

            string[] indepStores = new string[4];
            indepStores[0] = "  mov [r8], r11";
            indepStores[1] = "  mov [r8 + 8], r11";
            indepStores[2] = "  mov [r8 + 16], r11";
            indepStores[3] = "  mov [r8 + 24], r11";
            UarchTestHelpers.GenerateX86AsmNsqTestFuncs(sb, this.Counts[this.Counts.Length - 1], this.Counts, this.Prefix, dependentStores, indepStores, false);
        }
Ejemplo n.º 2
0
        public override void GenerateX86GccAsm(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.GenerateX86AsmNsqTestFuncs(sb, this.Counts[this.Counts.Length - 1], this.Counts, this.Prefix, dependentJumps, independentJumps, false);

            sb.AppendLine(ohnoLabelName + ":");
            sb.AppendLine("  int3");
        }
Ejemplo n.º 3
0
        private void GenerateX86GccAsmLoadHoistVersion(StringBuilder sb)
        {
            string[] dependentStores = new string[4];
            dependentStores[0] = "  mov %r15w, (%r8, %rdi, 2)";
            dependentStores[1] = "  mov %r15w, 2(%r8, %rdi, 2)";
            dependentStores[2] = "  mov %r15w, 4(%r8, %rdi, 2)";
            dependentStores[3] = "  mov %r15w, 6(%r8, %rdi, 2)";

            string[] indepStores = new string[4];
            indepStores[0] = "  mov %r11w, (%r8)";
            indepStores[1] = "  mov %r11w, 2(%r8)";
            indepStores[2] = "  mov %r11w, 4(%r8)";
            indepStores[3] = "  mov %r11w, 6(%r8)";

            UarchTestHelpers.GenerateX86AsmNsqTestFuncs(sb, this.Counts[this.Counts.Length - 1], this.Counts, this.Prefix, dependentStores, indepStores, false);
        }
Ejemplo n.º 4
0
        public override void GenerateX86GccAsm(StringBuilder sb)
        {
            // xmm0 is dependent on ptr chasing load
            string initInstrs    = "  cvtsi2ss %r11, %xmm3\n";
            string postLoadInstr = "  cvtsi2ss %rdi, %xmm0";

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

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

            UarchTestHelpers.GenerateX86AsmNsqTestFuncs(sb, this.high, this.Counts, this.Prefix, depAdds, indepAdds, false, initInstrs, postLoadInstr);
        }
Ejemplo n.º 5
0
        public override void GenerateX86GccAsm(StringBuilder sb)
        {
            string initInstrs    = "  pxor %xmm3, %xmm3\n  pxor %xmm4, %xmm4\n  movq %r15, %xmm5\n";
            string postLoadInstr = "  movq %rdi, %xmm0\n";

            //string postLoadInstr2 = "  movq %rsi, %xmm0\n  pshufd $0, %xmm0, %xmm0\n";
            // xmm0 is dependent on ptr chasing load
            string[] depAdds = new string[2];
            depAdds[0] = "  paddd %xmm0, %xmm1";
            depAdds[1] = "  paddd %xmm0, %xmm2";

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

            UarchTestHelpers.GenerateX86AsmNsqTestFuncs(sb, this.high, this.Counts, this.Prefix, depAdds, indepAdds, false, initInstrs, postLoadInstr);
        }
Ejemplo n.º 6
0
        public override void GenerateX86GccAsm(StringBuilder sb)
        {
            string initInstrs    = "  cvtsi2ss %r11, %xmm3\n movss %xmm3, %xmm4\n  movss %xmm3, %xmm5\n  movss %xmm3, %xmm6";
            string postLoadInstr = "  cvtsi2ss %rdi, %xmm1";

            string[] dependentStores = new string[4];
            dependentStores[0] = "  movss %xmm1, (%r8)";
            dependentStores[1] = "  addss %xmm1, %xmm3";
            dependentStores[2] = "  movss %xmm1, (%r8, %r13, 4)";
            dependentStores[3] = "  addss %xmm1, %xmm4";

            string[] indepFpInstrs = new string[4];
            indepFpInstrs[0] = "  addss %xmm2, %xmm3";
            indepFpInstrs[1] = "  addss %xmm2, %xmm4";
            indepFpInstrs[2] = "  addss %xmm2, %xmm5";
            indepFpInstrs[3] = "  addss %xmm2, %xmm6";

            UarchTestHelpers.GenerateX86AsmNsqTestFuncs(sb, this.Counts[this.Counts.Length - 1], this.Counts, this.Prefix, dependentStores, indepFpInstrs, false, initInstrs: initInstrs, postLoadInstrs: postLoadInstr);
        }