Index: src/compiler/arm64/instruction-selector-arm64.cc |
diff --git a/src/compiler/arm64/instruction-selector-arm64.cc b/src/compiler/arm64/instruction-selector-arm64.cc |
index 7379ec08556765328cb5e5e0c890bb083acbbafa..0922dace978c060e7a43e44b2b798bcb7158ca54 100644 |
--- a/src/compiler/arm64/instruction-selector-arm64.cc |
+++ b/src/compiler/arm64/instruction-selector-arm64.cc |
@@ -1347,9 +1347,8 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
// If the mask has only one bit set, we can use tbz/tbnz. |
DCHECK((cont.condition() == kEqual) || |
(cont.condition() == kNotEqual)); |
- ArchOpcode opcode = |
- (cont.condition() == kEqual) ? kArm64Tbz32 : kArm64Tbnz32; |
- Emit(opcode, NULL, g.UseRegister(m.left().node()), |
+ Emit(cont.Encode(kArm64TestAndBranch32), NULL, |
+ g.UseRegister(m.left().node()), |
g.TempImmediate( |
base::bits::CountTrailingZeros32(m.right().Value())), |
g.Label(cont.true_block()), |
@@ -1366,9 +1365,8 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
// If the mask has only one bit set, we can use tbz/tbnz. |
DCHECK((cont.condition() == kEqual) || |
(cont.condition() == kNotEqual)); |
- ArchOpcode opcode = |
- (cont.condition() == kEqual) ? kArm64Tbz : kArm64Tbnz; |
- Emit(opcode, NULL, g.UseRegister(m.left().node()), |
+ Emit(cont.Encode(kArm64TestAndBranch), NULL, |
+ g.UseRegister(m.left().node()), |
g.TempImmediate( |
base::bits::CountTrailingZeros64(m.right().Value())), |
g.Label(cont.true_block()), |
@@ -1384,9 +1382,8 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
} |
// Branch could not be combined with a compare, compare against 0 and branch. |
- DCHECK((cont.condition() == kEqual) || (cont.condition() == kNotEqual)); |
- ArchOpcode opcode = (cont.condition() == kEqual) ? kArm64Cbz32 : kArm64Cbnz32; |
- Emit(opcode, NULL, g.UseRegister(value), g.Label(cont.true_block()), |
+ Emit(cont.Encode(kArm64CompareAndBranch32), NULL, g.UseRegister(value), |
+ g.Label(cont.true_block()), |
g.Label(cont.false_block()))->MarkAsControl(); |
} |