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

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

Issue 1668143002: MIPS: Fix FPU min, max, mina, maxa in simulator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « src/mips64/simulator-mips64.cc ('k') | test/cctest/test-assembler-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-assembler-mips.cc
diff --git a/test/cctest/test-assembler-mips.cc b/test/cctest/test-assembler-mips.cc
index 2a620add257358137a7313bac38f9892df957a24..fbad1435644aa8702117b0e8ef7ee3cbabce1869 100644
--- a/test/cctest/test-assembler-mips.cc
+++ b/test/cctest/test-assembler-mips.cc
@@ -1456,10 +1456,10 @@ TEST(min_max) {
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
- MacroAssembler assm(isolate, NULL, 0,
+ MacroAssembler assm(isolate, nullptr, 0,
v8::internal::CodeObjectRequired::kYes);
- typedef struct test_float {
+ struct TestFloat {
double a;
double b;
double c;
@@ -1468,21 +1468,35 @@ TEST(min_max) {
float f;
float g;
float h;
- } TestFloat;
+ };
TestFloat test;
- 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};
+ const double dnan = std::numeric_limits<double>::quiet_NaN();
+ const double dinf = std::numeric_limits<double>::infinity();
+ const double dminf = -std::numeric_limits<double>::infinity();
+ const float fnan = std::numeric_limits<float>::quiet_NaN();
+ const float finf = std::numeric_limits<float>::infinity();
+ const float fminf = std::numeric_limits<float>::infinity();
+ const int kTableLength = 13;
+ double inputsa[kTableLength] = {2.0, 3.0, dnan, 3.0, -0.0, 0.0, dinf,
+ dnan, 42.0, dinf, dminf, dinf, dnan};
+ double inputsb[kTableLength] = {3.0, 2.0, 3.0, dnan, 0.0, -0.0, dnan,
+ dinf, dinf, 42.0, dinf, dminf, dnan};
+ double outputsdmin[kTableLength] = {2.0, 2.0, 3.0, 3.0, -0.0,
+ -0.0, dinf, dinf, 42.0, 42.0,
+ dminf, dminf, dnan};
+ double outputsdmax[kTableLength] = {3.0, 3.0, 3.0, 3.0, 0.0, 0.0, dinf,
+ dinf, dinf, dinf, dinf, dinf, dnan};
+
+ float inputse[kTableLength] = {2.0, 3.0, fnan, 3.0, -0.0, 0.0, finf,
+ fnan, 42.0, finf, fminf, finf, fnan};
+ float inputsf[kTableLength] = {3.0, 2.0, 3.0, fnan, -0.0, 0.0, fnan,
+ finf, finf, 42.0, finf, fminf, fnan};
+ float outputsfmin[kTableLength] = {2.0, 2.0, 3.0, 3.0, -0.0,
+ -0.0, finf, finf, 42.0, 42.0,
+ fminf, fminf, fnan};
+ float outputsfmax[kTableLength] = {3.0, 3.0, 3.0, 3.0, 0.0, 0.0, finf,
+ finf, finf, finf, finf, finf, fnan};
__ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)));
__ ldc1(f8, MemOperand(a0, offsetof(TestFloat, b)));
@@ -1863,16 +1877,20 @@ TEST(Cvt_d_uw) {
TEST(mina_maxa) {
if (IsMipsArchVariant(kMips32r6)) {
- const int kTableLength = 15;
+ const int kTableLength = 23;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
- MacroAssembler assm(isolate, NULL, 0,
+ MacroAssembler assm(isolate, nullptr, 0,
v8::internal::CodeObjectRequired::kYes);
- const double double_nan = std::numeric_limits<double>::quiet_NaN();
- const float float_nan = std::numeric_limits<float>::quiet_NaN();
-
- typedef struct test_float {
+ const double dnan = std::numeric_limits<double>::quiet_NaN();
+ const double dinf = std::numeric_limits<double>::infinity();
+ const double dminf = -std::numeric_limits<double>::infinity();
+ const float fnan = std::numeric_limits<float>::quiet_NaN();
+ const float finf = std::numeric_limits<float>::infinity();
+ const float fminf = std::numeric_limits<float>::infinity();
+
+ struct TestFloat {
double a;
double b;
double resd;
@@ -1881,41 +1899,34 @@ TEST(mina_maxa) {
float d;
float resf;
float resf1;
- }TestFloat;
+ };
TestFloat test;
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
- };
+ 5.3, 4.8, 6.1, 9.8, 9.8, 9.8, -10.0, -8.9, -9.8, -10.0, -8.9, -9.8,
+ dnan, 3.0, -0.0, 0.0, dinf, dnan, 42.0, dinf, dminf, dinf, dnan};
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
- };
+ 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, dnan, 0.0, -0.0, dnan, dinf, dinf, 42.0, dinf, dminf, dnan};
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
- };
+ 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, -0.0, -0.0, dinf, dinf, 42.0, 42.0, dminf, dminf, dnan};
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
- };
+ 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, 0.0, 0.0, dinf, dinf, dinf, dinf, dinf, dinf, dnan};
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[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
- };
+ 5.3, 4.8, 6.1, 9.8, 9.8, 9.8, -10.0, -8.9, -9.8, -10.0, -8.9, -9.8,
+ fnan, 3.0, -0.0, 0.0, finf, fnan, 42.0, finf, fminf, finf, fnan};
+ 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, fnan, -0.0, 0.0, fnan, finf,
+ finf, 42.0, finf, fminf, fnan};
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
- };
+ 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, -0.0, -0.0, finf, finf, 42.0, 42.0, fminf, fminf, fnan};
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
- };
+ 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, 0.0, 0.0, finf, finf, finf, finf, finf, finf, fnan};
__ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
__ ldc1(f4, MemOperand(a0, offsetof(TestFloat, b)) );
« no previous file with comments | « src/mips64/simulator-mips64.cc ('k') | test/cctest/test-assembler-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698