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 5440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5451 const size_t kTableLength = sizeof(test_cases) / sizeof(TestCaseMaddMsub<T>); | 5451 const size_t kTableLength = sizeof(test_cases) / sizeof(TestCaseMaddMsub<T>); |
5452 TestCaseMaddMsub<T> tc; | 5452 TestCaseMaddMsub<T> tc; |
5453 for (size_t i = 0; i < kTableLength; i++) { | 5453 for (size_t i = 0; i < kTableLength; i++) { |
5454 tc.fr = test_cases[i].fr; | 5454 tc.fr = test_cases[i].fr; |
5455 tc.fs = test_cases[i].fs; | 5455 tc.fs = test_cases[i].fs; |
5456 tc.ft = test_cases[i].ft; | 5456 tc.ft = test_cases[i].ft; |
5457 | 5457 |
5458 (CALL_GENERATED_CODE(isolate, f, &tc, 0, 0, 0, 0)); | 5458 (CALL_GENERATED_CODE(isolate, f, &tc, 0, 0, 0, 0)); |
5459 | 5459 |
5460 T res_add = tc.fr + (tc.fs * tc.ft); | 5460 T res_add = tc.fr + (tc.fs * tc.ft); |
5461 T res_sub; | 5461 T res_sub = 0; |
5462 if (IsMipsArchVariant(kMips32r2)) { | 5462 if (IsMipsArchVariant(kMips32r2)) { |
5463 res_sub = (tc.fs * tc.ft) - tc.fr; | 5463 res_sub = (tc.fs * tc.ft) - tc.fr; |
5464 } else if (IsMipsArchVariant(kMips32r6)) { | 5464 } else if (IsMipsArchVariant(kMips32r6)) { |
5465 res_sub = tc.fr - (tc.fs * tc.ft); | 5465 res_sub = tc.fr - (tc.fs * tc.ft); |
| 5466 } else { |
| 5467 UNREACHABLE(); |
5466 } | 5468 } |
5467 | 5469 |
5468 CHECK_EQ(tc.fd_add, res_add); | 5470 CHECK_EQ(tc.fd_add, res_add); |
5469 CHECK_EQ(tc.fd_sub, res_sub); | 5471 CHECK_EQ(tc.fd_sub, res_sub); |
5470 } | 5472 } |
5471 } | 5473 } |
5472 | 5474 |
5473 TEST(madd_msub_s) { | 5475 TEST(madd_msub_s) { |
5474 if (!IsMipsArchVariant(kMips32r2)) return; | 5476 if (!IsMipsArchVariant(kMips32r2)) return; |
5475 helper_madd_msub_maddf_msubf<float>([](MacroAssembler& assm) { | 5477 helper_madd_msub_maddf_msubf<float>([](MacroAssembler& assm) { |
(...skipping 28 matching lines...) Expand all Loading... |
5504 if (!IsMipsArchVariant(kMips32r6)) return; | 5506 if (!IsMipsArchVariant(kMips32r6)) return; |
5505 helper_madd_msub_maddf_msubf<double>([](MacroAssembler& assm) { | 5507 helper_madd_msub_maddf_msubf<double>([](MacroAssembler& assm) { |
5506 __ maddf_d(f4, f6, f8); | 5508 __ maddf_d(f4, f6, f8); |
5507 __ sdc1(f4, MemOperand(a0, offsetof(TestCaseMaddMsub<double>, fd_add))); | 5509 __ sdc1(f4, MemOperand(a0, offsetof(TestCaseMaddMsub<double>, fd_add))); |
5508 __ msubf_d(f16, f6, f8); | 5510 __ msubf_d(f16, f6, f8); |
5509 __ sdc1(f16, MemOperand(a0, offsetof(TestCaseMaddMsub<double>, fd_sub))); | 5511 __ sdc1(f16, MemOperand(a0, offsetof(TestCaseMaddMsub<double>, fd_sub))); |
5510 }); | 5512 }); |
5511 } | 5513 } |
5512 | 5514 |
5513 #undef __ | 5515 #undef __ |
OLD | NEW |