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

Unified Diff: test/cctest/test-assembler-mips64.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 | « 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 988083cadc0247c799d19cfc67ed70d357f27eb4..a3d5ab5fdab7506ab4b898cf86bdc0bd9cb21e10 100644
--- a/test/cctest/test-assembler-mips64.cc
+++ b/test/cctest/test-assembler-mips64.cc
@@ -1586,10 +1586,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;
@@ -1598,21 +1598,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)));
@@ -1946,16 +1960,20 @@ TEST(rint_s) {
TEST(mina_maxa) {
if (kArchVariant == kMips64r6) {
- 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;
@@ -1964,41 +1982,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 | « test/cctest/test-assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698