OLD | NEW |
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 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1213 static void VisitWord64Test(InstructionSelector* selector, Node* node, | 1213 static void VisitWord64Test(InstructionSelector* selector, Node* node, |
1214 FlagsContinuation* cont) { | 1214 FlagsContinuation* cont) { |
1215 VisitWordTest(selector, node, kArm64Tst, cont); | 1215 VisitWordTest(selector, node, kArm64Tst, cont); |
1216 } | 1216 } |
1217 | 1217 |
1218 | 1218 |
1219 // Shared routine for multiple float compare operations. | 1219 // Shared routine for multiple float compare operations. |
1220 static void VisitFloat64Compare(InstructionSelector* selector, Node* node, | 1220 static void VisitFloat64Compare(InstructionSelector* selector, Node* node, |
1221 FlagsContinuation* cont) { | 1221 FlagsContinuation* cont) { |
1222 Arm64OperandGenerator g(selector); | 1222 Arm64OperandGenerator g(selector); |
1223 Node* left = node->InputAt(0); | 1223 Float64BinopMatcher m(node); |
1224 Node* right = node->InputAt(1); | 1224 if (m.right().Is(0.0)) { |
1225 VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(left), | 1225 VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(m.left().node()), |
1226 g.UseRegister(right), cont); | 1226 g.UseImmediate(m.right().node()), cont); |
| 1227 } else { |
| 1228 VisitCompare(selector, kArm64Float64Cmp, g.UseRegister(m.left().node()), |
| 1229 g.UseRegister(m.right().node()), cont); |
| 1230 } |
1227 } | 1231 } |
1228 | 1232 |
1229 | 1233 |
1230 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, | 1234 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
1231 BasicBlock* fbranch) { | 1235 BasicBlock* fbranch) { |
1232 OperandGenerator g(this); | 1236 OperandGenerator g(this); |
1233 Node* user = branch; | 1237 Node* user = branch; |
1234 Node* value = branch->InputAt(0); | 1238 Node* value = branch->InputAt(0); |
1235 | 1239 |
1236 FlagsContinuation cont(kNotEqual, tbranch, fbranch); | 1240 FlagsContinuation cont(kNotEqual, tbranch, fbranch); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 MachineOperatorBuilder::kFloat64RoundTruncate | | 1526 MachineOperatorBuilder::kFloat64RoundTruncate | |
1523 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1527 MachineOperatorBuilder::kFloat64RoundTiesAway | |
1524 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1528 MachineOperatorBuilder::kWord32ShiftIsSafe | |
1525 MachineOperatorBuilder::kInt32DivIsSafe | | 1529 MachineOperatorBuilder::kInt32DivIsSafe | |
1526 MachineOperatorBuilder::kUint32DivIsSafe; | 1530 MachineOperatorBuilder::kUint32DivIsSafe; |
1527 } | 1531 } |
1528 | 1532 |
1529 } // namespace compiler | 1533 } // namespace compiler |
1530 } // namespace internal | 1534 } // namespace internal |
1531 } // namespace v8 | 1535 } // namespace v8 |
OLD | NEW |