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 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 VisitFloat64Compare(this, node, &cont); | 1387 VisitFloat64Compare(this, node, &cont); |
1388 } | 1388 } |
1389 | 1389 |
1390 | 1390 |
1391 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { | 1391 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { |
1392 FlagsContinuation cont(kUnsignedLessThanOrEqual, node); | 1392 FlagsContinuation cont(kUnsignedLessThanOrEqual, node); |
1393 VisitFloat64Compare(this, node, &cont); | 1393 VisitFloat64Compare(this, node, &cont); |
1394 } | 1394 } |
1395 | 1395 |
1396 | 1396 |
| 1397 void InstructionSelector::VisitFloat64ExtractWord32(Node* node) { |
| 1398 ArmOperandGenerator g(this); |
| 1399 InstructionCode opcode = |
| 1400 (OpParameter<int>(node) == 0 ? kArmVmovLowU32F64 : kArmVmovHighU32F64); |
| 1401 Emit(opcode, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); |
| 1402 } |
| 1403 |
| 1404 |
| 1405 void InstructionSelector::VisitFloat64InsertWord32(Node* node) { |
| 1406 ArmOperandGenerator g(this); |
| 1407 Node* left = node->InputAt(0); |
| 1408 Node* right = node->InputAt(1); |
| 1409 if (left->opcode() == IrOpcode::kFloat64InsertWord32 && |
| 1410 OpParameter<int>(left) == 1 - OpParameter<int>(node) && |
| 1411 CanCover(node, left)) { |
| 1412 left = left->InputAt(1); |
| 1413 if (OpParameter<int>(node) == 0) std::swap(left, right); |
| 1414 Emit(kArmVmovF64U32U32, g.DefineAsRegister(node), g.UseRegister(left), |
| 1415 g.UseRegister(right)); |
| 1416 return; |
| 1417 } |
| 1418 InstructionCode opcode = |
| 1419 (OpParameter<int>(node) == 0) ? kArmVmovLowF64U32 : kArmVmovHighF64U32; |
| 1420 Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), |
| 1421 g.UseRegister(right)); |
| 1422 } |
| 1423 |
| 1424 |
1397 // static | 1425 // static |
1398 MachineOperatorBuilder::Flags | 1426 MachineOperatorBuilder::Flags |
1399 InstructionSelector::SupportedMachineOperatorFlags() { | 1427 InstructionSelector::SupportedMachineOperatorFlags() { |
1400 MachineOperatorBuilder::Flags flags = | 1428 MachineOperatorBuilder::Flags flags = |
1401 MachineOperatorBuilder::kInt32DivIsSafe | | 1429 MachineOperatorBuilder::kInt32DivIsSafe | |
1402 MachineOperatorBuilder::kUint32DivIsSafe; | 1430 MachineOperatorBuilder::kUint32DivIsSafe; |
1403 | 1431 |
1404 if (CpuFeatures::IsSupported(ARMv8)) { | 1432 if (CpuFeatures::IsSupported(ARMv8)) { |
1405 flags |= MachineOperatorBuilder::kFloat64Floor | | 1433 flags |= MachineOperatorBuilder::kFloat64Floor | |
1406 MachineOperatorBuilder::kFloat64Ceil | | 1434 MachineOperatorBuilder::kFloat64Ceil | |
1407 MachineOperatorBuilder::kFloat64RoundTruncate | | 1435 MachineOperatorBuilder::kFloat64RoundTruncate | |
1408 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1436 MachineOperatorBuilder::kFloat64RoundTiesAway; |
1409 } | 1437 } |
1410 return flags; | 1438 return flags; |
1411 } | 1439 } |
1412 | 1440 |
1413 } // namespace compiler | 1441 } // namespace compiler |
1414 } // namespace internal | 1442 } // namespace internal |
1415 } // namespace v8 | 1443 } // namespace v8 |
OLD | NEW |