diff options
author | 2015-07-01 12:22:56 +0100 | |
---|---|---|
committer | 2015-07-01 12:46:09 +0100 | |
commit | 2bcb43111edf7bf99fe409ff3e9c76a285e54c25 (patch) | |
tree | 3ee8cbf5ef612756f2d433f3c14bd475323dec8d /compiler/utils/arm/assembler_thumb2.cc | |
parent | 806af26f1a8f107cb4f4430ceec8dc9f360f3795 (diff) |
Use CompareAndBranchIf(Non)Zero when applicable.
Now that we relocate branches, we can try make more use of cbz/cbnz.
Change-Id: I93ca64107f34eb3c43f2e7102ea90453113dad7a
Diffstat (limited to 'compiler/utils/arm/assembler_thumb2.cc')
-rw-r--r-- | compiler/utils/arm/assembler_thumb2.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/utils/arm/assembler_thumb2.cc b/compiler/utils/arm/assembler_thumb2.cc index f9e1ac672e..2dde0149a6 100644 --- a/compiler/utils/arm/assembler_thumb2.cc +++ b/compiler/utils/arm/assembler_thumb2.cc @@ -3341,7 +3341,7 @@ void Thumb2Assembler::dmb(DmbOptions flavor) { void Thumb2Assembler::CompareAndBranchIfZero(Register r, Label* label) { - if (CanRelocateBranches() && IsLowRegister(r)) { + if (CanRelocateBranches() && IsLowRegister(r) && !label->IsBound()) { cbz(r, label); } else { cmp(r, ShifterOperand(0)); @@ -3351,7 +3351,7 @@ void Thumb2Assembler::CompareAndBranchIfZero(Register r, Label* label) { void Thumb2Assembler::CompareAndBranchIfNonZero(Register r, Label* label) { - if (CanRelocateBranches() && IsLowRegister(r)) { + if (CanRelocateBranches() && IsLowRegister(r) && !label->IsBound()) { cbnz(r, label); } else { cmp(r, ShifterOperand(0)); |