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/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 Loading... |
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2367 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); | 2403 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); |
2368 req_aligned[0] = MachineType::Float32(); | 2404 req_aligned[0] = MachineType::Float32(); |
2369 req_aligned[1] = MachineType::Float64(); | 2405 req_aligned[1] = MachineType::Float64(); |
2370 return MachineOperatorBuilder::AlignmentRequirements:: | 2406 return MachineOperatorBuilder::AlignmentRequirements:: |
2371 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); | 2407 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); |
2372 } | 2408 } |
2373 | 2409 |
2374 } // namespace compiler | 2410 } // namespace compiler |
2375 } // namespace internal | 2411 } // namespace internal |
2376 } // namespace v8 | 2412 } // namespace v8 |
OLD | NEW |