diff options
| author | 2014-10-27 17:23:51 +0000 | |
|---|---|---|
| committer | 2014-10-27 17:23:51 +0000 | |
| commit | 2deace28b16d3161ccd6a85a2c577e83f4b25364 (patch) | |
| tree | 33798cdbf2d7a6621f8c6b68ccbd5d2d4cf2a4d1 /compiler/optimizing/code_generator.cc | |
| parent | 7066718bc494654f5ac71698f40aff1421168252 (diff) | |
| parent | 1ba0f596e9e4ddd778ab431237d11baa85594eba (diff) | |
Merge "Support hard float on arm in optimizing compiler."
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
| -rw-r--r-- | compiler/optimizing/code_generator.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index c4286a401b..28ff1cf83a 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -111,6 +111,20 @@ size_t CodeGenerator::FindFreeEntry(bool* array, size_t length) { } } LOG(FATAL) << "Could not find a register in baseline register allocator"; + UNREACHABLE(); + return -1; +} + +size_t CodeGenerator::FindTwoFreeConsecutiveEntries(bool* array, size_t length) { + for (size_t i = 0; i < length - 1; ++i) { + if (!array[i] && !array[i + 1]) { + array[i] = true; + array[i + 1] = true; + return i; + } + } + LOG(FATAL) << "Could not find a register in baseline register allocator"; + UNREACHABLE(); return -1; } @@ -180,6 +194,11 @@ void CodeGenerator::AllocateRegistersLocally(HInstruction* instruction) const { } else if (loc.IsFpuRegister()) { DCHECK(!blocked_fpu_registers_[loc.reg()]); blocked_fpu_registers_[loc.reg()] = true; + } else if (loc.IsFpuRegisterPair()) { + DCHECK(!blocked_fpu_registers_[loc.AsFpuRegisterPairLow<int>()]); + blocked_fpu_registers_[loc.AsFpuRegisterPairLow<int>()] = true; + DCHECK(!blocked_fpu_registers_[loc.AsFpuRegisterPairHigh<int>()]); + blocked_fpu_registers_[loc.AsFpuRegisterPairHigh<int>()] = true; } else if (loc.IsRegisterPair()) { DCHECK(!blocked_core_registers_[loc.AsRegisterPairLow<int>()]); blocked_core_registers_[loc.AsRegisterPairLow<int>()] = true; |