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::VisitFloat64ExtractLowWord32(Node* node) { |
| 1398 ArmOperandGenerator g(this); |
| 1399 Emit(kArmVmovLowU32F64, g.DefineAsRegister(node), |
| 1400 g.UseRegister(node->InputAt(0))); |
| 1401 } |
| 1402 |
| 1403 |
| 1404 void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) { |
| 1405 ArmOperandGenerator g(this); |
| 1406 Emit(kArmVmovHighU32F64, g.DefineAsRegister(node), |
| 1407 g.UseRegister(node->InputAt(0))); |
| 1408 } |
| 1409 |
| 1410 |
| 1411 void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) { |
| 1412 ArmOperandGenerator g(this); |
| 1413 Node* left = node->InputAt(0); |
| 1414 Node* right = node->InputAt(1); |
| 1415 if (left->opcode() == IrOpcode::kFloat64InsertHighWord32 && |
| 1416 CanCover(node, left)) { |
| 1417 left = left->InputAt(1); |
| 1418 Emit(kArmVmovF64U32U32, g.DefineAsRegister(node), g.UseRegister(right), |
| 1419 g.UseRegister(left)); |
| 1420 return; |
| 1421 } |
| 1422 Emit(kArmVmovLowF64U32, g.DefineSameAsFirst(node), g.UseRegister(left), |
| 1423 g.UseRegister(right)); |
| 1424 } |
| 1425 |
| 1426 |
| 1427 void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) { |
| 1428 ArmOperandGenerator g(this); |
| 1429 Node* left = node->InputAt(0); |
| 1430 Node* right = node->InputAt(1); |
| 1431 if (left->opcode() == IrOpcode::kFloat64InsertLowWord32 && |
| 1432 CanCover(node, left)) { |
| 1433 left = left->InputAt(1); |
| 1434 Emit(kArmVmovF64U32U32, g.DefineAsRegister(node), g.UseRegister(left), |
| 1435 g.UseRegister(right)); |
| 1436 return; |
| 1437 } |
| 1438 Emit(kArmVmovHighF64U32, g.DefineSameAsFirst(node), g.UseRegister(left), |
| 1439 g.UseRegister(right)); |
| 1440 } |
| 1441 |
| 1442 |
1397 // static | 1443 // static |
1398 MachineOperatorBuilder::Flags | 1444 MachineOperatorBuilder::Flags |
1399 InstructionSelector::SupportedMachineOperatorFlags() { | 1445 InstructionSelector::SupportedMachineOperatorFlags() { |
1400 MachineOperatorBuilder::Flags flags = | 1446 MachineOperatorBuilder::Flags flags = |
1401 MachineOperatorBuilder::kInt32DivIsSafe | | 1447 MachineOperatorBuilder::kInt32DivIsSafe | |
1402 MachineOperatorBuilder::kUint32DivIsSafe; | 1448 MachineOperatorBuilder::kUint32DivIsSafe; |
1403 | 1449 |
1404 if (CpuFeatures::IsSupported(ARMv8)) { | 1450 if (CpuFeatures::IsSupported(ARMv8)) { |
1405 flags |= MachineOperatorBuilder::kFloat64Floor | | 1451 flags |= MachineOperatorBuilder::kFloat64Floor | |
1406 MachineOperatorBuilder::kFloat64Ceil | | 1452 MachineOperatorBuilder::kFloat64Ceil | |
1407 MachineOperatorBuilder::kFloat64RoundTruncate | | 1453 MachineOperatorBuilder::kFloat64RoundTruncate | |
1408 MachineOperatorBuilder::kFloat64RoundTiesAway; | 1454 MachineOperatorBuilder::kFloat64RoundTiesAway; |
1409 } | 1455 } |
1410 return flags; | 1456 return flags; |
1411 } | 1457 } |
1412 | 1458 |
1413 } // namespace compiler | 1459 } // namespace compiler |
1414 } // namespace internal | 1460 } // namespace internal |
1415 } // namespace v8 | 1461 } // namespace v8 |
OLD | NEW |