-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from clamchowder/refactor_asmgen
NSQ Tests
- Loading branch information
Showing
14 changed files
with
543 additions
and
1 deletion.
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,47 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class AddvNsq : UarchTest | ||
{ | ||
private int totalOps; | ||
public AddvNsq(int low, int high, int step, int totalOps) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "addvnsq"; | ||
this.Description = "ADDV, excluding possible NSQ"; | ||
this.FunctionDefinitionParameters = "uint64_t iterations, int *arr, float *floatArr"; | ||
this.GetFunctionCallParameters = "structIterations, A, fpArr"; | ||
this.DivideTimeByCount = false; | ||
this.totalOps = totalOps; | ||
} | ||
|
||
public override bool SupportsIsa(IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
string postLoadInstrs1 = " ldr d16, [x2, w25, sxtw #0]"; | ||
string initInstrs = " ldr d15, [x2]"; | ||
string[] depInstrs = new string[4]; | ||
depInstrs[0] = " addv h1, v16.4h"; | ||
depInstrs[1] = " addv h2, v16.4h"; | ||
depInstrs[2] = " addv h3, v16.4h"; | ||
depInstrs[3] = " addv h4, v16.4h"; | ||
|
||
string[] indepInstrs = new string[4]; | ||
indepInstrs[0] = " addv h1, v15.4h"; | ||
indepInstrs[1] = " addv h2, v15.4h"; | ||
indepInstrs[2] = " addv h3, v15.4h"; | ||
indepInstrs[3] = " addv h4, v15.4h"; | ||
UarchTestHelpers.GenerateArmAsmNsqTestFuncs(sb, this.totalOps, this.Counts, this.Prefix, depInstrs, indepInstrs, false, initInstrs, | ||
postLoadInstrs: postLoadInstrs1); | ||
} | ||
} | ||
} | ||
} |
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,39 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class AddvSched : UarchTest | ||
{ | ||
public AddvSched(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "addvsched"; | ||
this.Description = "ADDV Scheduler"; | ||
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.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
string postLoadInstrs1 = " ldr q16, [x2, w25, sxtw #0]"; | ||
string postLoadInstrs2 = " ldr q16, [x2, w25, sxtw #0]"; | ||
string[] unrolledInstrs = new string[4]; | ||
unrolledInstrs[0] = " addv h1, v16.4h"; | ||
unrolledInstrs[1] = " addv h2, v16.4h"; | ||
unrolledInstrs[2] = " addv h3, v16.4h"; | ||
unrolledInstrs[3] = " addv h4, v16.4h"; | ||
UarchTestHelpers.GenerateArmAsmStructureTestFuncs(sb, this.Counts, this.Prefix, unrolledInstrs, unrolledInstrs, false, null, | ||
postLoadInstrs1: postLoadInstrs1, postLoadInstrs2: postLoadInstrs2); | ||
} | ||
} | ||
} | ||
} |
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,47 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class FaddNsq : UarchTest | ||
{ | ||
private int totalOps; | ||
public FaddNsq(int low, int high, int step, int totalOps) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "faddnsq"; | ||
this.Description = "FADD, excluding possible NSQ"; | ||
this.FunctionDefinitionParameters = "uint64_t iterations, int *arr, float *floatArr"; | ||
this.GetFunctionCallParameters = "structIterations, A, fpArr"; | ||
this.DivideTimeByCount = false; | ||
this.totalOps = totalOps; | ||
} | ||
|
||
public override bool SupportsIsa(IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
string postLoadInstrs1 = " ldr s16, [x2, w25, uxtw #2]"; | ||
string initInstrs = " ldr s15, [x2]"; | ||
string[] depInstrs = new string[4]; | ||
depInstrs[0] = " fadd s0, s0, s16"; | ||
depInstrs[1] = " fadd s1, s1, s16"; | ||
depInstrs[2] = " fadd s2, s2, s16"; | ||
depInstrs[3] = " fadd s3, s3, s16"; | ||
|
||
string[] indepInstrs = new string[4]; | ||
indepInstrs[0] = " fadd s17, s17, s15"; | ||
indepInstrs[1] = " fadd s18, s18, s15"; | ||
indepInstrs[2] = " fadd s19, s19, s15"; | ||
indepInstrs[3] = " fadd s20, s20, s15"; | ||
UarchTestHelpers.GenerateArmAsmNsqTestFuncs(sb, this.totalOps, this.Counts, this.Prefix, depInstrs, indepInstrs, false, initInstrs, | ||
postLoadInstrs: postLoadInstrs1); | ||
} | ||
} | ||
} | ||
} |
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 FcmpSchedTest : UarchTest | ||
{ | ||
public FcmpSchedTest(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "fcmpsched"; | ||
this.Description = "FCMP Scheduler"; | ||
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.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
string[] unrolledAdds = new string[4]; | ||
unrolledAdds[0] = " fcmp s17, s16"; | ||
unrolledAdds[1] = " fcmp s19, s16"; | ||
unrolledAdds[2] = " fcmp s19, s16"; | ||
unrolledAdds[3] = " fcmp 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class FmovSched : UarchTest | ||
{ | ||
public FmovSched(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "fmovsched"; | ||
this.Description = "FMOV vec to gpr Scheduler"; | ||
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.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
string postLoadInstrs1 = " ldr d16, [x2, w25, sxtw #0]"; | ||
string postLoadInstrs2 = " ldr d16, [x2, w25, sxtw #0]"; | ||
string[] unrolledInstrs = new string[4]; | ||
unrolledInstrs[0] = " fmov x15, d16"; | ||
unrolledInstrs[1] = " fmov x14, d16"; | ||
unrolledInstrs[2] = " fmov x13, d16"; | ||
unrolledInstrs[3] = " fmov x12, d16"; | ||
UarchTestHelpers.GenerateArmAsmStructureTestFuncs(sb, this.Counts, this.Prefix, unrolledInstrs, unrolledInstrs, false, null, | ||
postLoadInstrs1: postLoadInstrs1, postLoadInstrs2: postLoadInstrs2); | ||
} | ||
} | ||
} | ||
} |
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,47 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class JsCvtNsq : UarchTest | ||
{ | ||
private int totalOps; | ||
public JsCvtNsq(int low, int high, int step, int totalOps) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "jscvtnsq"; | ||
this.Description = "FJCVTZS (FP Javascript Convert to Signed Fixed Point, Rounding toward Zero) Scheduler, excluding possible NSQ"; | ||
this.FunctionDefinitionParameters = "uint64_t iterations, int *arr, float *floatArr"; | ||
this.GetFunctionCallParameters = "structIterations, A, fpArr"; | ||
this.DivideTimeByCount = false; | ||
this.totalOps = totalOps; | ||
} | ||
|
||
public override bool SupportsIsa(IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
string postLoadInstrs1 = " ldr d16, [x2, w25, sxtw #0]"; | ||
string initInstrs = " ldr d15, [x2]"; | ||
string[] depInstrs = new string[4]; | ||
depInstrs[0] = " fjcvtzs w15, d16"; | ||
depInstrs[1] = " fjcvtzs w14, d16"; | ||
depInstrs[2] = " fjcvtzs w13, d16"; | ||
depInstrs[3] = " fjcvtzs w12, d16"; | ||
|
||
string[] indepInstrs = new string[4]; | ||
indepInstrs[0] = " fjcvtzs w15, d15"; | ||
indepInstrs[1] = " fjcvtzs w14, d15"; | ||
indepInstrs[2] = " fjcvtzs w13, d15"; | ||
indepInstrs[3] = " fjcvtzs w12, d15"; | ||
UarchTestHelpers.GenerateArmAsmNsqTestFuncs(sb, this.totalOps, this.Counts, this.Prefix, depInstrs, indepInstrs, false, initInstrs, | ||
postLoadInstrs: postLoadInstrs1); | ||
} | ||
} | ||
} | ||
} |
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,39 @@ | ||
using System.Text; | ||
|
||
namespace AsmGen | ||
{ | ||
public class JsCvtSched : UarchTest | ||
{ | ||
public JsCvtSched(int low, int high, int step) | ||
{ | ||
this.Counts = UarchTestHelpers.GenerateCountArray(low, high, step); | ||
this.Prefix = "jscvtsched"; | ||
this.Description = "FJCVTZS (FP Javascript Convert to Signed Fixed Point, Rounding toward Zero) Scheduler"; | ||
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.aarch64) return true; | ||
return false; | ||
} | ||
|
||
public override void GenerateAsm(StringBuilder sb, IUarchTest.ISA isa) | ||
{ | ||
if (isa == IUarchTest.ISA.aarch64) | ||
{ | ||
string postLoadInstrs1 = " ldr d16, [x2, w25, sxtw #0]"; | ||
string postLoadInstrs2 = " ldr d16, [x2, w25, sxtw #0]"; | ||
string[] unrolledInstrs = new string[4]; | ||
unrolledInstrs[0] = " fjcvtzs w15, d16"; | ||
unrolledInstrs[1] = " fjcvtzs w14, d16"; | ||
unrolledInstrs[2] = " fjcvtzs w13, d16"; | ||
unrolledInstrs[3] = " fjcvtzs w12, d16"; | ||
UarchTestHelpers.GenerateArmAsmStructureTestFuncs(sb, this.Counts, this.Prefix, unrolledInstrs, unrolledInstrs, false, null, | ||
postLoadInstrs1: postLoadInstrs1, postLoadInstrs2: postLoadInstrs2); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.