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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1146 uint32_t trunc_big_out; | 1146 uint32_t trunc_big_out; |
1147 uint32_t trunc_small_out; | 1147 uint32_t trunc_small_out; |
1148 uint32_t cvt_big_in; | 1148 uint32_t cvt_big_in; |
1149 uint32_t cvt_small_in; | 1149 uint32_t cvt_small_in; |
1150 } T; | 1150 } T; |
1151 T t; | 1151 T t; |
1152 | 1152 |
1153 MacroAssembler assm(isolate, NULL, 0); | 1153 MacroAssembler assm(isolate, NULL, 0); |
1154 | 1154 |
1155 __ sw(t0, MemOperand(a0, offsetof(T, cvt_small_in))); | 1155 __ sw(t0, MemOperand(a0, offsetof(T, cvt_small_in))); |
1156 __ Cvt_d_uw(f10, t0, f22); | 1156 __ Cvt_d_uw(f10, t0, f16); |
1157 __ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out))); | 1157 __ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out))); |
1158 | 1158 |
1159 __ Trunc_uw_d(f10, f10, f22); | 1159 __ Trunc_uw_d(f10, f10, f16); |
1160 __ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out))); | 1160 __ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out))); |
1161 | 1161 |
1162 __ sw(t0, MemOperand(a0, offsetof(T, cvt_big_in))); | 1162 __ sw(t0, MemOperand(a0, offsetof(T, cvt_big_in))); |
1163 __ Cvt_d_uw(f8, t0, f22); | 1163 __ Cvt_d_uw(f8, t0, f16); |
1164 __ sdc1(f8, MemOperand(a0, offsetof(T, cvt_big_out))); | 1164 __ sdc1(f8, MemOperand(a0, offsetof(T, cvt_big_out))); |
1165 | 1165 |
1166 __ Trunc_uw_d(f8, f8, f22); | 1166 __ Trunc_uw_d(f8, f8, f16); |
1167 __ swc1(f8, MemOperand(a0, offsetof(T, trunc_big_out))); | 1167 __ swc1(f8, MemOperand(a0, offsetof(T, trunc_big_out))); |
1168 | 1168 |
1169 __ jr(ra); | 1169 __ jr(ra); |
1170 __ nop(); | 1170 __ nop(); |
1171 | 1171 |
1172 CodeDesc desc; | 1172 CodeDesc desc; |
1173 assm.GetCode(&desc); | 1173 assm.GetCode(&desc); |
1174 Handle<Code> code = isolate->factory()->NewCode( | 1174 Handle<Code> code = isolate->factory()->NewCode( |
1175 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 1175 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
1176 F3 f = FUNCTION_CAST<F3>(code->entry()); | 1176 F3 f = FUNCTION_CAST<F3>(code->entry()); |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2502 | 2502 |
2503 __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); | 2503 __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); |
2504 __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); | 2504 __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); |
2505 __ sqrt_s(f6, f2); | 2505 __ sqrt_s(f6, f2); |
2506 __ sqrt_d(f12, f8); | 2506 __ sqrt_d(f12, f8); |
2507 | 2507 |
2508 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) { | 2508 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) { |
2509 __ rsqrt_d(f14, f8); | 2509 __ rsqrt_d(f14, f8); |
2510 __ rsqrt_s(f16, f2); | 2510 __ rsqrt_s(f16, f2); |
2511 __ recip_d(f18, f8); | 2511 __ recip_d(f18, f8); |
2512 __ recip_s(f20, f2); | 2512 __ recip_s(f4, f2); |
2513 } | 2513 } |
2514 __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) ); | 2514 __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) ); |
2515 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); | 2515 __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); |
2516 | 2516 |
2517 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) { | 2517 if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) { |
2518 __ swc1(f16, MemOperand(a0, offsetof(TestFloat, resultS1)) ); | 2518 __ swc1(f16, MemOperand(a0, offsetof(TestFloat, resultS1)) ); |
2519 __ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resultD1)) ); | 2519 __ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resultD1)) ); |
2520 __ swc1(f20, MemOperand(a0, offsetof(TestFloat, resultS2)) ); | 2520 __ swc1(f4, MemOperand(a0, offsetof(TestFloat, resultS2)) ); |
2521 __ sdc1(f18, MemOperand(a0, offsetof(TestFloat, resultD2)) ); | 2521 __ sdc1(f18, MemOperand(a0, offsetof(TestFloat, resultD2)) ); |
2522 } | 2522 } |
2523 __ jr(ra); | 2523 __ jr(ra); |
2524 __ nop(); | 2524 __ nop(); |
2525 | 2525 |
2526 CodeDesc desc; | 2526 CodeDesc desc; |
2527 assm.GetCode(&desc); | 2527 assm.GetCode(&desc); |
2528 Handle<Code> code = isolate->factory()->NewCode( | 2528 Handle<Code> code = isolate->factory()->NewCode( |
2529 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2529 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2530 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2530 F3 f = FUNCTION_CAST<F3>(code->entry()); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2699 4.8, 4.8, -4.8, -0.29 | 2699 4.8, 4.8, -4.8, -0.29 |
2700 }; | 2700 }; |
2701 | 2701 |
2702 float outputs_S[kTableLength] = { | 2702 float outputs_S[kTableLength] = { |
2703 4.8, 4.8, -4.8, -0.29 | 2703 4.8, 4.8, -4.8, -0.29 |
2704 }; | 2704 }; |
2705 double outputs_D[kTableLength] = { | 2705 double outputs_D[kTableLength] = { |
2706 5.3, -5.3, 5.3, -2.9 | 2706 5.3, -5.3, 5.3, -2.9 |
2707 }; | 2707 }; |
2708 | 2708 |
2709 __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); | 2709 __ ldc1(f5, MemOperand(a0, offsetof(TestFloat, a)) ); |
petarj
2015/09/11 14:02:28
Is it possible for this test to be run in fp32 mod
| |
2710 __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) ); | 2710 __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) ); |
2711 __ mov_s(f18, f6); | 2711 __ mov_s(f18, f6); |
2712 __ mov_d(f20, f2); | 2712 __ mov_d(f17, f5); |
petarj
2015/09/11 14:02:28
Same here.
| |
2713 __ swc1(f18, MemOperand(a0, offsetof(TestFloat, d)) ); | 2713 __ swc1(f18, MemOperand(a0, offsetof(TestFloat, d)) ); |
2714 __ sdc1(f20, MemOperand(a0, offsetof(TestFloat, b)) ); | 2714 __ sdc1(f17, MemOperand(a0, offsetof(TestFloat, b)) ); |
petarj
2015/09/11 14:02:28
Ditto.
| |
2715 | |
2715 __ jr(ra); | 2716 __ jr(ra); |
2716 __ nop(); | 2717 __ nop(); |
2717 | 2718 |
2718 CodeDesc desc; | 2719 CodeDesc desc; |
2719 assm.GetCode(&desc); | 2720 assm.GetCode(&desc); |
2720 Handle<Code> code = isolate->factory()->NewCode( | 2721 Handle<Code> code = isolate->factory()->NewCode( |
2721 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 2722 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
2722 F3 f = FUNCTION_CAST<F3>(code->entry()); | 2723 F3 f = FUNCTION_CAST<F3>(code->entry()); |
2723 for (int i = 0; i < kTableLength; i++) { | 2724 for (int i = 0; i < kTableLength; i++) { |
2724 test.a = inputs_D[i]; | 2725 test.a = inputs_D[i]; |
(...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4671 | 4672 |
4672 uint64_t run_beqzc(int32_t value, int32_t offset) { | 4673 uint64_t run_beqzc(int32_t value, int32_t offset) { |
4673 Isolate* isolate = CcTest::i_isolate(); | 4674 Isolate* isolate = CcTest::i_isolate(); |
4674 HandleScope scope(isolate); | 4675 HandleScope scope(isolate); |
4675 | 4676 |
4676 MacroAssembler assm(isolate, NULL, 0); | 4677 MacroAssembler assm(isolate, NULL, 0); |
4677 | 4678 |
4678 Label stop_execution; | 4679 Label stop_execution; |
4679 __ li(v0, 0); | 4680 __ li(v0, 0); |
4680 __ li(t1, 0x66); | 4681 __ li(t1, 0x66); |
4681 __ push(ra); | |
4682 | 4682 |
4683 __ addiu(v0, v0, 0x1); // <-- offset = -32 | 4683 __ addiu(v0, v0, 0x1); // <-- offset = -32 |
4684 __ addiu(v0, v0, 0x2); | 4684 __ addiu(v0, v0, 0x2); |
4685 __ addiu(v0, v0, 0x10); | 4685 __ addiu(v0, v0, 0x10); |
4686 __ addiu(v0, v0, 0x20); | 4686 __ addiu(v0, v0, 0x20); |
4687 __ beq(v0, t1, &stop_execution); | 4687 __ beq(v0, t1, &stop_execution); |
4688 __ nop(); | 4688 __ nop(); |
4689 | 4689 |
4690 __ beqzc(a0, offset); // BEQZC rs, offset | 4690 __ beqzc(a0, offset); // BEQZC rs, offset |
4691 | 4691 |
4692 __ addiu(v0, v0, 0x1); | 4692 __ addiu(v0, v0, 0x1); |
4693 __ addiu(v0, v0, 0x100); | 4693 __ addiu(v0, v0, 0x100); |
4694 __ addiu(v0, v0, 0x200); | 4694 __ addiu(v0, v0, 0x200); |
4695 __ addiu(v0, v0, 0x1000); | 4695 __ addiu(v0, v0, 0x1000); |
4696 __ addiu(v0, v0, 0x2000); // <--- offset = 16 | 4696 __ addiu(v0, v0, 0x2000); // <--- offset = 16 |
4697 __ jr(ra); | 4697 __ jr(ra); |
4698 __ nop(); | 4698 __ nop(); |
4699 | 4699 |
4700 __ bind(&stop_execution); | 4700 __ bind(&stop_execution); |
4701 __ pop(ra); | |
4702 __ jr(ra); | 4701 __ jr(ra); |
4703 __ nop(); | 4702 __ nop(); |
4704 | 4703 |
4705 CodeDesc desc; | 4704 CodeDesc desc; |
4706 assm.GetCode(&desc); | 4705 assm.GetCode(&desc); |
4707 Handle<Code> code = isolate->factory()->NewCode( | 4706 Handle<Code> code = isolate->factory()->NewCode( |
4708 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); | 4707 desc, Code::ComputeFlags(Code::STUB), Handle<Code>()); |
4709 | 4708 |
4710 F2 f = FUNCTION_CAST<F2>(code->entry()); | 4709 F2 f = FUNCTION_CAST<F2>(code->entry()); |
4711 | 4710 |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5098 }; | 5097 }; |
5099 | 5098 |
5100 size_t nr_test_cases = sizeof(tc) / sizeof(TestCaseBal); | 5099 size_t nr_test_cases = sizeof(tc) / sizeof(TestCaseBal); |
5101 for (size_t i = 0; i < nr_test_cases; ++i) { | 5100 for (size_t i = 0; i < nr_test_cases; ++i) { |
5102 CHECK_EQ(tc[i].expected_res, run_bal(tc[i].offset)); | 5101 CHECK_EQ(tc[i].expected_res, run_bal(tc[i].offset)); |
5103 } | 5102 } |
5104 } | 5103 } |
5105 | 5104 |
5106 | 5105 |
5107 #undef __ | 5106 #undef __ |
OLD | NEW |