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

Side by Side Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 745633002: [turbofan] Clean up and factor out branch generation logic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix IA32 fall through. Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/code-generator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 1113
1114 1114
1115 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, 1115 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
1116 BasicBlock* fbranch) { 1116 BasicBlock* fbranch) {
1117 OperandGenerator g(this); 1117 OperandGenerator g(this);
1118 Node* user = branch; 1118 Node* user = branch;
1119 Node* value = branch->InputAt(0); 1119 Node* value = branch->InputAt(0);
1120 1120
1121 FlagsContinuation cont(kNotEqual, tbranch, fbranch); 1121 FlagsContinuation cont(kNotEqual, tbranch, fbranch);
1122 1122
1123 // If we can fall through to the true block, invert the branch.
1124 if (IsNextInAssemblyOrder(tbranch)) {
1125 cont.Negate();
1126 cont.SwapBlocks();
1127 }
1128
1129 // Try to combine with comparisons against 0 by simply inverting the branch. 1123 // Try to combine with comparisons against 0 by simply inverting the branch.
1130 while (CanCover(user, value)) { 1124 while (CanCover(user, value)) {
1131 if (value->opcode() == IrOpcode::kWord32Equal) { 1125 if (value->opcode() == IrOpcode::kWord32Equal) {
1132 Int32BinopMatcher m(value); 1126 Int32BinopMatcher m(value);
1133 if (m.right().Is(0)) { 1127 if (m.right().Is(0)) {
1134 user = value; 1128 user = value;
1135 value = m.left().node(); 1129 value = m.left().node();
1136 cont.Negate(); 1130 cont.Negate();
1137 } else { 1131 } else {
1138 break; 1132 break;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 MachineOperatorBuilder::Flags 1406 MachineOperatorBuilder::Flags
1413 InstructionSelector::SupportedMachineOperatorFlags() { 1407 InstructionSelector::SupportedMachineOperatorFlags() {
1414 return MachineOperatorBuilder::kFloat64Floor | 1408 return MachineOperatorBuilder::kFloat64Floor |
1415 MachineOperatorBuilder::kFloat64Ceil | 1409 MachineOperatorBuilder::kFloat64Ceil |
1416 MachineOperatorBuilder::kFloat64RoundTruncate | 1410 MachineOperatorBuilder::kFloat64RoundTruncate |
1417 MachineOperatorBuilder::kFloat64RoundTiesAway; 1411 MachineOperatorBuilder::kFloat64RoundTiesAway;
1418 } 1412 }
1419 } // namespace compiler 1413 } // namespace compiler
1420 } // namespace internal 1414 } // namespace internal
1421 } // namespace v8 1415 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/code-generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698