Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use custom function to format TRIL code #5587

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b7b437f
Introduce new custom function to format TRIL code
janvrany Oct 6, 2020
0ec553b
Add poor man's replacement for std::make_signed
janvrany Dec 15, 2023
f14bdc2
Like previous commit, but for std::is_same
janvrany Dec 13, 2023
671ba7a
Like previous commit, but for std::is_integral
janvrany Dec 13, 2023
9d2ff16
Like previous commit, but for std::is_unsigned
janvrany Dec 13, 2023
8671282
Like previous commit, but for std::is_pointer
janvrany Dec 13, 2023
e8cfd53
Like previous commit, but for std::is_floating_point
janvrany Dec 13, 2023
4db9382
Convert ArithmeticTest tests to use Tril::format() instead of std::sn…
janvrany Dec 14, 2023
995ea89
Convert ArrayTest tests to use Tril::format() instead of std::snprintf()
janvrany Dec 14, 2023
22072f1
Convert BitPermute tests to use Tril::format() instead of std::snprin…
janvrany Dec 14, 2023
3308657
Convert CallTest tests to use Tril::format() instead of std::snprintf()
janvrany Dec 14, 2023
204b896
Convert CompareTest tests to use Tril::format() instead of std::snpri…
janvrany Dec 14, 2023
e9251af
Convert IfxcmpgeReductionTest tests to use Tril::format() instead of …
janvrany Dec 14, 2023
f7503d7
Convert LinkageTest tests to use Tril::format() instead of std::snpri…
janvrany Dec 14, 2023
9b01afe
Convert LogicalTest tests to use Tril::format() instead of std::snpri…
janvrany Dec 14, 2023
de4668f
Convert LongAndAsRotateTest tests to use Tril::format() instead of st…
janvrany Dec 14, 2023
18e04eb
Convert MaxMinTest tests to use Tril::format() instead of std::snprin…
janvrany Dec 14, 2023
0760347
Convert SelectTest tests to use Tril::format() instead of std::snprin…
janvrany Dec 14, 2023
505dbdd
Convert ShiftAndRotateTest tests to use Tril::format() instead of std…
janvrany Dec 14, 2023
13024c5
Convert SimpifierFoldAbsNegTest tests to use Tril::format() instead o…
janvrany Dec 14, 2023
47c882c
Convert TypeConversionTest tests to use Tril::format() instead of std…
janvrany Dec 14, 2023
ad7275b
Convert VectorTest tests to use Tril::format() instead of std::snprin…
janvrany Dec 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions fvtest/compilertriltest/ArithmeticTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ TEST_P(Int32Arithmetic, UsingConst) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int32"
" (block"
" (ireturn"
Expand Down Expand Up @@ -116,7 +116,7 @@ TEST_P(Int32Arithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int32 args=[Int32, Int32]"
" (block"
" (ireturn"
Expand All @@ -141,7 +141,7 @@ TEST_P(Int32Arithmetic, UsingLoadParamAndLoadConst) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int32 args=[Int32]"
" (block"
" (ireturn"
Expand Down Expand Up @@ -171,7 +171,7 @@ TEST_P(UInt32Arithmetic, UsingConst) {
<< "The Power codegen does not yet support iudiv/iurem (see issue #3673)";

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int32"
" (block"
" (ireturn"
Expand Down Expand Up @@ -204,7 +204,7 @@ TEST_P(UInt32Arithmetic, UsingLoadParam) {
<< "The Power codegen does not yet support iudiv/iurem (see issue #3673)";

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int32 args=[Int32, Int32]"
" (block"
" (ireturn"
Expand Down Expand Up @@ -233,7 +233,7 @@ TEST_P(UInt32Arithmetic, UsingLoadParamAndLoadConst) {
<< "The Power codegen does not yet support iudiv/iurem (see issue #3673)";

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int32 args=[Int32]"
" (block"
" (ireturn"
Expand All @@ -259,7 +259,7 @@ TEST_P(Int64Arithmetic, UsingConst) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int64"
" (block"
" (lreturn"
Expand Down Expand Up @@ -288,7 +288,7 @@ TEST_P(Int64Arithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int64 args=[Int64, Int64]"
" (block"
" (lreturn"
Expand All @@ -313,7 +313,7 @@ TEST_P(Int64Arithmetic, UsingLoadParamAndLoadConst) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int64 args=[Int64]"
" (block"
" (lreturn"
Expand Down Expand Up @@ -343,7 +343,7 @@ TEST_P(UInt64Arithmetic, UsingConst) {
<< "The Power codegen does not yet support ludiv (see issue #2227)";

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int64"
" (block"
" (lreturn"
Expand Down Expand Up @@ -376,7 +376,7 @@ TEST_P(UInt64Arithmetic, UsingLoadParam) {
<< "The Power codegen does not yet support ludiv (see issue #2227)";

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int64 args=[Int64, Int64]"
" (block"
" (lreturn"
Expand Down Expand Up @@ -405,7 +405,7 @@ TEST_P(UInt64Arithmetic, UsingLoadParamAndLoadConst) {
<< "The Power codegen does not yet support ludiv (see issue #2227)";

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int64 args=[Int64]"
" (block"
" (lreturn"
Expand All @@ -431,7 +431,7 @@ TEST_P(Int16Arithmetic, UsingConst) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int16"
" (block"
" (ireturn"
Expand Down Expand Up @@ -460,7 +460,7 @@ TEST_P(Int16Arithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int16 args=[Int16, Int16]"
" (block"
" (ireturn"
Expand All @@ -485,7 +485,7 @@ TEST_P(Int16Arithmetic, UsingLoadParamAndLoadConst) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int16 args=[Int16]"
" (block"
" (ireturn"
Expand All @@ -511,7 +511,7 @@ TEST_P(Int8Arithmetic, UsingConst) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int8"
" (block"
" (ireturn"
Expand Down Expand Up @@ -540,7 +540,7 @@ TEST_P(Int8Arithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int8 args=[Int8, Int8]"
" (block"
" (ireturn"
Expand All @@ -565,7 +565,7 @@ TEST_P(Int8Arithmetic, UsingLoadParamAndLoadConst) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Int8 args=[Int8]"
" (block"
" (ireturn"
Expand Down Expand Up @@ -700,7 +700,7 @@ TEST_P(FloatArithmetic, UsingConst) {
}

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Float"
" (block"
" (freturn"
Expand Down Expand Up @@ -729,7 +729,7 @@ TEST_P(FloatArithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Float args=[Float, Float]"
" (block"
" (freturn"
Expand Down Expand Up @@ -761,7 +761,7 @@ TEST_P(FloatArithmetic, UsingLoadParamAndLoadConst) {
}

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Float args=[Float]"
" (block"
" (freturn"
Expand Down Expand Up @@ -805,7 +805,7 @@ class AddressInt64Arithmetic : public TRTest::OpCodeTest<uint64_t, uint64_t, int
TEST_P(AddressInt64Arithmetic, UsingConst) {
auto param = TRTest::to_struct(GetParam());
char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Address"
" (block"
" (areturn"
Expand Down Expand Up @@ -833,7 +833,7 @@ TEST_P(AddressInt64Arithmetic, UsingConst) {
TEST_P(AddressInt64Arithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());
char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Address args=[Address, Int64]"
" (block"
" (areturn"
Expand All @@ -857,7 +857,7 @@ TEST_P(AddressInt64Arithmetic, UsingLoadParam) {
TEST_P(AddressInt64Arithmetic, UsingLoadParamAndLoadConst) {
auto param = TRTest::to_struct(GetParam());
char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Address args=[Address]"
" (block"
" (areturn"
Expand All @@ -882,7 +882,7 @@ TEST_P(AddressInt64Arithmetic, UsingLoadParamAndLoadConst) {
TEST_P(AddressInt64Arithmetic, UsingLoadConstAndLoadParam) {
auto param = TRTest::to_struct(GetParam());
char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Address args=[Int64]"
" (block"
" (areturn"
Expand Down Expand Up @@ -920,7 +920,7 @@ class AddressInt32Arithmetic : public TRTest::OpCodeTest<uint32_t, uint32_t, int
TEST_P(AddressInt32Arithmetic, UsingConst) {
auto param = TRTest::to_struct(GetParam());
char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Address"
" (block"
" (areturn"
Expand Down Expand Up @@ -948,7 +948,7 @@ TEST_P(AddressInt32Arithmetic, UsingConst) {
TEST_P(AddressInt32Arithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());
char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Address args=[Address, Int32]"
" (block"
" (areturn"
Expand All @@ -972,7 +972,7 @@ TEST_P(AddressInt32Arithmetic, UsingLoadParam) {
TEST_P(AddressInt32Arithmetic, UsingLoadParamAndLoadConst) {
auto param = TRTest::to_struct(GetParam());
char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Address args=[Address]"
" (block"
" (areturn"
Expand All @@ -997,7 +997,7 @@ TEST_P(AddressInt32Arithmetic, UsingLoadParamAndLoadConst) {
TEST_P(AddressInt32Arithmetic, UsingLoadConstAndLoadParam) {
auto param = TRTest::to_struct(GetParam());
char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Address args=[Int32]"
" (block"
" (areturn"
Expand Down Expand Up @@ -1036,7 +1036,7 @@ TEST_P(DoubleArithmetic, UsingConst) {
}

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Double"
" (block"
" (dreturn"
Expand Down Expand Up @@ -1065,7 +1065,7 @@ TEST_P(DoubleArithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Double args=[Double, Double]"
" (block"
" (dreturn"
Expand Down Expand Up @@ -1097,7 +1097,7 @@ TEST_P(DoubleArithmetic, UsingLoadParamAndLoadConst) {
}

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Double args=[Double]"
" (block"
" (dreturn"
Expand Down Expand Up @@ -1153,7 +1153,7 @@ TEST_P(FloatUnaryArithmetic, UsingConst) {
}

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Float"
" (block"
" (freturn"
Expand All @@ -1180,7 +1180,7 @@ TEST_P(FloatUnaryArithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Float args=[Float]"
" (block"
" (freturn"
Expand Down Expand Up @@ -1225,7 +1225,7 @@ TEST_P(DoubleUnaryArithmetic, UsingConst) {
}

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Double"
" (block"
" (dreturn"
Expand All @@ -1252,7 +1252,7 @@ TEST_P(DoubleUnaryArithmetic, UsingLoadParam) {
auto param = TRTest::to_struct(GetParam());

char inputTrees[1024] = {0};
std::snprintf(inputTrees, sizeof(inputTrees),
Tril::format(inputTrees, sizeof(inputTrees),
"(method return=Double args=[Double]"
" (block"
" (dreturn"
Expand Down
Loading
Loading