OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/adapters.h" | 5 #include "src/base/adapters.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 #include "src/s390/frames-s390.h" | 9 #include "src/s390/frames-s390.h" |
10 | 10 |
(...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 | 2510 |
2511 InstructionOperand inputs[4]; | 2511 InstructionOperand inputs[4]; |
2512 size_t input_count = 0; | 2512 size_t input_count = 0; |
2513 inputs[input_count++] = g.UseUniqueRegister(value); | 2513 inputs[input_count++] = g.UseUniqueRegister(value); |
2514 inputs[input_count++] = g.UseUniqueRegister(base); | 2514 inputs[input_count++] = g.UseUniqueRegister(base); |
2515 inputs[input_count++] = g.UseUniqueRegister(index); | 2515 inputs[input_count++] = g.UseUniqueRegister(index); |
2516 Emit(opcode | AddressingModeField::encode(kMode_MRR), 0, nullptr, input_count, | 2516 Emit(opcode | AddressingModeField::encode(kMode_MRR), 0, nullptr, input_count, |
2517 inputs); | 2517 inputs); |
2518 } | 2518 } |
2519 | 2519 |
2520 void InstructionSelector::VisitAtomicExchange(Node* node) { UNIMPLEMENTED(); } | 2520 void InstructionSelector::VisitAtomicExchange(Node* node) { |
| 2521 S390OperandGenerator g(this); |
| 2522 Node* base = node->InputAt(0); |
| 2523 Node* index = node->InputAt(1); |
| 2524 Node* value = node->InputAt(2); |
| 2525 ArchOpcode opcode = kArchNop; |
| 2526 MachineType type = AtomicExchangeRepresentationOf(node->op()); |
| 2527 if (type == MachineType::Int8()) { |
| 2528 opcode = kAtomicExchangeInt8; |
| 2529 } else if (type == MachineType::Uint8()) { |
| 2530 opcode = kAtomicExchangeUint8; |
| 2531 } else if (type == MachineType::Int16()) { |
| 2532 opcode = kAtomicExchangeInt16; |
| 2533 } else if (type == MachineType::Uint16()) { |
| 2534 opcode = kAtomicExchangeUint16; |
| 2535 } else if (type == MachineType::Int32() || type == MachineType::Uint32()) { |
| 2536 opcode = kAtomicExchangeWord32; |
| 2537 } else { |
| 2538 UNREACHABLE(); |
| 2539 return; |
| 2540 } |
| 2541 |
| 2542 AddressingMode addressing_mode = kMode_MRR; |
| 2543 InstructionOperand inputs[3]; |
| 2544 size_t input_count = 0; |
| 2545 inputs[input_count++] = g.UseUniqueRegister(base); |
| 2546 inputs[input_count++] = g.UseUniqueRegister(index); |
| 2547 inputs[input_count++] = g.UseUniqueRegister(value); |
| 2548 InstructionOperand outputs[1]; |
| 2549 outputs[0] = g.UseUniqueRegister(node); |
| 2550 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
| 2551 Emit(code, 1, outputs, input_count, inputs); |
| 2552 } |
2521 | 2553 |
2522 // static | 2554 // static |
2523 MachineOperatorBuilder::Flags | 2555 MachineOperatorBuilder::Flags |
2524 InstructionSelector::SupportedMachineOperatorFlags() { | 2556 InstructionSelector::SupportedMachineOperatorFlags() { |
2525 return MachineOperatorBuilder::kFloat32RoundDown | | 2557 return MachineOperatorBuilder::kFloat32RoundDown | |
2526 MachineOperatorBuilder::kFloat64RoundDown | | 2558 MachineOperatorBuilder::kFloat64RoundDown | |
2527 MachineOperatorBuilder::kFloat32RoundUp | | 2559 MachineOperatorBuilder::kFloat32RoundUp | |
2528 MachineOperatorBuilder::kFloat64RoundUp | | 2560 MachineOperatorBuilder::kFloat64RoundUp | |
2529 MachineOperatorBuilder::kFloat32RoundTruncate | | 2561 MachineOperatorBuilder::kFloat32RoundTruncate | |
2530 MachineOperatorBuilder::kFloat64RoundTruncate | | 2562 MachineOperatorBuilder::kFloat64RoundTruncate | |
2531 MachineOperatorBuilder::kFloat64RoundTiesAway | | 2563 MachineOperatorBuilder::kFloat64RoundTiesAway | |
2532 MachineOperatorBuilder::kWord32Popcnt | | 2564 MachineOperatorBuilder::kWord32Popcnt | |
2533 MachineOperatorBuilder::kWord32ReverseBytes | | 2565 MachineOperatorBuilder::kWord32ReverseBytes | |
2534 MachineOperatorBuilder::kWord64ReverseBytes | | 2566 MachineOperatorBuilder::kWord64ReverseBytes | |
2535 MachineOperatorBuilder::kWord64Popcnt; | 2567 MachineOperatorBuilder::kWord64Popcnt; |
2536 } | 2568 } |
2537 | 2569 |
2538 // static | 2570 // static |
2539 MachineOperatorBuilder::AlignmentRequirements | 2571 MachineOperatorBuilder::AlignmentRequirements |
2540 InstructionSelector::AlignmentRequirements() { | 2572 InstructionSelector::AlignmentRequirements() { |
2541 return MachineOperatorBuilder::AlignmentRequirements:: | 2573 return MachineOperatorBuilder::AlignmentRequirements:: |
2542 FullUnalignedAccessSupport(); | 2574 FullUnalignedAccessSupport(); |
2543 } | 2575 } |
2544 | 2576 |
2545 } // namespace compiler | 2577 } // namespace compiler |
2546 } // namespace internal | 2578 } // namespace internal |
2547 } // namespace v8 | 2579 } // namespace v8 |
OLD | NEW |