From 2bcb43111edf7bf99fe409ff3e9c76a285e54c25 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 1 Jul 2015 12:22:56 +0100 Subject: Use CompareAndBranchIf(Non)Zero when applicable. Now that we relocate branches, we can try make more use of cbz/cbnz. Change-Id: I93ca64107f34eb3c43f2e7102ea90453113dad7a --- compiler/utils/arm/assembler_thumb2.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/utils/arm/assembler_thumb2.cc') 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)); -- cgit v1.2.3-59-g8ed1b