-
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
Showing
19 changed files
with
648 additions
and
93 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
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,58 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class FmulSchedTest : UarchTest | ||
{ | ||
public FmulSchedTest(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "fmulsched"; | ||
this.Description = "FP (32-bit multiply) Scheduler Capacity Test"; | ||
this.FunctionDefinitionParameters = "uint64_t iterations, int *arr, float *floatArr"; | ||
this.GetFunctionCallParameters = "structIterations, A, fpArr"; | ||
this.DivideTimeByCount = false; | ||
} | ||
|
||
public override bool SupportsIsa(IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) return true; | ||
if (isa == IUarchTest.ISA.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) | ||
{ | ||
GenerateX86Asm(sb); | ||
} | ||
else if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
GenerateArmAsm(sb); | ||
} | ||
} | ||
|
||
public void GenerateX86Asm(StringBuilder sb) | ||
{ | ||
// xmm0 is dependent on ptr chasing load | ||
string[] unrolledAdds = new string[4]; | ||
unrolledAdds[0] = " mulss %xmm0, %xmm1"; | ||
unrolledAdds[1] = " mulss %xmm0, %xmm2"; | ||
unrolledAdds[2] = " mulss %xmm0, %xmm3"; | ||
unrolledAdds[3] = " mulss %xmm0, %xmm4"; | ||
|
||
UarchTestHelpers.GenerateX86AsmFpSchedTestFuncs(sb, this.Counts, this.Prefix, unrolledAdds, unrolledAdds); | ||
} | ||
|
||
public void GenerateArmAsm(StringBuilder sb) | ||
{ | ||
string[] unrolledAdds = new string[4]; | ||
unrolledAdds[0] = " fmul s17, s17, s16"; | ||
unrolledAdds[1] = " fmul s18, s18, s16"; | ||
unrolledAdds[2] = " fmul s19, s19, s16"; | ||
unrolledAdds[3] = " fmul s20, s20, s16"; | ||
UarchTestHelpers.GenerateArmAsmFpSchedTestFuncs(sb, this.Counts, this.Prefix, unrolledAdds, unrolledAdds); | ||
} | ||
} | ||
} |
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,58 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class MixLoadStoreDivSchedTest : UarchTest | ||
{ | ||
public MixLoadStoreDivSchedTest(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "mixloadstoredivsched"; | ||
this.Description = "Load/Store Scheduler Capacity Test, using divs to block retirement"; | ||
this.FunctionDefinitionParameters = "uint64_t iterations, int count, int *arr2, int *arr3"; | ||
this.GetFunctionCallParameters = "structIterations, list_size, B, 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; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) | ||
{ | ||
GenerateX86Asm(sb); | ||
} | ||
else if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
GenerateArmAsm(sb); | ||
} | ||
} | ||
|
||
public void GenerateX86Asm(StringBuilder sb) | ||
{ | ||
string[] dependentLoads = new string[2]; | ||
dependentLoads[0] = " mov (%r9, %rdx, 4), %r15"; | ||
dependentLoads[1] = " mov %r14, (%r8, %rdx, 4)"; | ||
|
||
UarchTestHelpers.GenerateX86AsmDivStructureTestFuncs(sb, this.Counts, this.Prefix, dependentLoads, dependentLoads, false); | ||
} | ||
|
||
public void GenerateArmAsm(StringBuilder sb) | ||
{ | ||
string[] dependentLoads = new string[2]; | ||
dependentLoads[0] = " ldr w15, [x3, w25, uxtw #2]"; | ||
dependentLoads[1] = " str w14, [x2, w25, uxtw #2]"; | ||
|
||
string[] dependentLoads1 = new string[2]; | ||
dependentLoads1[0] = " ldr w15, [x3, w26, uxtw #2]"; | ||
dependentLoads1[1] = " str w14, [x2, w26, uxtw #2]"; | ||
|
||
UarchTestHelpers.GenerateArmAsmDivStructureTestFuncs(sb, this.Counts, this.Prefix, dependentLoads, dependentLoads1, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class MixStoreDivSchedTest : UarchTest | ||
{ | ||
public MixStoreDivSchedTest(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "mixstoresched"; | ||
this.Description = "Store (Mixed Data/Address) Scheduler Capacity Test"; | ||
this.FunctionDefinitionParameters = "uint64_t iterations, int count, int *arr2"; | ||
this.GetFunctionCallParameters = "structIterations, list_size, B"; | ||
this.DivideTimeByCount = false; | ||
} | ||
|
||
public override bool SupportsIsa(IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) return true; | ||
if (isa == IUarchTest.ISA.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.amd64) | ||
{ | ||
GenerateX86Asm(sb); | ||
} | ||
else if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
GenerateArmAsm(sb); | ||
} | ||
} | ||
|
||
public void GenerateX86Asm(StringBuilder sb) | ||
{ | ||
string[] dependentStores = new string[4]; | ||
dependentStores[0] = " mov %rdx, (%r8, %r15, 4)"; | ||
dependentStores[1] = " mov %r15, (%r8, %rdx, 4)"; | ||
dependentStores[2] = " mov %rdx, (%r8, %r15, 4)"; | ||
dependentStores[3] = " mov %r15, (%r8, %rdx, 4)"; | ||
|
||
string[] dependentStores1 = new string[4]; | ||
dependentStores1[0] = " mov %rdx, (%r8, %r11, 4)"; | ||
dependentStores1[1] = " mov %r11, (%r8, %rdx, 4)"; | ||
dependentStores1[2] = " mov %rdx, (%r8, %r11, 4)"; | ||
dependentStores1[3] = " mov %r11, (%r8, %rdx, 4)"; | ||
UarchTestHelpers.GenerateX86AsmDivStructureTestFuncs(sb, this.Counts, this.Prefix, dependentStores, dependentStores1, false); | ||
} | ||
|
||
public void GenerateArmAsm(StringBuilder sb) | ||
{ | ||
string[] dependentStores = new string[4]; | ||
dependentStores[0] = " str w25, [x2, w15, uxtw #2]"; | ||
dependentStores[1] = " str w15, [x2, w25, uxtw #2]"; | ||
dependentStores[2] = " str w25, [x2, w15, uxtw #2]"; | ||
dependentStores[3] = " str w15, [x2, w25, uxtw #2]"; | ||
|
||
string[] dependentStores1 = new string[4]; | ||
dependentStores1[0] = " str w26, [x2, w15, uxtw #2]"; | ||
dependentStores1[1] = " str w15, [x2, w26, uxtw #2]"; | ||
dependentStores1[2] = " str w26, [x2, w15, uxtw #2]"; | ||
dependentStores1[3] = " str w15, [x2, w26, uxtw #2]"; | ||
UarchTestHelpers.GenerateArmAsmDivStructureTestFuncs(sb, this.Counts, this.Prefix, dependentStores, dependentStores1, 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
Oops, something went wrong.