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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 VisitFloat64Compare(this, node, &cont); | 1364 VisitFloat64Compare(this, node, &cont); |
1365 } | 1365 } |
1366 | 1366 |
1367 | 1367 |
1368 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { | 1368 void InstructionSelector::VisitFloat64LessThanOrEqual(Node* node) { |
1369 FlagsContinuation cont(kUnsignedGreaterThanOrEqual, node); | 1369 FlagsContinuation cont(kUnsignedGreaterThanOrEqual, node); |
1370 VisitFloat64Compare(this, node, &cont); | 1370 VisitFloat64Compare(this, node, &cont); |
1371 } | 1371 } |
1372 | 1372 |
1373 | 1373 |
| 1374 void InstructionSelector::VisitFloat64ExtractLowWord32(Node* node) { |
| 1375 X64OperandGenerator g(this); |
| 1376 Emit(kSSEFloat64ExtractLowWord32, g.DefineAsRegister(node), |
| 1377 g.Use(node->InputAt(0))); |
| 1378 } |
| 1379 |
| 1380 |
| 1381 void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) { |
| 1382 X64OperandGenerator g(this); |
| 1383 Emit(kSSEFloat64ExtractHighWord32, g.DefineAsRegister(node), |
| 1384 g.Use(node->InputAt(0))); |
| 1385 } |
| 1386 |
| 1387 |
| 1388 void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) { |
| 1389 X64OperandGenerator g(this); |
| 1390 Node* left = node->InputAt(0); |
| 1391 Node* right = node->InputAt(1); |
| 1392 Float64Matcher mleft(left); |
| 1393 if (mleft.HasValue() && (bit_cast<uint64_t>(mleft.Value()) >> 32) == 0u) { |
| 1394 Emit(kSSEFloat64LoadLowWord32, g.DefineAsRegister(node), g.Use(right)); |
| 1395 return; |
| 1396 } |
| 1397 Emit(kSSEFloat64InsertLowWord32, g.DefineSameAsFirst(node), |
| 1398 g.UseRegister(left), g.Use(right)); |
| 1399 } |
| 1400 |
| 1401 |
| 1402 void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) { |
| 1403 X64OperandGenerator g(this); |
| 1404 Node* left = node->InputAt(0); |
| 1405 Node* right = node->InputAt(1); |
| 1406 Emit(kSSEFloat64InsertHighWord32, g.DefineSameAsFirst(node), |
| 1407 g.UseRegister(left), g.Use(right)); |
| 1408 } |
| 1409 |
| 1410 |
1374 // static | 1411 // static |
1375 MachineOperatorBuilder::Flags | 1412 MachineOperatorBuilder::Flags |
1376 InstructionSelector::SupportedMachineOperatorFlags() { | 1413 InstructionSelector::SupportedMachineOperatorFlags() { |
1377 MachineOperatorBuilder::Flags flags = | 1414 MachineOperatorBuilder::Flags flags = |
1378 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1415 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1379 if (CpuFeatures::IsSupported(SSE4_1)) { | 1416 if (CpuFeatures::IsSupported(SSE4_1)) { |
1380 flags |= MachineOperatorBuilder::kFloat64Floor | | 1417 flags |= MachineOperatorBuilder::kFloat64Floor | |
1381 MachineOperatorBuilder::kFloat64Ceil | | 1418 MachineOperatorBuilder::kFloat64Ceil | |
1382 MachineOperatorBuilder::kFloat64RoundTruncate; | 1419 MachineOperatorBuilder::kFloat64RoundTruncate; |
1383 } | 1420 } |
1384 return flags; | 1421 return flags; |
1385 } | 1422 } |
1386 | 1423 |
1387 } // namespace compiler | 1424 } // namespace compiler |
1388 } // namespace internal | 1425 } // namespace internal |
1389 } // namespace v8 | 1426 } // namespace v8 |
OLD | NEW |