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

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

Issue 2623633003: [Atomics] Make Atomics.exchange a builtin using TF (Closed)
Patch Set: remove 0 extend for arm Created 3 years, 9 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
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/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 AddressingMode addressing_mode = kMode_Offset_RR; 2174 AddressingMode addressing_mode = kMode_Offset_RR;
2175 InstructionOperand inputs[4]; 2175 InstructionOperand inputs[4];
2176 size_t input_count = 0; 2176 size_t input_count = 0;
2177 inputs[input_count++] = g.UseUniqueRegister(base); 2177 inputs[input_count++] = g.UseUniqueRegister(base);
2178 inputs[input_count++] = g.UseUniqueRegister(index); 2178 inputs[input_count++] = g.UseUniqueRegister(index);
2179 inputs[input_count++] = g.UseUniqueRegister(value); 2179 inputs[input_count++] = g.UseUniqueRegister(value);
2180 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); 2180 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
2181 Emit(code, 0, nullptr, input_count, inputs); 2181 Emit(code, 0, nullptr, input_count, inputs);
2182 } 2182 }
2183 2183
2184 void InstructionSelector::VisitAtomicExchange(Node* node) {
2185 ArmOperandGenerator g(this);
2186 Node* base = node->InputAt(0);
2187 Node* index = node->InputAt(1);
2188 Node* value = node->InputAt(2);
2189 ArchOpcode opcode = kArchNop;
2190 MachineType type = AtomicExchangeRepresentationOf(node->op());
2191 if (type == MachineType::Int8()) {
2192 opcode = kAtomicExchangeInt8;
2193 } else if (type == MachineType::Uint8()) {
2194 opcode = kAtomicExchangeUint8;
2195 } else if (type == MachineType::Int16()) {
2196 opcode = kAtomicExchangeInt16;
2197 } else if (type == MachineType::Uint16()) {
2198 opcode = kAtomicExchangeUint16;
2199 } else if (type == MachineType::Int32() || type == MachineType::Uint32()) {
2200 opcode = kAtomicExchangeWord32;
2201 } else {
2202 UNREACHABLE();
2203 return;
2204 }
2205
2206 AddressingMode addressing_mode = kMode_Offset_RR;
2207 InstructionOperand inputs[3];
2208 size_t input_count = 0;
2209 inputs[input_count++] = g.UseUniqueRegister(base);
2210 inputs[input_count++] = g.UseUniqueRegister(index);
2211 inputs[input_count++] = g.UseUniqueRegister(value);
2212 InstructionOperand outputs[1];
2213 outputs[0] = g.UseUniqueRegister(node);
2214 InstructionOperand temp[1];
2215 temp[0] = g.TempRegister();
2216 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode);
2217 Emit(code, 1, outputs, input_count, inputs, 1, temp);
2218 }
2219
2184 #define SIMD_TYPE_LIST(V) \ 2220 #define SIMD_TYPE_LIST(V) \
2185 V(Float32x4) \ 2221 V(Float32x4) \
2186 V(Int32x4) \ 2222 V(Int32x4) \
2187 V(Int16x8) \ 2223 V(Int16x8) \
2188 V(Int8x16) 2224 V(Int8x16)
2189 2225
2190 #define SIMD_FORMAT_LIST(V) \ 2226 #define SIMD_FORMAT_LIST(V) \
2191 V(32x4) \ 2227 V(32x4) \
2192 V(16x8) \ 2228 V(16x8) \
2193 V(8x16) 2229 V(8x16)
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
2385 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); 2421 Vector<MachineType> req_aligned = Vector<MachineType>::New(2);
2386 req_aligned[0] = MachineType::Float32(); 2422 req_aligned[0] = MachineType::Float32();
2387 req_aligned[1] = MachineType::Float64(); 2423 req_aligned[1] = MachineType::Float64();
2388 return MachineOperatorBuilder::AlignmentRequirements:: 2424 return MachineOperatorBuilder::AlignmentRequirements::
2389 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); 2425 SomeUnalignedAccessUnsupported(req_aligned, req_aligned);
2390 } 2426 }
2391 2427
2392 } // namespace compiler 2428 } // namespace compiler
2393 } // namespace internal 2429 } // namespace internal
2394 } // namespace v8 2430 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698