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::VisitFloat64ExtractWord32(Node* node) { |
| 1375 X64OperandGenerator g(this); |
| 1376 InstructionCode opcode = (OpParameter<int>(node) == 0) |
| 1377 ? kSSEFloat64ExtractLowWord32 |
| 1378 : kSSEFloat64ExtractHighWord32; |
| 1379 Emit(opcode, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 1380 } |
| 1381 |
| 1382 |
| 1383 void InstructionSelector::VisitFloat64InsertWord32(Node* node) { |
| 1384 X64OperandGenerator g(this); |
| 1385 Node* left = node->InputAt(0); |
| 1386 Node* right = node->InputAt(1); |
| 1387 InstructionCode opcode; |
| 1388 switch (OpParameter<int>(node)) { |
| 1389 case 0: { |
| 1390 Float64Matcher mleft(left); |
| 1391 if (mleft.HasValue() && (bit_cast<uint64_t>(mleft.Value()) >> 32) == 0u) { |
| 1392 Emit(kSSEFloat64LoadLowWord32, g.DefineAsRegister(node), g.Use(right)); |
| 1393 return; |
| 1394 } |
| 1395 opcode = kSSEFloat64InsertLowWord32; |
| 1396 break; |
| 1397 } |
| 1398 case 1: |
| 1399 opcode = kSSEFloat64InsertHighWord32; |
| 1400 break; |
| 1401 default: |
| 1402 UNREACHABLE(); |
| 1403 return; |
| 1404 } |
| 1405 Emit(opcode, g.DefineSameAsFirst(node), g.UseRegister(left), g.Use(right)); |
| 1406 } |
| 1407 |
| 1408 |
1374 // static | 1409 // static |
1375 MachineOperatorBuilder::Flags | 1410 MachineOperatorBuilder::Flags |
1376 InstructionSelector::SupportedMachineOperatorFlags() { | 1411 InstructionSelector::SupportedMachineOperatorFlags() { |
1377 MachineOperatorBuilder::Flags flags = | 1412 MachineOperatorBuilder::Flags flags = |
1378 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1413 MachineOperatorBuilder::kWord32ShiftIsSafe; |
1379 if (CpuFeatures::IsSupported(SSE4_1)) { | 1414 if (CpuFeatures::IsSupported(SSE4_1)) { |
1380 flags |= MachineOperatorBuilder::kFloat64Floor | | 1415 flags |= MachineOperatorBuilder::kFloat64Floor | |
1381 MachineOperatorBuilder::kFloat64Ceil | | 1416 MachineOperatorBuilder::kFloat64Ceil | |
1382 MachineOperatorBuilder::kFloat64RoundTruncate; | 1417 MachineOperatorBuilder::kFloat64RoundTruncate; |
1383 } | 1418 } |
1384 return flags; | 1419 return flags; |
1385 } | 1420 } |
1386 | 1421 |
1387 } // namespace compiler | 1422 } // namespace compiler |
1388 } // namespace internal | 1423 } // namespace internal |
1389 } // namespace v8 | 1424 } // namespace v8 |
OLD | NEW |