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/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/ppc/frames-ppc.h" | 9 #include "src/ppc/frames-ppc.h" |
10 | 10 |
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1914 CanCover(node, left)) { | 1914 CanCover(node, left)) { |
1915 left = left->InputAt(1); | 1915 left = left->InputAt(1); |
1916 Emit(kPPC_DoubleConstruct, g.DefineAsRegister(node), g.UseRegister(right), | 1916 Emit(kPPC_DoubleConstruct, g.DefineAsRegister(node), g.UseRegister(right), |
1917 g.UseRegister(left)); | 1917 g.UseRegister(left)); |
1918 return; | 1918 return; |
1919 } | 1919 } |
1920 Emit(kPPC_DoubleInsertHighWord32, g.DefineSameAsFirst(node), | 1920 Emit(kPPC_DoubleInsertHighWord32, g.DefineSameAsFirst(node), |
1921 g.UseRegister(left), g.UseRegister(right)); | 1921 g.UseRegister(left), g.UseRegister(right)); |
1922 } | 1922 } |
1923 | 1923 |
| 1924 void InstructionSelector::VisitAtomicLoad(Node* node) { |
| 1925 LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
| 1926 PPCOperandGenerator g(this); |
| 1927 Node* base = node->InputAt(0); |
| 1928 Node* index = node->InputAt(1); |
| 1929 ArchOpcode opcode = kArchNop; |
| 1930 switch (load_rep.representation()) { |
| 1931 case MachineRepresentation::kWord8: |
| 1932 opcode = load_rep.IsSigned() ? kAtomicLoadInt8 : kAtomicLoadUint8; |
| 1933 break; |
| 1934 case MachineRepresentation::kWord16: |
| 1935 opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16; |
| 1936 break; |
| 1937 case MachineRepresentation::kWord32: |
| 1938 opcode = kAtomicLoadWord32; |
| 1939 break; |
| 1940 default: |
| 1941 UNREACHABLE(); |
| 1942 return; |
| 1943 } |
| 1944 Emit(opcode | AddressingModeField::encode(kMode_MRR), |
| 1945 g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index)); |
| 1946 } |
1924 | 1947 |
1925 // static | 1948 // static |
1926 MachineOperatorBuilder::Flags | 1949 MachineOperatorBuilder::Flags |
1927 InstructionSelector::SupportedMachineOperatorFlags() { | 1950 InstructionSelector::SupportedMachineOperatorFlags() { |
1928 return MachineOperatorBuilder::kFloat32RoundDown | | 1951 return MachineOperatorBuilder::kFloat32RoundDown | |
1929 MachineOperatorBuilder::kFloat64RoundDown | | 1952 MachineOperatorBuilder::kFloat64RoundDown | |
1930 MachineOperatorBuilder::kFloat32RoundUp | | 1953 MachineOperatorBuilder::kFloat32RoundUp | |
1931 MachineOperatorBuilder::kFloat64RoundUp | | 1954 MachineOperatorBuilder::kFloat64RoundUp | |
1932 MachineOperatorBuilder::kFloat32RoundTruncate | | 1955 MachineOperatorBuilder::kFloat32RoundTruncate | |
1933 MachineOperatorBuilder::kFloat64RoundTruncate | | 1956 MachineOperatorBuilder::kFloat64RoundTruncate | |
1934 MachineOperatorBuilder::kFloat64RoundTiesAway | | 1957 MachineOperatorBuilder::kFloat64RoundTiesAway | |
1935 MachineOperatorBuilder::kWord32Popcnt | | 1958 MachineOperatorBuilder::kWord32Popcnt | |
1936 MachineOperatorBuilder::kWord64Popcnt; | 1959 MachineOperatorBuilder::kWord64Popcnt; |
1937 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. | 1960 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. |
1938 } | 1961 } |
1939 | 1962 |
1940 } // namespace compiler | 1963 } // namespace compiler |
1941 } // namespace internal | 1964 } // namespace internal |
1942 } // namespace v8 | 1965 } // namespace v8 |
OLD | NEW |