Commit 863ff3e3 authored by Ilija.Pavlovic's avatar Ilija.Pavlovic Committed by Commit bot

MIPS: Fix testcases r6_beqzc and mov.

Remove incorrect usage of callee-saved FPU regs (f20 and above).
Also remove unnecessary push/pop which were occasionally unpaired,
and caused crash.

TEST=cctest/test-assembler-mips[64]
BUG=

Review URL: https://codereview.chromium.org/1338713004

Cr-Commit-Position: refs/heads/master@{#30729}
parent 76ad8ffa
......@@ -2322,12 +2322,12 @@ void Assembler::abs_d(FPURegister fd, FPURegister fs) {
void Assembler::mov_d(FPURegister fd, FPURegister fs) {
GenInstrRegister(COP1, D, f0, fs, fd, MOV_S);
GenInstrRegister(COP1, D, f0, fs, fd, MOV_D);
}
void Assembler::mov_s(FPURegister fd, FPURegister fs) {
GenInstrRegister(COP1, S, f0, fs, fd, MOV_D);
GenInstrRegister(COP1, S, f0, fs, fd, MOV_S);
}
......
......@@ -2634,7 +2634,7 @@ void Assembler::mov_d(FPURegister fd, FPURegister fs) {
void Assembler::mov_s(FPURegister fd, FPURegister fs) {
GenInstrRegister(COP1, S, f0, fs, fd, MOV_D);
GenInstrRegister(COP1, S, f0, fs, fd, MOV_S);
}
......
......@@ -1153,17 +1153,17 @@ TEST(MIPS13) {
MacroAssembler assm(isolate, NULL, 0);
__ sw(t0, MemOperand(a0, offsetof(T, cvt_small_in)));
__ Cvt_d_uw(f10, t0, f22);
__ Cvt_d_uw(f10, t0, f4);
__ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out)));
__ Trunc_uw_d(f10, f10, f22);
__ Trunc_uw_d(f10, f10, f4);
__ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out)));
__ sw(t0, MemOperand(a0, offsetof(T, cvt_big_in)));
__ Cvt_d_uw(f8, t0, f22);
__ Cvt_d_uw(f8, t0, f4);
__ sdc1(f8, MemOperand(a0, offsetof(T, cvt_big_out)));
__ Trunc_uw_d(f8, f8, f22);
__ Trunc_uw_d(f8, f8, f4);
__ swc1(f8, MemOperand(a0, offsetof(T, trunc_big_out)));
__ jr(ra);
......@@ -2509,7 +2509,7 @@ TEST(sqrt_rsqrt_recip) {
__ rsqrt_d(f14, f8);
__ rsqrt_s(f16, f2);
__ recip_d(f18, f8);
__ recip_s(f20, f2);
__ recip_s(f4, f2);
}
__ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) );
__ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) );
......@@ -2517,7 +2517,7 @@ TEST(sqrt_rsqrt_recip) {
if (IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) {
__ swc1(f16, MemOperand(a0, offsetof(TestFloat, resultS1)) );
__ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resultD1)) );
__ swc1(f20, MemOperand(a0, offsetof(TestFloat, resultS2)) );
__ swc1(f4, MemOperand(a0, offsetof(TestFloat, resultS2)) );
__ sdc1(f18, MemOperand(a0, offsetof(TestFloat, resultD2)) );
}
__ jr(ra);
......@@ -2706,12 +2706,13 @@ TEST(mov) {
5.3, -5.3, 5.3, -2.9
};
__ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
__ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)) );
__ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) );
__ mov_s(f18, f6);
__ mov_d(f20, f2);
__ swc1(f18, MemOperand(a0, offsetof(TestFloat, d)) );
__ sdc1(f20, MemOperand(a0, offsetof(TestFloat, b)) );
__ mov_s(f8, f6);
__ mov_d(f10, f4);
__ swc1(f8, MemOperand(a0, offsetof(TestFloat, d)) );
__ sdc1(f10, MemOperand(a0, offsetof(TestFloat, b)) );
__ jr(ra);
__ nop();
......@@ -4678,7 +4679,6 @@ uint64_t run_beqzc(int32_t value, int32_t offset) {
Label stop_execution;
__ li(v0, 0);
__ li(t1, 0x66);
__ push(ra);
__ addiu(v0, v0, 0x1); // <-- offset = -32
__ addiu(v0, v0, 0x2);
......@@ -4698,7 +4698,6 @@ uint64_t run_beqzc(int32_t value, int32_t offset) {
__ nop();
__ bind(&stop_execution);
__ pop(ra);
__ jr(ra);
__ nop();
......
......@@ -1156,17 +1156,17 @@ TEST(MIPS13) {
MacroAssembler assm(isolate, NULL, 0);
__ sw(a4, MemOperand(a0, offsetof(T, cvt_small_in)));
__ Cvt_d_uw(f10, a4, f22);
__ Cvt_d_uw(f10, a4, f4);
__ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out)));
__ Trunc_uw_d(f10, f10, f22);
__ Trunc_uw_d(f10, f10, f4);
__ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out)));
__ sw(a4, MemOperand(a0, offsetof(T, cvt_big_in)));
__ Cvt_d_uw(f8, a4, f22);
__ Cvt_d_uw(f8, a4, f4);
__ sdc1(f8, MemOperand(a0, offsetof(T, cvt_big_out)));
__ Trunc_uw_d(f8, f8, f22);
__ Trunc_uw_d(f8, f8, f4);
__ swc1(f8, MemOperand(a0, offsetof(T, trunc_big_out)));
__ jr(ra);
......@@ -2610,12 +2610,12 @@ TEST(sqrt_rsqrt_recip) {
__ rsqrt_d(f14, f8);
__ rsqrt_s(f16, f2);
__ recip_d(f18, f8);
__ recip_s(f20, f2);
__ recip_s(f4, f2);
__ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) );
__ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) );
__ swc1(f16, MemOperand(a0, offsetof(TestFloat, resultS1)) );
__ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resultD1)) );
__ swc1(f20, MemOperand(a0, offsetof(TestFloat, resultS2)) );
__ swc1(f4, MemOperand(a0, offsetof(TestFloat, resultS2)) );
__ sdc1(f18, MemOperand(a0, offsetof(TestFloat, resultD2)) );
__ jr(ra);
__ nop();
......@@ -2802,12 +2802,12 @@ TEST(mov) {
5.3, -5.3, 5.3, -2.9
};
__ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) );
__ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)) );
__ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) );
__ mov_s(f18, f6);
__ mov_d(f20, f2);
__ swc1(f18, MemOperand(a0, offsetof(TestFloat, d)) );
__ sdc1(f20, MemOperand(a0, offsetof(TestFloat, b)) );
__ mov_s(f8, f6);
__ mov_d(f10, f4);
__ swc1(f8, MemOperand(a0, offsetof(TestFloat, d)) );
__ sdc1(f10, MemOperand(a0, offsetof(TestFloat, b)) );
__ jr(ra);
__ nop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment