| 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/base/bits.h" | 5 #include "src/base/bits.h" |
| 6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 } | 1066 } |
| 1067 | 1067 |
| 1068 | 1068 |
| 1069 namespace { | 1069 namespace { |
| 1070 | 1070 |
| 1071 // Shared routine for multiple float compare operations. | 1071 // Shared routine for multiple float compare operations. |
| 1072 void VisitFloat64Compare(InstructionSelector* selector, Node* node, | 1072 void VisitFloat64Compare(InstructionSelector* selector, Node* node, |
| 1073 FlagsContinuation* cont) { | 1073 FlagsContinuation* cont) { |
| 1074 ArmOperandGenerator g(selector); | 1074 ArmOperandGenerator g(selector); |
| 1075 Float64BinopMatcher m(node); | 1075 Float64BinopMatcher m(node); |
| 1076 InstructionOperand* rhs = m.right().Is(0.0) ? g.UseImmediate(m.right().node()) |
| 1077 : g.UseRegister(m.right().node()); |
| 1076 if (cont->IsBranch()) { | 1078 if (cont->IsBranch()) { |
| 1077 selector->Emit(cont->Encode(kArmVcmpF64), nullptr, | 1079 selector->Emit(cont->Encode(kArmVcmpF64), nullptr, |
| 1078 g.UseRegister(m.left().node()), | 1080 g.UseRegister(m.left().node()), rhs, |
| 1079 g.UseRegister(m.right().node()), g.Label(cont->true_block()), | 1081 g.Label(cont->true_block()), |
| 1080 g.Label(cont->false_block()))->MarkAsControl(); | 1082 g.Label(cont->false_block()))->MarkAsControl(); |
| 1081 } else { | 1083 } else { |
| 1082 DCHECK(cont->IsSet()); | 1084 DCHECK(cont->IsSet()); |
| 1083 selector->Emit( | 1085 selector->Emit(cont->Encode(kArmVcmpF64), |
| 1084 cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), | 1086 g.DefineAsRegister(cont->result()), |
| 1085 g.UseRegister(m.left().node()), g.UseRegister(m.right().node())); | 1087 g.UseRegister(m.left().node()), rhs); |
| 1086 } | 1088 } |
| 1087 } | 1089 } |
| 1088 | 1090 |
| 1089 | 1091 |
| 1090 // Shared routine for multiple word compare operations. | 1092 // Shared routine for multiple word compare operations. |
| 1091 void VisitWordCompare(InstructionSelector* selector, Node* node, | 1093 void VisitWordCompare(InstructionSelector* selector, Node* node, |
| 1092 InstructionCode opcode, FlagsContinuation* cont) { | 1094 InstructionCode opcode, FlagsContinuation* cont) { |
| 1093 ArmOperandGenerator g(selector); | 1095 ArmOperandGenerator g(selector); |
| 1094 Int32BinopMatcher m(node); | 1096 Int32BinopMatcher m(node); |
| 1095 InstructionOperand* inputs[5]; | 1097 InstructionOperand* inputs[5]; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 MachineOperatorBuilder::kFloat64Ceil | | 1335 MachineOperatorBuilder::kFloat64Ceil | |
| 1334 MachineOperatorBuilder::kFloat64RoundTruncate | | 1336 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1335 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1337 MachineOperatorBuilder::kFloat64RoundTiesAway; |
| 1336 } | 1338 } |
| 1337 return flags; | 1339 return flags; |
| 1338 } | 1340 } |
| 1339 | 1341 |
| 1340 } // namespace compiler | 1342 } // namespace compiler |
| 1341 } // namespace internal | 1343 } // namespace internal |
| 1342 } // namespace v8 | 1344 } // namespace v8 |
| OLD | NEW |