| 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 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2214 inputs[input_count++] = g.UseUniqueRegister(index); | 2214 inputs[input_count++] = g.UseUniqueRegister(index); |
| 2215 inputs[input_count++] = g.UseUniqueRegister(value); | 2215 inputs[input_count++] = g.UseUniqueRegister(value); |
| 2216 InstructionOperand outputs[1]; | 2216 InstructionOperand outputs[1]; |
| 2217 outputs[0] = g.UseUniqueRegister(node); | 2217 outputs[0] = g.UseUniqueRegister(node); |
| 2218 InstructionOperand temp[1]; | 2218 InstructionOperand temp[1]; |
| 2219 temp[0] = g.TempRegister(); | 2219 temp[0] = g.TempRegister(); |
| 2220 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); | 2220 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
| 2221 Emit(code, 1, outputs, input_count, inputs, 1, temp); | 2221 Emit(code, 1, outputs, input_count, inputs, 1, temp); |
| 2222 } | 2222 } |
| 2223 | 2223 |
| 2224 void InstructionSelector::VisitAtomicCompareExchange(Node* node) { |
| 2225 ArmOperandGenerator g(this); |
| 2226 Node* base = node->InputAt(0); |
| 2227 Node* index = node->InputAt(1); |
| 2228 Node* old_value = node->InputAt(2); |
| 2229 Node* new_value = node->InputAt(3); |
| 2230 ArchOpcode opcode = kArchNop; |
| 2231 MachineType type = AtomicCompareExchangeRepresentationOf(node->op()); |
| 2232 if (type == MachineType::Int8()) { |
| 2233 opcode = kAtomicCompareExchangeInt8; |
| 2234 } else if (type == MachineType::Uint8()) { |
| 2235 opcode = kAtomicCompareExchangeUint8; |
| 2236 } else if (type == MachineType::Int16()) { |
| 2237 opcode = kAtomicCompareExchangeInt16; |
| 2238 } else if (type == MachineType::Uint16()) { |
| 2239 opcode = kAtomicCompareExchangeUint16; |
| 2240 } else if (type == MachineType::Int32() || type == MachineType::Uint32()) { |
| 2241 opcode = kAtomicCompareExchangeWord32; |
| 2242 } else { |
| 2243 UNREACHABLE(); |
| 2244 return; |
| 2245 } |
| 2246 |
| 2247 AddressingMode addressing_mode = kMode_Offset_RR; |
| 2248 InstructionOperand inputs[4]; |
| 2249 size_t input_count = 0; |
| 2250 inputs[input_count++] = g.UseUniqueRegister(base); |
| 2251 inputs[input_count++] = g.UseUniqueRegister(index); |
| 2252 inputs[input_count++] = g.UseUniqueRegister(old_value); |
| 2253 inputs[input_count++] = g.UseUniqueRegister(new_value); |
| 2254 InstructionOperand outputs[1]; |
| 2255 outputs[0] = g.UseUniqueRegister(node); |
| 2256 InstructionOperand temp[2]; |
| 2257 temp[0] = g.TempRegister(); |
| 2258 temp[1] = g.TempRegister(); |
| 2259 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
| 2260 Emit(code, 1, outputs, input_count, inputs, 2, temp); |
| 2261 } |
| 2262 |
| 2224 #define SIMD_TYPE_LIST(V) \ | 2263 #define SIMD_TYPE_LIST(V) \ |
| 2225 V(Float32x4) \ | 2264 V(Float32x4) \ |
| 2226 V(Int32x4) \ | 2265 V(Int32x4) \ |
| 2227 V(Int16x8) \ | 2266 V(Int16x8) \ |
| 2228 V(Int8x16) | 2267 V(Int8x16) |
| 2229 | 2268 |
| 2230 #define SIMD_FORMAT_LIST(V) \ | 2269 #define SIMD_FORMAT_LIST(V) \ |
| 2231 V(32x4) \ | 2270 V(32x4) \ |
| 2232 V(16x8) \ | 2271 V(16x8) \ |
| 2233 V(8x16) | 2272 V(8x16) |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2434 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); | 2473 Vector<MachineType> req_aligned = Vector<MachineType>::New(2); |
| 2435 req_aligned[0] = MachineType::Float32(); | 2474 req_aligned[0] = MachineType::Float32(); |
| 2436 req_aligned[1] = MachineType::Float64(); | 2475 req_aligned[1] = MachineType::Float64(); |
| 2437 return MachineOperatorBuilder::AlignmentRequirements:: | 2476 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2438 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); | 2477 SomeUnalignedAccessUnsupported(req_aligned, req_aligned); |
| 2439 } | 2478 } |
| 2440 | 2479 |
| 2441 } // namespace compiler | 2480 } // namespace compiler |
| 2442 } // namespace internal | 2481 } // namespace internal |
| 2443 } // namespace v8 | 2482 } // namespace v8 |
| OLD | NEW |