diff options
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/code_generator_mips.cc | 9 | ||||
-rw-r--r-- | compiler/optimizing/code_generator_mips.h | 6 | ||||
-rw-r--r-- | compiler/optimizing/emit_swap_mips_test.cc | 36 |
3 files changed, 26 insertions, 25 deletions
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index 61dabfabaa..ff48f6642d 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -99,8 +99,9 @@ Location InvokeDexCallingConventionVisitorMIPS::GetNextLocation(Primitive::Type uint32_t gp_index = gp_index_; gp_index_ += 2; if (gp_index + 1 < calling_convention.GetNumberOfRegisters()) { - if (calling_convention.GetRegisterAt(gp_index) == A1) { - gp_index_++; // Skip A1, and use A2_A3 instead. + Register reg = calling_convention.GetRegisterAt(gp_index); + if (reg == A1 || reg == A3) { + gp_index_++; // Skip A1(A3), and use A2_A3(T0_T1) instead. gp_index++; } Register low_even = calling_convention.GetRegisterAt(gp_index); @@ -5095,9 +5096,9 @@ void LocationsBuilderMIPS::HandleInvoke(HInvoke* invoke) { void LocationsBuilderMIPS::VisitInvokeInterface(HInvokeInterface* invoke) { HandleInvoke(invoke); - // The register T0 is required to be used for the hidden argument in + // The register T7 is required to be used for the hidden argument in // art_quick_imt_conflict_trampoline, so add the hidden argument. - invoke->GetLocations()->AddTemp(Location::RegisterLocation(T0)); + invoke->GetLocations()->AddTemp(Location::RegisterLocation(T7)); } void InstructionCodeGeneratorMIPS::VisitInvokeInterface(HInvokeInterface* invoke) { diff --git a/compiler/optimizing/code_generator_mips.h b/compiler/optimizing/code_generator_mips.h index 2273e52b06..f03f29c5d4 100644 --- a/compiler/optimizing/code_generator_mips.h +++ b/compiler/optimizing/code_generator_mips.h @@ -32,11 +32,11 @@ namespace mips { // InvokeDexCallingConvention registers static constexpr Register kParameterCoreRegisters[] = - { A1, A2, A3 }; + { A1, A2, A3, T0, T1 }; static constexpr size_t kParameterCoreRegistersLength = arraysize(kParameterCoreRegisters); static constexpr FRegister kParameterFpuRegisters[] = - { F12, F14 }; + { F8, F10, F12, F14, F16, F18 }; static constexpr size_t kParameterFpuRegistersLength = arraysize(kParameterFpuRegisters); @@ -48,7 +48,7 @@ static constexpr size_t kRuntimeParameterCoreRegistersLength = arraysize(kRuntimeParameterCoreRegisters); static constexpr FRegister kRuntimeParameterFpuRegisters[] = - { F12, F14}; + { F12, F14 }; static constexpr size_t kRuntimeParameterFpuRegistersLength = arraysize(kRuntimeParameterFpuRegisters); diff --git a/compiler/optimizing/emit_swap_mips_test.cc b/compiler/optimizing/emit_swap_mips_test.cc index 9dc53e6811..0d4e1c5c97 100644 --- a/compiler/optimizing/emit_swap_mips_test.cc +++ b/compiler/optimizing/emit_swap_mips_test.cc @@ -154,54 +154,54 @@ TEST_F(EmitSwapMipsTest, TwoRegisterPairs) { TEST_F(EmitSwapMipsTest, TwoFpuRegistersFloat) { moves_->AddMove( Location::FpuRegisterLocation(4), - Location::FpuRegisterLocation(6), + Location::FpuRegisterLocation(2), Primitive::kPrimFloat, nullptr); moves_->AddMove( - Location::FpuRegisterLocation(6), + Location::FpuRegisterLocation(2), Location::FpuRegisterLocation(4), Primitive::kPrimFloat, nullptr); const char* expected = - "mov.s $f8, $f6\n" - "mov.s $f6, $f4\n" - "mov.s $f4, $f8\n"; + "mov.s $f6, $f2\n" + "mov.s $f2, $f4\n" + "mov.s $f4, $f6\n"; DriverWrapper(moves_, expected, "TwoFpuRegistersFloat"); } TEST_F(EmitSwapMipsTest, TwoFpuRegistersDouble) { moves_->AddMove( Location::FpuRegisterLocation(4), - Location::FpuRegisterLocation(6), + Location::FpuRegisterLocation(2), Primitive::kPrimDouble, nullptr); moves_->AddMove( - Location::FpuRegisterLocation(6), + Location::FpuRegisterLocation(2), Location::FpuRegisterLocation(4), Primitive::kPrimDouble, nullptr); const char* expected = - "mov.d $f8, $f6\n" - "mov.d $f6, $f4\n" - "mov.d $f4, $f8\n"; + "mov.d $f6, $f2\n" + "mov.d $f2, $f4\n" + "mov.d $f4, $f6\n"; DriverWrapper(moves_, expected, "TwoFpuRegistersDouble"); } TEST_F(EmitSwapMipsTest, RegisterAndFpuRegister) { moves_->AddMove( Location::RegisterLocation(4), - Location::FpuRegisterLocation(6), + Location::FpuRegisterLocation(2), Primitive::kPrimFloat, nullptr); moves_->AddMove( - Location::FpuRegisterLocation(6), + Location::FpuRegisterLocation(2), Location::RegisterLocation(4), Primitive::kPrimFloat, nullptr); const char* expected = "or $t8, $a0, $zero\n" - "mfc1 $a0, $f6\n" - "mtc1 $t8, $f6\n"; + "mfc1 $a0, $f2\n" + "mtc1 $t8, $f2\n"; DriverWrapper(moves_, expected, "RegisterAndFpuRegister"); } @@ -327,9 +327,9 @@ TEST_F(EmitSwapMipsTest, FpuRegisterAndStackSlot) { Primitive::kPrimFloat, nullptr); const char* expected = - "mov.s $f8, $f4\n" + "mov.s $f6, $f4\n" "lwc1 $f4, 48($sp)\n" - "swc1 $f8, 48($sp)\n"; + "swc1 $f6, 48($sp)\n"; DriverWrapper(moves_, expected, "FpuRegisterAndStackSlot"); } @@ -345,9 +345,9 @@ TEST_F(EmitSwapMipsTest, FpuRegisterAndDoubleStackSlot) { Primitive::kPrimDouble, nullptr); const char* expected = - "mov.d $f8, $f4\n" + "mov.d $f6, $f4\n" "ldc1 $f4, 48($sp)\n" - "sdc1 $f8, 48($sp)\n"; + "sdc1 $f6, 48($sp)\n"; DriverWrapper(moves_, expected, "FpuRegisterAndDoubleStackSlot"); } |