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

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.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/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction-codes.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 #include "src/compiler/node-properties-inl.h" 7 #include "src/compiler/node-properties-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 IA32OperandGenerator g(selector); 1003 IA32OperandGenerator g(selector);
1004 VisitCompare(selector, kIA32Cmp, g.Use(value), g.TempImmediate(0), cont); 1004 VisitCompare(selector, kIA32Cmp, g.Use(value), g.TempImmediate(0), cont);
1005 } 1005 }
1006 1006
1007 } // namespace 1007 } // namespace
1008 1008
1009 1009
1010 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, 1010 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
1011 BasicBlock* fbranch) { 1011 BasicBlock* fbranch) {
1012 FlagsContinuation cont(kNotEqual, tbranch, fbranch); 1012 FlagsContinuation cont(kNotEqual, tbranch, fbranch);
1013 if (IsNextInAssemblyOrder(tbranch)) { // We can fallthru to the true block.
1014 cont.Negate();
1015 cont.SwapBlocks();
1016 }
1017 VisitWordCompareZero(this, branch, branch->InputAt(0), &cont); 1013 VisitWordCompareZero(this, branch, branch->InputAt(0), &cont);
1018 } 1014 }
1019 1015
1020 1016
1021 void InstructionSelector::VisitWord32Equal(Node* const node) { 1017 void InstructionSelector::VisitWord32Equal(Node* const node) {
1022 FlagsContinuation cont(kEqual, node); 1018 FlagsContinuation cont(kEqual, node);
1023 Int32BinopMatcher m(node); 1019 Int32BinopMatcher m(node);
1024 if (m.right().Is(0)) { 1020 if (m.right().Is(0)) {
1025 return VisitWordCompareZero(this, m.node(), m.left().node(), &cont); 1021 return VisitWordCompareZero(this, m.node(), m.left().node(), &cont);
1026 } 1022 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 if (CpuFeatures::IsSupported(SSE4_1)) { 1092 if (CpuFeatures::IsSupported(SSE4_1)) {
1097 return MachineOperatorBuilder::kFloat64Floor | 1093 return MachineOperatorBuilder::kFloat64Floor |
1098 MachineOperatorBuilder::kFloat64Ceil | 1094 MachineOperatorBuilder::kFloat64Ceil |
1099 MachineOperatorBuilder::kFloat64RoundTruncate; 1095 MachineOperatorBuilder::kFloat64RoundTruncate;
1100 } 1096 }
1101 return MachineOperatorBuilder::Flag::kNoFlags; 1097 return MachineOperatorBuilder::Flag::kNoFlags;
1102 } 1098 }
1103 } // namespace compiler 1099 } // namespace compiler
1104 } // namespace internal 1100 } // namespace internal
1105 } // namespace v8 1101 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | src/compiler/instruction-codes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698