-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3607ce4
commit fe3d369
Showing
4 changed files
with
113 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class JumpNsqTest : UarchTest | ||
{ | ||
public JumpNsqTest(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "jumpnsq"; | ||
this.Description = "Scheduler, Not-Taken Jumps, excluding possible nsq"; | ||
this.FunctionDefinitionParameters = "uint64_t iterations, int *arr"; | ||
this.GetFunctionCallParameters = "structIterations, A"; | ||
this.DivideTimeByCount = false; | ||
} | ||
|
||
public override bool SupportsIsa(IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) return true; | ||
// if (isa == IUarchTest.ISA.aarch64) return true; | ||
// if (isa == IUarchTest.ISA.mips64) return true; | ||
// if (isa == IUarchTest.ISA.riscv) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) | ||
{ | ||
string[] dependentJumps = new string[1]; | ||
dependentJumps[0] = " cmp %rdi, %rsi\n je jumpnsq_reallybadthing"; | ||
string[] independentJumps = new string[1]; | ||
independentJumps[0] = " cmp %r13, %r14\n je jumpnsq_reallybadthing"; | ||
UarchTestHelpers.GenerateX86AsmNsqTestFuncs(sb, this.Counts[this.Counts.Length - 1], this.Counts, this.Prefix, dependentJumps, independentJumps); | ||
|
||
sb.AppendLine("jumpnsq_reallybadthing:\n int3"); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class LeaSchedTest : UarchTest | ||
{ | ||
public LeaSchedTest(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "leasched"; | ||
this.Description = "Scheduler, lea with base + index + offset"; | ||
this.FunctionDefinitionParameters = "uint64_t iterations, int *arr"; | ||
this.GetFunctionCallParameters = "structIterations, A"; | ||
this.DivideTimeByCount = false; | ||
} | ||
|
||
public override bool SupportsIsa(IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) | ||
{ | ||
string[] unrolledAdds = new string[4]; | ||
unrolledAdds[0] = " lea 128(%r15, %rdi), %r15"; | ||
unrolledAdds[1] = " lea 128(%r14, %rdi), %r14"; | ||
unrolledAdds[2] = " lea 128(%r13, %rdi), %r13"; | ||
unrolledAdds[3] = " lea 128(%r12, %rdi), %r12"; | ||
UarchTestHelpers.GenerateX86AsmStructureTestFuncs(sb, this.Counts, this.Prefix, unrolledAdds, unrolledAdds, includePtrChasingLoads: false); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters