Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 798553002: [turbofan] Mark arm64 cbz/cbnz tbz/tbnz instructions as branch instructions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
}
« no previous file with comments | « src/compiler/arm64/instruction-codes-arm64.h ('k') | test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698