Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: src/compiler/ppc/instruction-selector-ppc.cc

Issue 1951643002: PPC: [Atomics] Make Atomics.store a builtin using TF (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/ppc/code-generator-ppc.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 opcode = kAtomicLoadWord32; 1931 opcode = kAtomicLoadWord32;
1932 break; 1932 break;
1933 default: 1933 default:
1934 UNREACHABLE(); 1934 UNREACHABLE();
1935 return; 1935 return;
1936 } 1936 }
1937 Emit(opcode | AddressingModeField::encode(kMode_MRR), 1937 Emit(opcode | AddressingModeField::encode(kMode_MRR),
1938 g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index)); 1938 g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index));
1939 } 1939 }
1940 1940
1941 void InstructionSelector::VisitAtomicStore(Node* node) {
1942 MachineRepresentation rep = AtomicStoreRepresentationOf(node->op());
1943 PPCOperandGenerator g(this);
1944 Node* base = node->InputAt(0);
1945 Node* index = node->InputAt(1);
1946 Node* value = node->InputAt(2);
1947 ArchOpcode opcode = kArchNop;
1948 switch (rep) {
1949 case MachineRepresentation::kWord8:
1950 opcode = kAtomicStoreWord8;
1951 break;
1952 case MachineRepresentation::kWord16:
1953 opcode = kAtomicStoreWord16;
1954 break;
1955 case MachineRepresentation::kWord32:
1956 opcode = kAtomicStoreWord32;
1957 break;
1958 default:
1959 UNREACHABLE();
1960 return;
1961 }
1962
1963 InstructionOperand inputs[4];
1964 size_t input_count = 0;
1965 inputs[input_count++] = g.UseUniqueRegister(base);
1966 inputs[input_count++] = g.UseUniqueRegister(index);
1967 inputs[input_count++] = g.UseUniqueRegister(value);
1968 Emit(opcode | AddressingModeField::encode(kMode_MRR),
1969 0, nullptr, input_count, inputs);
1970 }
1971
1941 // static 1972 // static
1942 MachineOperatorBuilder::Flags 1973 MachineOperatorBuilder::Flags
1943 InstructionSelector::SupportedMachineOperatorFlags() { 1974 InstructionSelector::SupportedMachineOperatorFlags() {
1944 return MachineOperatorBuilder::kFloat32RoundDown | 1975 return MachineOperatorBuilder::kFloat32RoundDown |
1945 MachineOperatorBuilder::kFloat64RoundDown | 1976 MachineOperatorBuilder::kFloat64RoundDown |
1946 MachineOperatorBuilder::kFloat32RoundUp | 1977 MachineOperatorBuilder::kFloat32RoundUp |
1947 MachineOperatorBuilder::kFloat64RoundUp | 1978 MachineOperatorBuilder::kFloat64RoundUp |
1948 MachineOperatorBuilder::kFloat32RoundTruncate | 1979 MachineOperatorBuilder::kFloat32RoundTruncate |
1949 MachineOperatorBuilder::kFloat64RoundTruncate | 1980 MachineOperatorBuilder::kFloat64RoundTruncate |
1950 MachineOperatorBuilder::kFloat64RoundTiesAway | 1981 MachineOperatorBuilder::kFloat64RoundTiesAway |
1951 MachineOperatorBuilder::kWord32Popcnt | 1982 MachineOperatorBuilder::kWord32Popcnt |
1952 MachineOperatorBuilder::kWord64Popcnt; 1983 MachineOperatorBuilder::kWord64Popcnt;
1953 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. 1984 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f.
1954 } 1985 }
1955 1986
1956 } // namespace compiler 1987 } // namespace compiler
1957 } // namespace internal 1988 } // namespace internal
1958 } // namespace v8 1989 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ppc/code-generator-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698