summaryrefslogtreecommitdiff
path: root/compiler/optimizing/common_arm64.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-03-12 11:06:25 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-03-12 11:06:26 +0000
commitbf5565a75876a84c8c2401df597d922a7870a8f2 (patch)
tree3cb359f31e1f3080fb7cfffd5a6fd417f61753d7 /compiler/optimizing/common_arm64.h
parent28b87a628403c0dc10006c84b6fa009b082c5d84 (diff)
parent3ce57abd8fe50a0a772d14e033a9e7c34beff6cb (diff)
Merge "Revert "Opt Compiler: Materialise constants that cannot be encoded""
Diffstat (limited to 'compiler/optimizing/common_arm64.h')
-rw-r--r--compiler/optimizing/common_arm64.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/compiler/optimizing/common_arm64.h b/compiler/optimizing/common_arm64.h
index 056deb98d6..9447d3b816 100644
--- a/compiler/optimizing/common_arm64.h
+++ b/compiler/optimizing/common_arm64.h
@@ -183,41 +183,6 @@ static inline vixl::Operand OperandFromMemOperand(const vixl::MemOperand& mem_op
}
}
-static bool CanEncodeConstantAsImmediate(HConstant* constant, HInstruction* instr) {
- DCHECK(constant->IsIntConstant() || constant->IsLongConstant());
-
- // For single uses we let VIXL handle the constant generation since it will
- // use registers that are not managed by the register allocator (wip0, wip1).
- if (constant->GetUses().HasOnlyOneUse()) {
- return true;
- }
-
- int64_t value = constant->IsIntConstant() ? constant->AsIntConstant()->GetValue()
- : constant->AsLongConstant()->GetValue();
-
- if (instr->IsAdd() || instr->IsSub() || instr->IsCondition() || instr->IsCompare()) {
- // Uses aliases of ADD/SUB instructions.
- return vixl::Assembler::IsImmAddSub(value);
- } else if (instr->IsAnd() || instr->IsOr() || instr->IsXor()) {
- // Uses logical operations.
- return vixl::Assembler::IsImmLogical(value, vixl::kXRegSize);
- } else {
- DCHECK(instr->IsNeg());
- // Uses mov -immediate.
- return vixl::Assembler::IsImmMovn(value, vixl::kXRegSize);
- }
-}
-
-static inline Location ARM64EncodableConstantOrRegister(HInstruction* constant,
- HInstruction* instr) {
- if (constant->IsConstant()
- && CanEncodeConstantAsImmediate(constant->AsConstant(), instr)) {
- return Location::ConstantLocation(constant->AsConstant());
- }
-
- return Location::RequiresRegister();
-}
-
} // namespace helpers
} // namespace arm64
} // namespace art