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

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

Issue 2754263004: PPC: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: rebased Created 3 years, 8 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') | src/ppc/assembler-ppc.h » ('j') | 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 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 2110
2111 InstructionOperand inputs[4]; 2111 InstructionOperand inputs[4];
2112 size_t input_count = 0; 2112 size_t input_count = 0;
2113 inputs[input_count++] = g.UseUniqueRegister(base); 2113 inputs[input_count++] = g.UseUniqueRegister(base);
2114 inputs[input_count++] = g.UseUniqueRegister(index); 2114 inputs[input_count++] = g.UseUniqueRegister(index);
2115 inputs[input_count++] = g.UseUniqueRegister(value); 2115 inputs[input_count++] = g.UseUniqueRegister(value);
2116 Emit(opcode | AddressingModeField::encode(kMode_MRR), 2116 Emit(opcode | AddressingModeField::encode(kMode_MRR),
2117 0, nullptr, input_count, inputs); 2117 0, nullptr, input_count, inputs);
2118 } 2118 }
2119 2119
2120 void InstructionSelector::VisitAtomicExchange(Node* node) { UNIMPLEMENTED(); } 2120 void InstructionSelector::VisitAtomicExchange(Node* node) {
2121 PPCOperandGenerator g(this);
2122 Node* base = node->InputAt(0);
2123 Node* index = node->InputAt(1);
2124 Node* value = node->InputAt(2);
2125 ArchOpcode opcode = kArchNop;
2126 MachineType type = AtomicExchangeRepresentationOf(node->op());
2127 if (type == MachineType::Int8()) {
2128 opcode = kAtomicExchangeInt8;
2129 } else if (type == MachineType::Uint8()) {
2130 opcode = kAtomicExchangeUint8;
2131 } else if (type == MachineType::Int16()) {
2132 opcode = kAtomicExchangeInt16;
2133 } else if (type == MachineType::Uint16()) {
2134 opcode = kAtomicExchangeUint16;
2135 } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
2136 opcode = kAtomicExchangeWord32;
2137 } else {
2138 UNREACHABLE();
2139 return;
2140 }
2141
2142 AddressingMode addressing_mode = kMode_MRR;
2143 InstructionOperand inputs[3];
2144 size_t input_count = 0;
2145 inputs[input_count++] = g.UseUniqueRegister(base);
2146 inputs[input_count++] = g.UseUniqueRegister(index);
2147 inputs[input_count++] = g.UseUniqueRegister(value);
2148 InstructionOperand outputs[1];
2149 outputs[0] = g.UseUniqueRegister(node);
2150 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
2151 Emit(code, 1, outputs, input_count, inputs);
2152 }
2121 2153
2122 void InstructionSelector::VisitAtomicCompareExchange(Node* node) { 2154 void InstructionSelector::VisitAtomicCompareExchange(Node* node) {
2123 UNIMPLEMENTED(); 2155 UNIMPLEMENTED();
2124 } 2156 }
2125 2157
2126 // static 2158 // static
2127 MachineOperatorBuilder::Flags 2159 MachineOperatorBuilder::Flags
2128 InstructionSelector::SupportedMachineOperatorFlags() { 2160 InstructionSelector::SupportedMachineOperatorFlags() {
2129 return MachineOperatorBuilder::kFloat32RoundDown | 2161 return MachineOperatorBuilder::kFloat32RoundDown |
2130 MachineOperatorBuilder::kFloat64RoundDown | 2162 MachineOperatorBuilder::kFloat64RoundDown |
(...skipping 10 matching lines...) Expand all
2141 // static 2173 // static
2142 MachineOperatorBuilder::AlignmentRequirements 2174 MachineOperatorBuilder::AlignmentRequirements
2143 InstructionSelector::AlignmentRequirements() { 2175 InstructionSelector::AlignmentRequirements() {
2144 return MachineOperatorBuilder::AlignmentRequirements:: 2176 return MachineOperatorBuilder::AlignmentRequirements::
2145 FullUnalignedAccessSupport(); 2177 FullUnalignedAccessSupport();
2146 } 2178 }
2147 2179
2148 } // namespace compiler 2180 } // namespace compiler
2149 } // namespace internal 2181 } // namespace internal
2150 } // namespace v8 2182 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ppc/code-generator-ppc.cc ('k') | src/ppc/assembler-ppc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698