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 1750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 opcode = kAtomicLoadWord32; | 1761 opcode = kAtomicLoadWord32; |
1762 break; | 1762 break; |
1763 default: | 1763 default: |
1764 UNREACHABLE(); | 1764 UNREACHABLE(); |
1765 return; | 1765 return; |
1766 } | 1766 } |
1767 Emit(opcode | AddressingModeField::encode(kMode_MRR), | 1767 Emit(opcode | AddressingModeField::encode(kMode_MRR), |
1768 g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index)); | 1768 g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index)); |
1769 } | 1769 } |
1770 | 1770 |
| 1771 void InstructionSelector::VisitAtomicStore(Node* node) { |
| 1772 MachineRepresentation rep = AtomicStoreRepresentationOf(node->op()); |
| 1773 S390OperandGenerator g(this); |
| 1774 Node* base = node->InputAt(0); |
| 1775 Node* index = node->InputAt(1); |
| 1776 Node* value = node->InputAt(2); |
| 1777 ArchOpcode opcode = kArchNop; |
| 1778 switch (rep) { |
| 1779 case MachineRepresentation::kWord8: |
| 1780 opcode = kAtomicStoreWord8; |
| 1781 break; |
| 1782 case MachineRepresentation::kWord16: |
| 1783 opcode = kAtomicStoreWord16; |
| 1784 break; |
| 1785 case MachineRepresentation::kWord32: |
| 1786 opcode = kAtomicStoreWord32; |
| 1787 break; |
| 1788 default: |
| 1789 UNREACHABLE(); |
| 1790 return; |
| 1791 } |
| 1792 |
| 1793 InstructionOperand inputs[4]; |
| 1794 size_t input_count = 0; |
| 1795 inputs[input_count++] = g.UseUniqueRegister(value); |
| 1796 inputs[input_count++] = g.UseUniqueRegister(base); |
| 1797 inputs[input_count++] = g.UseUniqueRegister(index); |
| 1798 Emit(opcode | AddressingModeField::encode(kMode_MRR), 0, nullptr, input_count, |
| 1799 inputs); |
| 1800 } |
| 1801 |
1771 // static | 1802 // static |
1772 MachineOperatorBuilder::Flags | 1803 MachineOperatorBuilder::Flags |
1773 InstructionSelector::SupportedMachineOperatorFlags() { | 1804 InstructionSelector::SupportedMachineOperatorFlags() { |
1774 return MachineOperatorBuilder::kFloat32RoundDown | | 1805 return MachineOperatorBuilder::kFloat32RoundDown | |
1775 MachineOperatorBuilder::kFloat64RoundDown | | 1806 MachineOperatorBuilder::kFloat64RoundDown | |
1776 MachineOperatorBuilder::kFloat32RoundUp | | 1807 MachineOperatorBuilder::kFloat32RoundUp | |
1777 MachineOperatorBuilder::kFloat64RoundUp | | 1808 MachineOperatorBuilder::kFloat64RoundUp | |
1778 MachineOperatorBuilder::kFloat32RoundTruncate | | 1809 MachineOperatorBuilder::kFloat32RoundTruncate | |
1779 MachineOperatorBuilder::kFloat64RoundTruncate | | 1810 MachineOperatorBuilder::kFloat64RoundTruncate | |
1780 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1811 MachineOperatorBuilder::kFloat64RoundTiesAway | |
1781 MachineOperatorBuilder::kWord32Popcnt | | 1812 MachineOperatorBuilder::kWord32Popcnt | |
1782 MachineOperatorBuilder::kWord64Popcnt; | 1813 MachineOperatorBuilder::kWord64Popcnt; |
1783 } | 1814 } |
1784 | 1815 |
1785 } // namespace compiler | 1816 } // namespace compiler |
1786 } // namespace internal | 1817 } // namespace internal |
1787 } // namespace v8 | 1818 } // namespace v8 |
OLD | NEW |