| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1399 __ jr(ra); | 1399 __ jr(ra); |
| 1400 __ nop(); | 1400 __ nop(); |
| 1401 CodeDesc desc; | 1401 CodeDesc desc; |
| 1402 assm.GetCode(&desc); | 1402 assm.GetCode(&desc); |
| 1403 Handle<Code> code = isolate->factory()->NewCode( | 1403 Handle<Code> code = isolate->factory()->NewCode( |
| 1404 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1404 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 1405 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1405 F3 f = FUNCTION_CAST<F3>(code->entry()); |
| 1406 | 1406 |
| 1407 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 1407 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 1408 | 1408 |
| 1409 CHECK_EQ(test.a, 1); | 1409 CHECK_EQ(1, test.a); |
| 1410 CHECK_EQ(test.b, 0); | 1410 CHECK_EQ(0, test.b); |
| 1411 CHECK_EQ(test.c, 0); | 1411 CHECK_EQ(0, test.c); |
| 1412 CHECK_EQ(test.d, 1); | 1412 CHECK_EQ(1, test.d); |
| 1413 | 1413 |
| 1414 const int test_size = 3; | 1414 const int test_size = 3; |
| 1415 const int input_size = 5; | 1415 const int input_size = 5; |
| 1416 | 1416 |
| 1417 double inputs_D[input_size] = {0.0, 65.2, -70.32, | 1417 double inputs_D[input_size] = {0.0, 65.2, -70.32, |
| 1418 18446744073709551621.0, -18446744073709551621.0}; | 1418 18446744073709551621.0, -18446744073709551621.0}; |
| 1419 double outputs_D[input_size] = {0.0, 65.2, -70.32, | 1419 double outputs_D[input_size] = {0.0, 65.2, -70.32, |
| 1420 18446744073709551621.0, -18446744073709551621.0}; | 1420 18446744073709551621.0, -18446744073709551621.0}; |
| 1421 double tests_D[test_size*2] = {2.8, 2.9, -2.8, -2.9, | 1421 double tests_D[test_size*2] = {2.8, 2.9, -2.8, -2.9, |
| 1422 18446744073709551616.0, 18446744073709555712.0}; | 1422 18446744073709551616.0, 18446744073709555712.0}; |
| 1423 float inputs_S[input_size] = {0.0, 65.2, -70.32, | 1423 float inputs_S[input_size] = {0.0, 65.2, -70.32, |
| 1424 18446744073709551621.0, -18446744073709551621.0}; | 1424 18446744073709551621.0, -18446744073709551621.0}; |
| 1425 float outputs_S[input_size] = {0.0, 65.2, -70.32, | 1425 float outputs_S[input_size] = {0.0, 65.2, -70.32, |
| 1426 18446744073709551621.0, -18446744073709551621.0}; | 1426 18446744073709551621.0, -18446744073709551621.0}; |
| 1427 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8, | 1427 float tests_S[test_size*2] = {2.9, 2.8, -2.9, -2.8, |
| 1428 18446744073709551616.0, 18446746272732807168.0}; | 1428 18446744073709551616.0, 18446746272732807168.0}; |
| 1429 for (int j=0; j < test_size; j+=2) { | 1429 for (int j=0; j < test_size; j+=2) { |
| 1430 for (int i=0; i < input_size; i++) { | 1430 for (int i=0; i < input_size; i++) { |
| 1431 test.e = inputs_D[i]; | 1431 test.e = inputs_D[i]; |
| 1432 test.f = tests_D[j]; | 1432 test.f = tests_D[j]; |
| 1433 test.i = inputs_S[i]; | 1433 test.i = inputs_S[i]; |
| 1434 test.j = tests_S[j]; | 1434 test.j = tests_S[j]; |
| 1435 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 1435 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 1436 CHECK_EQ(test.g, outputs_D[i]); | 1436 CHECK_EQ(outputs_D[i], test.g); |
| 1437 CHECK_EQ(test.h, 0); | 1437 CHECK_EQ(0, test.h); |
| 1438 CHECK_EQ(test.k, outputs_S[i]); | 1438 CHECK_EQ(outputs_S[i], test.k); |
| 1439 CHECK_EQ(test.l, 0); | 1439 CHECK_EQ(0, test.l); |
| 1440 | 1440 |
| 1441 test.f = tests_D[j+1]; | 1441 test.f = tests_D[j+1]; |
| 1442 test.j = tests_S[j+1]; | 1442 test.j = tests_S[j+1]; |
| 1443 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 1443 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 1444 CHECK_EQ(test.g, 0); | 1444 CHECK_EQ(0, test.g); |
| 1445 CHECK_EQ(test.h, outputs_D[i]); | 1445 CHECK_EQ(outputs_D[i], test.h); |
| 1446 CHECK_EQ(test.k, 0); | 1446 CHECK_EQ(0, test.k); |
| 1447 CHECK_EQ(test.l, outputs_S[i]); | 1447 CHECK_EQ(outputs_S[i], test.l); |
| 1448 } | 1448 } |
| 1449 } | 1449 } |
| 1450 } | 1450 } |
| 1451 } | 1451 } |
| 1452 | 1452 |
| 1453 | 1453 |
| 1454 TEST(min_max) { | 1454 TEST(min_max) { |
| 1455 if (IsMipsArchVariant(kMips32r6)) { | 1455 if (IsMipsArchVariant(kMips32r6)) { |
| 1456 CcTest::InitializeVM(); | 1456 CcTest::InitializeVM(); |
| 1457 Isolate* isolate = CcTest::i_isolate(); | 1457 Isolate* isolate = CcTest::i_isolate(); |
| (...skipping 1726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3184 __ b(&done); | 3184 __ b(&done); |
| 3185 __ nop(); | 3185 __ nop(); |
| 3186 } | 3186 } |
| 3187 | 3187 |
| 3188 __ bind(&done); | 3188 __ bind(&done); |
| 3189 __ lw(ra, MemOperand(sp)); | 3189 __ lw(ra, MemOperand(sp)); |
| 3190 __ addiu(sp, sp, 4); | 3190 __ addiu(sp, sp, 4); |
| 3191 __ jr(ra); | 3191 __ jr(ra); |
| 3192 __ nop(); | 3192 __ nop(); |
| 3193 | 3193 |
| 3194 CHECK_EQ(assm.UnboundLabelsCount(), 0); | 3194 CHECK_EQ(0, assm.UnboundLabelsCount()); |
| 3195 | 3195 |
| 3196 CodeDesc desc; | 3196 CodeDesc desc; |
| 3197 assm.GetCode(&desc); | 3197 assm.GetCode(&desc); |
| 3198 Handle<Code> code = isolate->factory()->NewCode( | 3198 Handle<Code> code = isolate->factory()->NewCode( |
| 3199 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 3199 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 3200 #ifdef OBJECT_PRINT | 3200 #ifdef OBJECT_PRINT |
| 3201 code->Print(std::cout); | 3201 code->Print(std::cout); |
| 3202 #endif | 3202 #endif |
| 3203 F1 f = FUNCTION_CAST<F1>(code->entry()); | 3203 F1 f = FUNCTION_CAST<F1>(code->entry()); |
| 3204 for (int i = 0; i < kNumCases; ++i) { | 3204 for (int i = 0; i < kNumCases; ++i) { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3663 / std::numeric_limits<float>::min(); | 3663 / std::numeric_limits<float>::min(); |
| 3664 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 3664 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 3665 CHECK_EQ(test.a, std::numeric_limits<double>::max() | 3665 CHECK_EQ(test.a, std::numeric_limits<double>::max() |
| 3666 / std::numeric_limits<double>::min()); | 3666 / std::numeric_limits<double>::min()); |
| 3667 CHECK_EQ(test.b, std::numeric_limits<float>::max() | 3667 CHECK_EQ(test.b, std::numeric_limits<float>::max() |
| 3668 / std::numeric_limits<float>::min()); | 3668 / std::numeric_limits<float>::min()); |
| 3669 | 3669 |
| 3670 test.a = std::numeric_limits<double>::quiet_NaN(); | 3670 test.a = std::numeric_limits<double>::quiet_NaN(); |
| 3671 test.b = std::numeric_limits<float>::quiet_NaN(); | 3671 test.b = std::numeric_limits<float>::quiet_NaN(); |
| 3672 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 3672 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 3673 CHECK_EQ(std::isnan(test.a), true); | 3673 CHECK(std::isnan(test.a)); |
| 3674 CHECK_EQ(std::isnan(test.b), true); | 3674 CHECK(std::isnan(test.b)); |
| 3675 | 3675 |
| 3676 test.a = std::numeric_limits<double>::signaling_NaN(); | 3676 test.a = std::numeric_limits<double>::signaling_NaN(); |
| 3677 test.b = std::numeric_limits<float>::signaling_NaN(); | 3677 test.b = std::numeric_limits<float>::signaling_NaN(); |
| 3678 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 3678 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 3679 CHECK_EQ(std::isnan(test.a), true); | 3679 CHECK(std::isnan(test.a)); |
| 3680 CHECK_EQ(std::isnan(test.b), true); | 3680 CHECK(std::isnan(test.b)); |
| 3681 } | 3681 } |
| 3682 | 3682 |
| 3683 | 3683 |
| 3684 TEST(ADD_FMT) { | 3684 TEST(ADD_FMT) { |
| 3685 CcTest::InitializeVM(); | 3685 CcTest::InitializeVM(); |
| 3686 Isolate* isolate = CcTest::i_isolate(); | 3686 Isolate* isolate = CcTest::i_isolate(); |
| 3687 HandleScope scope(isolate); | 3687 HandleScope scope(isolate); |
| 3688 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes); | 3688 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes); |
| 3689 | 3689 |
| 3690 typedef struct test_float { | 3690 typedef struct test_float { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3730 test.fb = -std::numeric_limits<float>::max(); // lowest() | 3730 test.fb = -std::numeric_limits<float>::max(); // lowest() |
| 3731 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 3731 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 3732 CHECK_EQ(test.c, 0.0); | 3732 CHECK_EQ(test.c, 0.0); |
| 3733 CHECK_EQ(test.fc, 0.0); | 3733 CHECK_EQ(test.fc, 0.0); |
| 3734 | 3734 |
| 3735 test.a = std::numeric_limits<double>::max(); | 3735 test.a = std::numeric_limits<double>::max(); |
| 3736 test.b = std::numeric_limits<double>::max(); | 3736 test.b = std::numeric_limits<double>::max(); |
| 3737 test.fa = std::numeric_limits<float>::max(); | 3737 test.fa = std::numeric_limits<float>::max(); |
| 3738 test.fb = std::numeric_limits<float>::max(); | 3738 test.fb = std::numeric_limits<float>::max(); |
| 3739 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 3739 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 3740 CHECK_EQ(std::isfinite(test.c), false); | 3740 CHECK(!std::isfinite(test.c)); |
| 3741 CHECK_EQ(std::isfinite(test.fc), false); | 3741 CHECK(!std::isfinite(test.fc)); |
| 3742 | 3742 |
| 3743 test.a = 5.0; | 3743 test.a = 5.0; |
| 3744 test.b = std::numeric_limits<double>::signaling_NaN(); | 3744 test.b = std::numeric_limits<double>::signaling_NaN(); |
| 3745 test.fa = 5.0; | 3745 test.fa = 5.0; |
| 3746 test.fb = std::numeric_limits<float>::signaling_NaN(); | 3746 test.fb = std::numeric_limits<float>::signaling_NaN(); |
| 3747 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 3747 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 3748 CHECK_EQ(std::isnan(test.c), true); | 3748 CHECK(std::isnan(test.c)); |
| 3749 CHECK_EQ(std::isnan(test.fc), true); | 3749 CHECK(std::isnan(test.fc)); |
| 3750 } | 3750 } |
| 3751 | 3751 |
| 3752 | 3752 |
| 3753 TEST(C_COND_FMT) { | 3753 TEST(C_COND_FMT) { |
| 3754 if ((IsMipsArchVariant(kMips32r1)) || (IsMipsArchVariant(kMips32r2))) { | 3754 if ((IsMipsArchVariant(kMips32r1)) || (IsMipsArchVariant(kMips32r2))) { |
| 3755 CcTest::InitializeVM(); | 3755 CcTest::InitializeVM(); |
| 3756 Isolate* isolate = CcTest::i_isolate(); | 3756 Isolate* isolate = CcTest::i_isolate(); |
| 3757 HandleScope scope(isolate); | 3757 HandleScope scope(isolate); |
| 3758 MacroAssembler assm(isolate, NULL, 0, | 3758 MacroAssembler assm(isolate, NULL, 0, |
| 3759 v8::internal::CodeObjectRequired::kYes); | 3759 v8::internal::CodeObjectRequired::kYes); |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4271 test.cvt_w_d_in = -0.51; | 4271 test.cvt_w_d_in = -0.51; |
| 4272 | 4272 |
| 4273 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 4273 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 4274 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); | 4274 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); |
| 4275 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); | 4275 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); |
| 4276 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 4276 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
| 4277 IsFp64Mode()) { | 4277 IsFp64Mode()) { |
| 4278 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); | 4278 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); |
| 4279 } | 4279 } |
| 4280 if (IsFp64Mode()) { | 4280 if (IsFp64Mode()) { |
| 4281 CHECK_EQ(test.cvt_l_s_out, -1); | 4281 CHECK_EQ(-1, test.cvt_l_s_out); |
| 4282 CHECK_EQ(test.cvt_l_d_out, -1); | 4282 CHECK_EQ(-1, test.cvt_l_d_out); |
| 4283 } | 4283 } |
| 4284 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); | 4284 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); |
| 4285 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); | 4285 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); |
| 4286 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 4286 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
| 4287 IsFp64Mode()) { | 4287 IsFp64Mode()) { |
| 4288 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); | 4288 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); |
| 4289 } | 4289 } |
| 4290 CHECK_EQ(test.cvt_w_s_out, -1); | 4290 CHECK_EQ(-1, test.cvt_w_s_out); |
| 4291 CHECK_EQ(test.cvt_w_d_out, -1); | 4291 CHECK_EQ(-1, test.cvt_w_d_out); |
| 4292 | |
| 4293 | 4292 |
| 4294 test.cvt_d_s_in = 0.49; | 4293 test.cvt_d_s_in = 0.49; |
| 4295 test.cvt_d_w_in = 1; | 4294 test.cvt_d_w_in = 1; |
| 4296 test.cvt_d_l_in = 1; | 4295 test.cvt_d_l_in = 1; |
| 4297 test.cvt_l_s_in = 0.49; | 4296 test.cvt_l_s_in = 0.49; |
| 4298 test.cvt_l_d_in = 0.49; | 4297 test.cvt_l_d_in = 0.49; |
| 4299 test.cvt_s_d_in = 0.49; | 4298 test.cvt_s_d_in = 0.49; |
| 4300 test.cvt_s_w_in = 1; | 4299 test.cvt_s_w_in = 1; |
| 4301 test.cvt_s_l_in = 1; | 4300 test.cvt_s_l_in = 1; |
| 4302 test.cvt_w_s_in = 0.49; | 4301 test.cvt_w_s_in = 0.49; |
| 4303 test.cvt_w_d_in = 0.49; | 4302 test.cvt_w_d_in = 0.49; |
| 4304 | 4303 |
| 4305 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 4304 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 4306 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); | 4305 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); |
| 4307 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); | 4306 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); |
| 4308 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 4307 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
| 4309 IsFp64Mode()) { | 4308 IsFp64Mode()) { |
| 4310 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); | 4309 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); |
| 4311 } | 4310 } |
| 4312 if (IsFp64Mode()) { | 4311 if (IsFp64Mode()) { |
| 4313 CHECK_EQ(test.cvt_l_s_out, 0); | 4312 CHECK_EQ(0, test.cvt_l_s_out); |
| 4314 CHECK_EQ(test.cvt_l_d_out, 0); | 4313 CHECK_EQ(0, test.cvt_l_d_out); |
| 4315 } | 4314 } |
| 4316 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); | 4315 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); |
| 4317 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); | 4316 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); |
| 4318 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 4317 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
| 4319 IsFp64Mode()) { | 4318 IsFp64Mode()) { |
| 4320 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); | 4319 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); |
| 4321 } | 4320 } |
| 4322 CHECK_EQ(test.cvt_w_s_out, 0); | 4321 CHECK_EQ(0, test.cvt_w_s_out); |
| 4323 CHECK_EQ(test.cvt_w_d_out, 0); | 4322 CHECK_EQ(0, test.cvt_w_d_out); |
| 4324 | 4323 |
| 4325 test.cvt_d_s_in = std::numeric_limits<float>::max(); | 4324 test.cvt_d_s_in = std::numeric_limits<float>::max(); |
| 4326 test.cvt_d_w_in = std::numeric_limits<int32_t>::max(); | 4325 test.cvt_d_w_in = std::numeric_limits<int32_t>::max(); |
| 4327 test.cvt_d_l_in = std::numeric_limits<int64_t>::max(); | 4326 test.cvt_d_l_in = std::numeric_limits<int64_t>::max(); |
| 4328 test.cvt_l_s_in = std::numeric_limits<float>::max(); | 4327 test.cvt_l_s_in = std::numeric_limits<float>::max(); |
| 4329 test.cvt_l_d_in = std::numeric_limits<double>::max(); | 4328 test.cvt_l_d_in = std::numeric_limits<double>::max(); |
| 4330 test.cvt_s_d_in = std::numeric_limits<double>::max(); | 4329 test.cvt_s_d_in = std::numeric_limits<double>::max(); |
| 4331 test.cvt_s_w_in = std::numeric_limits<int32_t>::max(); | 4330 test.cvt_s_w_in = std::numeric_limits<int32_t>::max(); |
| 4332 test.cvt_s_l_in = std::numeric_limits<int64_t>::max(); | 4331 test.cvt_s_l_in = std::numeric_limits<int64_t>::max(); |
| 4333 test.cvt_w_s_in = std::numeric_limits<float>::max(); | 4332 test.cvt_w_s_in = std::numeric_limits<float>::max(); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4405 test.cvt_w_d_in = std::numeric_limits<double>::min(); | 4404 test.cvt_w_d_in = std::numeric_limits<double>::min(); |
| 4406 | 4405 |
| 4407 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 4406 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 4408 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); | 4407 CHECK_EQ(test.cvt_d_s_out, static_cast<double>(test.cvt_d_s_in)); |
| 4409 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); | 4408 CHECK_EQ(test.cvt_d_w_out, static_cast<double>(test.cvt_d_w_in)); |
| 4410 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 4409 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
| 4411 IsFp64Mode()) { | 4410 IsFp64Mode()) { |
| 4412 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); | 4411 CHECK_EQ(test.cvt_d_l_out, static_cast<double>(test.cvt_d_l_in)); |
| 4413 } | 4412 } |
| 4414 if (IsFp64Mode()) { | 4413 if (IsFp64Mode()) { |
| 4415 CHECK_EQ(test.cvt_l_s_out, 0); | 4414 CHECK_EQ(0, test.cvt_l_s_out); |
| 4416 CHECK_EQ(test.cvt_l_d_out, 0); | 4415 CHECK_EQ(0, test.cvt_l_d_out); |
| 4417 } | 4416 } |
| 4418 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); | 4417 CHECK_EQ(test.cvt_s_d_out, static_cast<float>(test.cvt_s_d_in)); |
| 4419 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); | 4418 CHECK_EQ(test.cvt_s_w_out, static_cast<float>(test.cvt_s_w_in)); |
| 4420 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 4419 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
| 4421 IsFp64Mode()) { | 4420 IsFp64Mode()) { |
| 4422 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); | 4421 CHECK_EQ(test.cvt_s_l_out, static_cast<float>(test.cvt_s_l_in)); |
| 4423 } | 4422 } |
| 4424 CHECK_EQ(test.cvt_w_s_out, 0); | 4423 CHECK_EQ(0, test.cvt_w_s_out); |
| 4425 CHECK_EQ(test.cvt_w_d_out, 0); | 4424 CHECK_EQ(0, test.cvt_w_d_out); |
| 4426 } | 4425 } |
| 4427 | 4426 |
| 4428 | 4427 |
| 4429 TEST(DIV_FMT) { | 4428 TEST(DIV_FMT) { |
| 4430 CcTest::InitializeVM(); | 4429 CcTest::InitializeVM(); |
| 4431 Isolate* isolate = CcTest::i_isolate(); | 4430 Isolate* isolate = CcTest::i_isolate(); |
| 4432 HandleScope scope(isolate); | 4431 HandleScope scope(isolate); |
| 4433 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes); | 4432 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes); |
| 4434 | 4433 |
| 4435 typedef struct test { | 4434 typedef struct test { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4518 CHECK_EQ(test.dRes, dRes[i]); | 4517 CHECK_EQ(test.dRes, dRes[i]); |
| 4519 CHECK_EQ(test.fRes, fRes[i]); | 4518 CHECK_EQ(test.fRes, fRes[i]); |
| 4520 } | 4519 } |
| 4521 | 4520 |
| 4522 test.dOp1 = DBL_MAX; | 4521 test.dOp1 = DBL_MAX; |
| 4523 test.dOp2 = -0.0; | 4522 test.dOp2 = -0.0; |
| 4524 test.fOp1 = FLT_MAX; | 4523 test.fOp1 = FLT_MAX; |
| 4525 test.fOp2 = -0.0; | 4524 test.fOp2 = -0.0; |
| 4526 | 4525 |
| 4527 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 4526 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 4528 CHECK_EQ(false, std::isfinite(test.dRes)); | 4527 CHECK(!std::isfinite(test.dRes)); |
| 4529 CHECK_EQ(false, std::isfinite(test.fRes)); | 4528 CHECK(!std::isfinite(test.fRes)); |
| 4530 | 4529 |
| 4531 test.dOp1 = 0.0; | 4530 test.dOp1 = 0.0; |
| 4532 test.dOp2 = -0.0; | 4531 test.dOp2 = -0.0; |
| 4533 test.fOp1 = 0.0; | 4532 test.fOp1 = 0.0; |
| 4534 test.fOp2 = -0.0; | 4533 test.fOp2 = -0.0; |
| 4535 | 4534 |
| 4536 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 4535 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 4537 CHECK_EQ(true, std::isnan(test.dRes)); | 4536 CHECK(std::isnan(test.dRes)); |
| 4538 CHECK_EQ(true, std::isnan(test.fRes)); | 4537 CHECK(std::isnan(test.fRes)); |
| 4539 | 4538 |
| 4540 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); | 4539 test.dOp1 = std::numeric_limits<double>::quiet_NaN(); |
| 4541 test.dOp2 = -5.0; | 4540 test.dOp2 = -5.0; |
| 4542 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); | 4541 test.fOp1 = std::numeric_limits<float>::quiet_NaN(); |
| 4543 test.fOp2 = -5.0; | 4542 test.fOp2 = -5.0; |
| 4544 | 4543 |
| 4545 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); | 4544 (CALL_GENERATED_CODE(isolate, f, &test, 0, 0, 0, 0)); |
| 4546 CHECK_EQ(true, std::isnan(test.dRes)); | 4545 CHECK(std::isnan(test.dRes)); |
| 4547 CHECK_EQ(true, std::isnan(test.fRes)); | 4546 CHECK(std::isnan(test.fRes)); |
| 4548 } | 4547 } |
| 4549 | 4548 |
| 4550 | 4549 |
| 4551 uint32_t run_align(uint32_t rs_value, uint32_t rt_value, uint8_t bp) { | 4550 uint32_t run_align(uint32_t rs_value, uint32_t rt_value, uint8_t bp) { |
| 4552 Isolate* isolate = CcTest::i_isolate(); | 4551 Isolate* isolate = CcTest::i_isolate(); |
| 4553 HandleScope scope(isolate); | 4552 HandleScope scope(isolate); |
| 4554 | 4553 |
| 4555 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes); | 4554 MacroAssembler assm(isolate, NULL, 0, v8::internal::CodeObjectRequired::kYes); |
| 4556 | 4555 |
| 4557 __ align(v0, a0, a1, bp); | 4556 __ align(v0, a0, a1, bp); |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5376 __ mov(v0, zero_reg); | 5375 __ mov(v0, zero_reg); |
| 5377 | 5376 |
| 5378 CodeDesc desc; | 5377 CodeDesc desc; |
| 5379 assm.GetCode(&desc); | 5378 assm.GetCode(&desc); |
| 5380 Handle<Code> code = isolate->factory()->NewCode( | 5379 Handle<Code> code = isolate->factory()->NewCode( |
| 5381 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 5380 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
| 5382 F2 f = FUNCTION_CAST<F2>(code->entry()); | 5381 F2 f = FUNCTION_CAST<F2>(code->entry()); |
| 5383 | 5382 |
| 5384 int32_t res = reinterpret_cast<int32_t>( | 5383 int32_t res = reinterpret_cast<int32_t>( |
| 5385 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0)); | 5384 CALL_GENERATED_CODE(isolate, f, 42, 42, 0, 0, 0)); |
| 5386 CHECK_EQ(res, 0); | 5385 CHECK_EQ(0, res); |
| 5387 } | 5386 } |
| 5388 | 5387 |
| 5389 template <class T> | 5388 template <class T> |
| 5390 struct TestCaseMaddMsub { | 5389 struct TestCaseMaddMsub { |
| 5391 T fr, fs, ft, fd_add, fd_sub; | 5390 T fr, fs, ft, fd_add, fd_sub; |
| 5392 }; | 5391 }; |
| 5393 | 5392 |
| 5394 template <typename T, typename F> | 5393 template <typename T, typename F> |
| 5395 void helper_madd_msub_maddf_msubf(F func) { | 5394 void helper_madd_msub_maddf_msubf(F func) { |
| 5396 CcTest::InitializeVM(); | 5395 CcTest::InitializeVM(); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5508 if (!IsMipsArchVariant(kMips32r6)) return; | 5507 if (!IsMipsArchVariant(kMips32r6)) return; |
| 5509 helper_madd_msub_maddf_msubf<double>([](MacroAssembler& assm) { | 5508 helper_madd_msub_maddf_msubf<double>([](MacroAssembler& assm) { |
| 5510 __ maddf_d(f4, f6, f8); | 5509 __ maddf_d(f4, f6, f8); |
| 5511 __ sdc1(f4, MemOperand(a0, offsetof(TestCaseMaddMsub<double>, fd_add))); | 5510 __ sdc1(f4, MemOperand(a0, offsetof(TestCaseMaddMsub<double>, fd_add))); |
| 5512 __ msubf_d(f16, f6, f8); | 5511 __ msubf_d(f16, f6, f8); |
| 5513 __ sdc1(f16, MemOperand(a0, offsetof(TestCaseMaddMsub<double>, fd_sub))); | 5512 __ sdc1(f16, MemOperand(a0, offsetof(TestCaseMaddMsub<double>, fd_sub))); |
| 5514 }); | 5513 }); |
| 5515 } | 5514 } |
| 5516 | 5515 |
| 5517 #undef __ | 5516 #undef __ |
| OLD | NEW |