Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(711)

Unified Diff: test/cctest/test-assembler-mips64.cc

Issue 1276813004: MIPS: Fix mina_maxa for proper NaN handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-mips64.cc
diff --git a/test/cctest/test-assembler-mips64.cc b/test/cctest/test-assembler-mips64.cc
index 1fe7cfeb39e6f7b2ee2996923ac9cf172fb8381f..00e364cfcec059ab63c660dbde2625489bc0b3a6 100644
--- a/test/cctest/test-assembler-mips64.cc
+++ b/test/cctest/test-assembler-mips64.cc
@@ -1440,7 +1440,7 @@ TEST(MIPS16) {
}
-// ----------------------mips32r6 specific tests----------------------
+// ----------------------mips64r6 specific tests----------------------
TEST(seleqz_selnez) {
if (kArchVariant == kMips64r6) {
CcTest::InitializeVM();
@@ -1562,18 +1562,18 @@ TEST(min_max) {
} TestFloat;
TestFloat test;
- const double dblNaN = std::numeric_limits<double>::quiet_NaN();
- const float fltNaN = std::numeric_limits<float>::quiet_NaN();
- const int tableLength = 5;
- double inputsa[tableLength] = {2.0, 3.0, dblNaN, 3.0, dblNaN};
- double inputsb[tableLength] = {3.0, 2.0, 3.0, dblNaN, dblNaN};
- double outputsdmin[tableLength] = {2.0, 2.0, 3.0, 3.0, dblNaN};
- double outputsdmax[tableLength] = {3.0, 3.0, 3.0, 3.0, dblNaN};
-
- float inputse[tableLength] = {2.0, 3.0, fltNaN, 3.0, fltNaN};
- float inputsf[tableLength] = {3.0, 2.0, 3.0, fltNaN, fltNaN};
- float outputsfmin[tableLength] = {2.0, 2.0, 3.0, 3.0, fltNaN};
- float outputsfmax[tableLength] = {3.0, 3.0, 3.0, 3.0, fltNaN};
+ const double double_nan = std::numeric_limits<double>::quiet_NaN();
+ const float float_nan = std::numeric_limits<float>::quiet_NaN();
+ const int kTableLength = 5;
+ double inputsa[kTableLength] = {2.0, 3.0, double_nan, 3.0, double_nan};
+ double inputsb[kTableLength] = {3.0, 2.0, 3.0, double_nan, double_nan};
+ double outputsdmin[kTableLength] = {2.0, 2.0, 3.0, 3.0, double_nan};
+ double outputsdmax[kTableLength] = {3.0, 3.0, 3.0, 3.0, double_nan};
+
+ float inputse[kTableLength] = {2.0, 3.0, float_nan, 3.0, float_nan};
+ float inputsf[kTableLength] = {3.0, 2.0, 3.0, float_nan, float_nan};
+ float outputsfmin[kTableLength] = {2.0, 2.0, 3.0, 3.0, float_nan};
+ float outputsfmax[kTableLength] = {3.0, 3.0, 3.0, 3.0, float_nan};
__ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)));
__ ldc1(f8, MemOperand(a0, offsetof(TestFloat, b)));
@@ -1595,7 +1595,7 @@ TEST(min_max) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputsa[i];
test.b = inputsb[i];
test.e = inputse[i];
@@ -1603,7 +1603,7 @@ TEST(min_max) {
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
- if (i < tableLength - 1) {
+ if (i < kTableLength - 1) {
CHECK_EQ(test.c, outputsdmin[i]);
CHECK_EQ(test.d, outputsdmax[i]);
CHECK_EQ(test.g, outputsfmin[i]);
@@ -1621,7 +1621,7 @@ TEST(min_max) {
TEST(rint_d) {
if (kArchVariant == kMips64r6) {
- const int tableLength = 30;
+ const int kTableLength = 30;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
@@ -1634,7 +1634,7 @@ TEST(rint_d) {
}TestFloat;
TestFloat test;
- double inputs[tableLength] = {18446744073709551617.0,
+ double inputs[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E147,
1.7976931348623157E+308, 6.27463370218383111104242366943E-307,
@@ -1646,7 +1646,7 @@ TEST(rint_d) {
37778931862957161709582.0, 37778931862957161709583.0,
37778931862957161709584.0, 37778931862957161709585.0,
37778931862957161709586.0, 37778931862957161709587.0};
- double outputs_RN[tableLength] = {18446744073709551617.0,
+ double outputs_RN[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E147,
1.7976931348623157E308, 0,
@@ -1658,7 +1658,7 @@ TEST(rint_d) {
37778931862957161709582.0, 37778931862957161709583.0,
37778931862957161709584.0, 37778931862957161709585.0,
37778931862957161709586.0, 37778931862957161709587.0};
- double outputs_RZ[tableLength] = {18446744073709551617.0,
+ double outputs_RZ[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E147,
1.7976931348623157E308, 0,
@@ -1670,7 +1670,7 @@ TEST(rint_d) {
37778931862957161709582.0, 37778931862957161709583.0,
37778931862957161709584.0, 37778931862957161709585.0,
37778931862957161709586.0, 37778931862957161709587.0};
- double outputs_RP[tableLength] = {18446744073709551617.0,
+ double outputs_RP[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E147,
1.7976931348623157E308, 1,
@@ -1682,7 +1682,7 @@ TEST(rint_d) {
37778931862957161709582.0, 37778931862957161709583.0,
37778931862957161709584.0, 37778931862957161709585.0,
37778931862957161709586.0, 37778931862957161709587.0};
- double outputs_RM[tableLength] = {18446744073709551617.0,
+ double outputs_RM[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E147,
1.7976931348623157E308, 0,
@@ -1713,7 +1713,7 @@ TEST(rint_d) {
for (int j = 0; j < 4; j++) {
test.fcsr = fcsr_inputs[j];
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.b, outputs[j][i]);
@@ -1798,7 +1798,7 @@ TEST(sel) {
TEST(rint_s) {
if (kArchVariant == kMips64r6) {
- const int tableLength = 30;
+ const int kTableLength = 30;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
@@ -1811,7 +1811,7 @@ TEST(rint_s) {
}TestFloat;
TestFloat test;
- float inputs[tableLength] = {18446744073709551617.0,
+ float inputs[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E37,
1.7976931348623157E+38, 6.27463370218383111104242366943E-37,
@@ -1823,7 +1823,7 @@ TEST(rint_s) {
37778931862957161709582.0, 37778931862957161709583.0,
37778931862957161709584.0, 37778931862957161709585.0,
37778931862957161709586.0, 37778931862957161709587.0};
- float outputs_RN[tableLength] = {18446744073709551617.0,
+ float outputs_RN[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E37,
1.7976931348623157E38, 0,
@@ -1835,7 +1835,7 @@ TEST(rint_s) {
37778931862957161709582.0, 37778931862957161709583.0,
37778931862957161709584.0, 37778931862957161709585.0,
37778931862957161709586.0, 37778931862957161709587.0};
- float outputs_RZ[tableLength] = {18446744073709551617.0,
+ float outputs_RZ[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E37,
1.7976931348623157E38, 0,
@@ -1847,7 +1847,7 @@ TEST(rint_s) {
37778931862957161709582.0, 37778931862957161709583.0,
37778931862957161709584.0, 37778931862957161709585.0,
37778931862957161709586.0, 37778931862957161709587.0};
- float outputs_RP[tableLength] = {18446744073709551617.0,
+ float outputs_RP[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E37,
1.7976931348623157E38, 1,
@@ -1859,7 +1859,7 @@ TEST(rint_s) {
37778931862957161709582.0, 37778931862957161709583.0,
37778931862957161709584.0, 37778931862957161709585.0,
37778931862957161709586.0, 37778931862957161709587.0};
- float outputs_RM[tableLength] = {18446744073709551617.0,
+ float outputs_RM[kTableLength] = {18446744073709551617.0,
4503599627370496.0, -4503599627370496.0,
1.26782468584154733584017312973E30, 1.44860108245951772690707170478E37,
1.7976931348623157E38, 0,
@@ -1892,7 +1892,7 @@ TEST(rint_s) {
for (int j = 0; j < 4; j++) {
test.fcsr = fcsr_inputs[j];
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.b, outputs[j][i]);
@@ -1904,11 +1904,13 @@ TEST(rint_s) {
TEST(mina_maxa) {
if (kArchVariant == kMips64r6) {
- const int tableLength = 12;
+ const int kTableLength = 15;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
MacroAssembler assm(isolate, NULL, 0);
+ const double double_nan = std::numeric_limits<double>::quiet_NaN();
+ const float float_nan = std::numeric_limits<float>::quiet_NaN();
typedef struct test_float {
double a;
@@ -1922,53 +1924,37 @@ TEST(mina_maxa) {
}TestFloat;
TestFloat test;
- double inputsa[tableLength] = {
- 5.3, 4.8, 6.1,
- 9.8, 9.8, 9.8,
- -10.0, -8.9, -9.8,
- -10.0, -8.9, -9.8
+ double inputsa[kTableLength] = {
+ 5.3, 4.8, 6.1, 9.8, 9.8, 9.8, -10.0, -8.9,
+ -9.8, -10.0, -8.9, -9.8, double_nan, 3.0, double_nan
};
- double inputsb[tableLength] = {
- 4.8, 5.3, 6.1,
- -10.0, -8.9, -9.8,
- 9.8, 9.8, 9.8,
- -9.8, -11.2, -9.8
+ double inputsb[kTableLength] = {
+ 4.8, 5.3, 6.1, -10.0, -8.9, -9.8, 9.8, 9.8,
+ 9.8, -9.8, -11.2, -9.8, 3.0, double_nan, double_nan
};
- double resd[tableLength] = {
- 4.8, 4.8, 6.1,
- 9.8, -8.9, 9.8,
- 9.8, -8.9, 9.8,
- -9.8, -8.9, -9.8
+ double resd[kTableLength] = {
+ 4.8, 4.8, 6.1, 9.8, -8.9, -9.8, 9.8, -8.9,
+ -9.8, -9.8, -8.9, -9.8, 3.0, 3.0, double_nan
};
- double resd1[tableLength] = {
- 5.3, 5.3, 6.1,
- -10.0, 9.8, 9.8,
- -10.0, 9.8, 9.8,
- -10.0, -11.2, -9.8
+ double resd1[kTableLength] = {
+ 5.3, 5.3, 6.1, -10.0, 9.8, 9.8, -10.0, 9.8,
+ 9.8, -10.0, -11.2, -9.8, 3.0, 3.0, double_nan
};
- float inputsc[tableLength] = {
- 5.3, 4.8, 6.1,
- 9.8, 9.8, 9.8,
- -10.0, -8.9, -9.8,
- -10.0, -8.9, -9.8
+ float inputsc[kTableLength] = {
+ 5.3, 4.8, 6.1, 9.8, 9.8, 9.8, -10.0, -8.9,
+ -9.8, -10.0, -8.9, -9.8, float_nan, 3.0, float_nan
};
- float inputsd[tableLength] = {
- 4.8, 5.3, 6.1,
- -10.0, -8.9, -9.8,
- 9.8, 9.8, 9.8,
- -9.8, -11.2, -9.8
+ float inputsd[kTableLength] = {
+ 4.8, 5.3, 6.1, -10.0, -8.9, -9.8, 9.8, 9.8,
+ 9.8, -9.8, -11.2, -9.8, 3.0, float_nan, float_nan
};
- float resf[tableLength] = {
- 4.8, 4.8, 6.1,
- 9.8, -8.9, 9.8,
- 9.8, -8.9, 9.8,
- -9.8, -8.9, -9.8
+ float resf[kTableLength] = {
+ 4.8, 4.8, 6.1, 9.8, -8.9, -9.8, 9.8, -8.9,
+ -9.8, -9.8, -8.9, -9.8, 3.0, 3.0, float_nan
};
- float resf1[tableLength] = {
- 5.3, 5.3, 6.1,
- -10.0, 9.8, 9.8,
- -10.0, 9.8, 9.8,
- -10.0, -11.2, -9.8
+ float resf1[kTableLength] = {
+ 5.3, 5.3, 6.1, -10.0, 9.8, 9.8, -10.0, 9.8,
+ 9.8, -10.0, -11.2, -9.8, 3.0, 3.0, float_nan
};
__ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
@@ -1991,24 +1977,31 @@ TEST(mina_maxa) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputsa[i];
test.b = inputsb[i];
test.c = inputsc[i];
test.d = inputsd[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
- CHECK_EQ(test.resd, resd[i]);
- CHECK_EQ(test.resf, resf[i]);
- CHECK_EQ(test.resd1, resd1[i]);
- CHECK_EQ(test.resf1, resf1[i]);
+ if (i < kTableLength - 1) {
+ CHECK_EQ(test.resd, resd[i]);
+ CHECK_EQ(test.resf, resf[i]);
+ CHECK_EQ(test.resd1, resd1[i]);
+ CHECK_EQ(test.resf1, resf1[i]);
+ } else {
+ DCHECK(std::isnan(test.resd));
+ DCHECK(std::isnan(test.resf));
+ DCHECK(std::isnan(test.resd1));
+ DCHECK(std::isnan(test.resf1));
+ }
}
}
}
-// ----------------------mips32r2 specific tests----------------------
+// ----------------------mips64r2 specific tests----------------------
TEST(trunc_l) {
if (kArchVariant == kMips64r2) {
CcTest::InitializeVM();
@@ -2022,22 +2015,22 @@ TEST(trunc_l) {
int64_t c; // a trunc result
int64_t d; // b trunc result
}Test;
- const int tableLength = 15;
- double inputs_D[tableLength] = {
+ const int kTableLength = 15;
+ double inputs_D[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity()
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<float>::quiet_NaN(),
std::numeric_limits<float>::infinity()
};
- double outputs[tableLength] = {
+ double outputs[kTableLength] = {
2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
-2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
2147483648.0, dFPU64InvalidResult,
@@ -2057,7 +2050,7 @@ TEST(trunc_l) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.b = inputs_S[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -2070,7 +2063,7 @@ TEST(trunc_l) {
TEST(movz_movn) {
if (kArchVariant == kMips64r2) {
- const int tableLength = 4;
+ const int kTableLength = 4;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
@@ -2091,17 +2084,17 @@ TEST(movz_movn) {
}TestFloat;
TestFloat test;
- double inputs_D[tableLength] = {
+ double inputs_D[kTableLength] = {
5.3, -5.3, 5.3, -2.9
};
- double inputs_S[tableLength] = {
+ double inputs_S[kTableLength] = {
4.8, 4.8, -4.8, -0.29
};
- float outputs_S[tableLength] = {
+ float outputs_S[kTableLength] = {
4.8, 4.8, -4.8, -0.29
};
- double outputs_D[tableLength] = {
+ double outputs_D[kTableLength] = {
5.3, -5.3, 5.3, -2.9
};
@@ -2133,7 +2126,7 @@ TEST(movz_movn) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.c = inputs_S[i];
@@ -2157,7 +2150,7 @@ TEST(movz_movn) {
TEST(movt_movd) {
if (kArchVariant == kMips64r2) {
- const int tableLength = 4;
+ const int kTableLength = 4;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
typedef struct test_float {
@@ -2176,22 +2169,22 @@ TEST(movt_movd) {
}TestFloat;
TestFloat test;
- double inputs_D[tableLength] = {
+ double inputs_D[kTableLength] = {
5.3, -5.3, 20.8, -2.9
};
- double inputs_S[tableLength] = {
+ double inputs_S[kTableLength] = {
4.88, 4.8, -4.8, -0.29
};
- float outputs_S[tableLength] = {
+ float outputs_S[kTableLength] = {
4.88, 4.8, -4.8, -0.29
};
- double outputs_D[tableLength] = {
+ double outputs_D[kTableLength] = {
5.3, -5.3, 20.8, -2.9
};
int condition_flags[8] = {0, 1, 2, 3, 4, 5, 6, 7};
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.srcd = inputs_D[i];
test.srcf = inputs_S[i];
@@ -2264,8 +2257,8 @@ TEST(cvt_w_d) {
int32_t b;
int fcsr;
}Test;
- const int tableLength = 24;
- double inputs[tableLength] = {
+ const int kTableLength = 24;
+ double inputs[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483637.0, 2147483638.0, 2147483639.0,
@@ -2273,28 +2266,28 @@ TEST(cvt_w_d) {
2147483643.0, 2147483644.0, 2147483645.0,
2147483646.0, 2147483647.0, 2147483653.0
};
- double outputs_RN[tableLength] = {
+ double outputs_RN[kTableLength] = {
2.0, 3.0, 2.0, 3.0, 4.0, 4.0,
-2.0, -3.0, -2.0, -3.0, -4.0, -4.0,
2147483637.0, 2147483638.0, 2147483639.0,
2147483640.0, 2147483641.0, 2147483642.0,
2147483643.0, 2147483644.0, 2147483645.0,
2147483646.0, 2147483647.0, kFPUInvalidResult};
- double outputs_RZ[tableLength] = {
+ double outputs_RZ[kTableLength] = {
2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
-2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
2147483637.0, 2147483638.0, 2147483639.0,
2147483640.0, 2147483641.0, 2147483642.0,
2147483643.0, 2147483644.0, 2147483645.0,
2147483646.0, 2147483647.0, kFPUInvalidResult};
- double outputs_RP[tableLength] = {
+ double outputs_RP[kTableLength] = {
3.0, 3.0, 3.0, 4.0, 4.0, 4.0,
-2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
2147483637.0, 2147483638.0, 2147483639.0,
2147483640.0, 2147483641.0, 2147483642.0,
2147483643.0, 2147483644.0, 2147483645.0,
2147483646.0, 2147483647.0, kFPUInvalidResult};
- double outputs_RM[tableLength] = {
+ double outputs_RM[kTableLength] = {
2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
-3.0, -3.0, -3.0, -4.0, -4.0, -4.0,
2147483637.0, 2147483638.0, 2147483639.0,
@@ -2321,7 +2314,7 @@ TEST(cvt_w_d) {
F3 f = FUNCTION_CAST<F3>(code->entry());
for (int j = 0; j < 4; j++) {
test.fcsr = fcsr_inputs[j];
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
CHECK_EQ(test.b, outputs[j][i]);
@@ -2342,22 +2335,22 @@ TEST(trunc_w) {
int32_t c; // a trunc result
int32_t d; // b trunc result
}Test;
- const int tableLength = 15;
- double inputs_D[tableLength] = {
+ const int kTableLength = 15;
+ double inputs_D[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity()
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<float>::quiet_NaN(),
std::numeric_limits<float>::infinity()
};
- double outputs[tableLength] = {
+ double outputs[kTableLength] = {
2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
-2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
kFPUInvalidResult, kFPUInvalidResult,
@@ -2377,7 +2370,7 @@ TEST(trunc_w) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.b = inputs_S[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -2399,22 +2392,22 @@ TEST(round_w) {
int32_t c; // a trunc result
int32_t d; // b trunc result
}Test;
- const int tableLength = 15;
- double inputs_D[tableLength] = {
+ const int kTableLength = 15;
+ double inputs_D[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity()
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<float>::quiet_NaN(),
std::numeric_limits<float>::infinity()
};
- double outputs[tableLength] = {
+ double outputs[kTableLength] = {
2.0, 3.0, 2.0, 3.0, 4.0, 4.0,
-2.0, -3.0, -2.0, -3.0, -4.0, -4.0,
kFPUInvalidResult, kFPUInvalidResult,
@@ -2434,7 +2427,7 @@ TEST(round_w) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.b = inputs_S[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -2456,22 +2449,22 @@ TEST(round_l) {
int64_t c;
int64_t d;
}Test;
- const int tableLength = 15;
- double inputs_D[tableLength] = {
+ const int kTableLength = 15;
+ double inputs_D[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity()
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<float>::quiet_NaN(),
std::numeric_limits<float>::infinity()
};
- double outputs[tableLength] = {
+ double outputs[kTableLength] = {
2.0, 3.0, 2.0, 3.0, 4.0, 4.0,
-2.0, -3.0, -2.0, -3.0, -4.0, -4.0,
2147483648.0, dFPU64InvalidResult,
@@ -2491,7 +2484,7 @@ TEST(round_l) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.b = inputs_S[i];
std::cout<< i<< "\n";
@@ -2503,7 +2496,7 @@ TEST(round_l) {
TEST(sub) {
- const int tableLength = 12;
+ const int kTableLength = 12;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
@@ -2519,27 +2512,27 @@ TEST(sub) {
}TestFloat;
TestFloat test;
- double inputfs_D[tableLength] = {
+ double inputfs_D[kTableLength] = {
5.3, 4.8, 2.9, -5.3, -4.8, -2.9,
5.3, 4.8, 2.9, -5.3, -4.8, -2.9
};
- double inputft_D[tableLength] = {
+ double inputft_D[kTableLength] = {
4.8, 5.3, 2.9, 4.8, 5.3, 2.9,
-4.8, -5.3, -2.9, -4.8, -5.3, -2.9
};
- double outputs_D[tableLength] = {
+ double outputs_D[kTableLength] = {
0.5, -0.5, 0.0, -10.1, -10.1, -5.8,
10.1, 10.1, 5.8, -0.5, 0.5, 0.0
};
- float inputfs_S[tableLength] = {
+ float inputfs_S[kTableLength] = {
5.3, 4.8, 2.9, -5.3, -4.8, -2.9,
5.3, 4.8, 2.9, -5.3, -4.8, -2.9
};
- float inputft_S[tableLength] = {
+ float inputft_S[kTableLength] = {
4.8, 5.3, 2.9, 4.8, 5.3, 2.9,
-4.8, -5.3, -2.9, -4.8, -5.3, -2.9
};
- float outputs_S[tableLength] = {
+ float outputs_S[kTableLength] = {
0.5, -0.5, 0.0, -10.1, -10.1, -5.8,
10.1, 10.1, 5.8, -0.5, 0.5, 0.0
};
@@ -2559,7 +2552,7 @@ TEST(sub) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputfs_S[i];
test.b = inputft_S[i];
test.c = inputfs_D[i];
@@ -2572,7 +2565,7 @@ TEST(sub) {
TEST(sqrt_rsqrt_recip) {
- const int tableLength = 4;
+ const int kTableLength = 4;
const double deltaDouble = 2E-15;
const float deltaFloat = 2E-7;
const float sqrt2_s = sqrt(2);
@@ -2594,18 +2587,18 @@ TEST(sqrt_rsqrt_recip) {
}TestFloat;
TestFloat test;
- double inputs_D[tableLength] = {
+ double inputs_D[kTableLength] = {
0.0L, 4.0L, 2.0L, 4e-28L
};
- double outputs_D[tableLength] = {
+ double outputs_D[kTableLength] = {
0.0L, 2.0L, sqrt2_d, 2e-14L
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
0.0, 4.0, 2.0, 4e-28
};
- float outputs_S[tableLength] = {
+ float outputs_S[kTableLength] = {
0.0, 2.0, sqrt2_s, 2e-14
};
@@ -2633,7 +2626,7 @@ TEST(sqrt_rsqrt_recip) {
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
float f1;
double d1;
test.a = inputs_S[i];
@@ -2668,7 +2661,7 @@ TEST(sqrt_rsqrt_recip) {
TEST(neg) {
- const int tableLength = 2;
+ const int kTableLength = 2;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
@@ -2682,18 +2675,18 @@ TEST(neg) {
}TestFloat;
TestFloat test;
- double inputs_D[tableLength] = {
+ double inputs_D[kTableLength] = {
4.0, -2.0
};
- double outputs_D[tableLength] = {
+ double outputs_D[kTableLength] = {
-4.0, 2.0
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
4.0, -2.0
};
- float outputs_S[tableLength] = {
+ float outputs_S[kTableLength] = {
-4.0, 2.0
};
__ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
@@ -2710,7 +2703,7 @@ TEST(neg) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_S[i];
test.c = inputs_D[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -2722,7 +2715,7 @@ TEST(neg) {
TEST(mul) {
- const int tableLength = 4;
+ const int kTableLength = 4;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
@@ -2738,17 +2731,17 @@ TEST(mul) {
}TestFloat;
TestFloat test;
- double inputfs_D[tableLength] = {
+ double inputfs_D[kTableLength] = {
5.3, -5.3, 5.3, -2.9
};
- double inputft_D[tableLength] = {
+ double inputft_D[kTableLength] = {
4.8, 4.8, -4.8, -0.29
};
- float inputfs_S[tableLength] = {
+ float inputfs_S[kTableLength] = {
5.3, -5.3, 5.3, -2.9
};
- float inputft_S[tableLength] = {
+ float inputft_S[kTableLength] = {
4.8, 4.8, -4.8, -0.29
};
@@ -2768,7 +2761,7 @@ TEST(mul) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputfs_S[i];
test.b = inputft_S[i];
test.c = inputfs_D[i];
@@ -2781,7 +2774,7 @@ TEST(mul) {
TEST(mov) {
- const int tableLength = 4;
+ const int kTableLength = 4;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
@@ -2795,17 +2788,17 @@ TEST(mov) {
}TestFloat;
TestFloat test;
- double inputs_D[tableLength] = {
+ double inputs_D[kTableLength] = {
5.3, -5.3, 5.3, -2.9
};
- double inputs_S[tableLength] = {
+ double inputs_S[kTableLength] = {
4.8, 4.8, -4.8, -0.29
};
- float outputs_S[tableLength] = {
+ float outputs_S[kTableLength] = {
4.8, 4.8, -4.8, -0.29
};
- double outputs_D[tableLength] = {
+ double outputs_D[kTableLength] = {
5.3, -5.3, 5.3, -2.9
};
@@ -2823,7 +2816,7 @@ TEST(mov) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.c = inputs_S[i];
@@ -2846,22 +2839,22 @@ TEST(floor_w) {
int32_t c; // a floor result
int32_t d; // b floor result
}Test;
- const int tableLength = 15;
- double inputs_D[tableLength] = {
+ const int kTableLength = 15;
+ double inputs_D[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity()
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<float>::quiet_NaN(),
std::numeric_limits<float>::infinity()
};
- double outputs[tableLength] = {
+ double outputs[kTableLength] = {
2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
-3.0, -3.0, -3.0, -4.0, -4.0, -4.0,
kFPUInvalidResult, kFPUInvalidResult,
@@ -2881,7 +2874,7 @@ TEST(floor_w) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.b = inputs_S[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -2903,22 +2896,22 @@ TEST(floor_l) {
int64_t c;
int64_t d;
}Test;
- const int tableLength = 15;
- double inputs_D[tableLength] = {
+ const int kTableLength = 15;
+ double inputs_D[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity()
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<float>::quiet_NaN(),
std::numeric_limits<float>::infinity()
};
- double outputs[tableLength] = {
+ double outputs[kTableLength] = {
2.0, 2.0, 2.0, 3.0, 3.0, 3.0,
-3.0, -3.0, -3.0, -4.0, -4.0, -4.0,
2147483648.0, dFPU64InvalidResult,
@@ -2938,7 +2931,7 @@ TEST(floor_l) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.b = inputs_S[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -2960,22 +2953,22 @@ TEST(ceil_w) {
int32_t c; // a floor result
int32_t d; // b floor result
}Test;
- const int tableLength = 15;
- double inputs_D[tableLength] = {
+ const int kTableLength = 15;
+ double inputs_D[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity()
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<float>::quiet_NaN(),
std::numeric_limits<float>::infinity()
};
- double outputs[tableLength] = {
+ double outputs[kTableLength] = {
3.0, 3.0, 3.0, 4.0, 4.0, 4.0,
-2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
kFPUInvalidResult, kFPUInvalidResult,
@@ -2995,7 +2988,7 @@ TEST(ceil_w) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.b = inputs_S[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -3017,22 +3010,22 @@ TEST(ceil_l) {
int64_t c;
int64_t d;
}Test;
- const int tableLength = 15;
- double inputs_D[tableLength] = {
+ const int kTableLength = 15;
+ double inputs_D[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<double>::quiet_NaN(),
std::numeric_limits<double>::infinity()
};
- float inputs_S[tableLength] = {
+ float inputs_S[kTableLength] = {
2.1, 2.6, 2.5, 3.1, 3.6, 3.5,
-2.1, -2.6, -2.5, -3.1, -3.6, -3.5,
2147483648.0,
std::numeric_limits<float>::quiet_NaN(),
std::numeric_limits<float>::infinity()
};
- double outputs[tableLength] = {
+ double outputs[kTableLength] = {
3.0, 3.0, 3.0, 4.0, 4.0, 4.0,
-2.0, -2.0, -2.0, -3.0, -3.0, -3.0,
2147483648.0, dFPU64InvalidResult,
@@ -3052,7 +3045,7 @@ TEST(ceil_l) {
Handle<Code> code = isolate->factory()->NewCode(
desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
F3 f = FUNCTION_CAST<F3>(code->entry());
- for (int i = 0; i < tableLength; i++) {
+ for (int i = 0; i < kTableLength; i++) {
test.a = inputs_D[i];
test.b = inputs_S[i];
(CALL_GENERATED_CODE(f, &test, 0, 0, 0, 0));
@@ -3517,6 +3510,8 @@ TEST(class_fmt) {
Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
USE(dummy);
// Expected double results.
+ CHECK_EQ(bit_cast<int64_t>(t.dSignalingNan), 0x001);
+ CHECK_EQ(bit_cast<int64_t>(t.dQuietNan), 0x002);
CHECK_EQ(bit_cast<int64_t>(t.dNegInf), 0x004);
CHECK_EQ(bit_cast<int64_t>(t.dNegNorm), 0x008);
CHECK_EQ(bit_cast<int64_t>(t.dNegSubnorm), 0x010);
@@ -3527,6 +3522,8 @@ TEST(class_fmt) {
CHECK_EQ(bit_cast<int64_t>(t.dPosZero), 0x200);
// Expected float results.
+ CHECK_EQ(bit_cast<int32_t>(t.fSignalingNan), 0x001);
+ CHECK_EQ(bit_cast<int32_t>(t.fQuietNan), 0x002);
CHECK_EQ(bit_cast<int32_t>(t.fNegInf), 0x004);
CHECK_EQ(bit_cast<int32_t>(t.fNegNorm), 0x008);
CHECK_EQ(bit_cast<int32_t>(t.fNegSubnorm), 0x010);
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698