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/compiler/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2239 Node* right_of_left = left->InputAt(1); | 2239 Node* right_of_left = left->InputAt(1); |
2240 Emit(kArm64Bfi, g.DefineSameAsFirst(left), g.UseRegister(right_of_left), | 2240 Emit(kArm64Bfi, g.DefineSameAsFirst(left), g.UseRegister(right_of_left), |
2241 g.UseRegister(right), g.TempImmediate(32), g.TempImmediate(32)); | 2241 g.UseRegister(right), g.TempImmediate(32), g.TempImmediate(32)); |
2242 Emit(kArm64Float64MoveU64, g.DefineAsRegister(node), g.UseRegister(left)); | 2242 Emit(kArm64Float64MoveU64, g.DefineAsRegister(node), g.UseRegister(left)); |
2243 return; | 2243 return; |
2244 } | 2244 } |
2245 Emit(kArm64Float64InsertHighWord32, g.DefineAsRegister(node), | 2245 Emit(kArm64Float64InsertHighWord32, g.DefineAsRegister(node), |
2246 g.UseRegister(left), g.UseRegister(right)); | 2246 g.UseRegister(left), g.UseRegister(right)); |
2247 } | 2247 } |
2248 | 2248 |
| 2249 void InstructionSelector::VisitAtomicLoad(Node* node) { |
| 2250 LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
| 2251 Arm64OperandGenerator g(this); |
| 2252 Node* base = node->InputAt(0); |
| 2253 Node* index = node->InputAt(1); |
| 2254 ArchOpcode opcode = kArchNop; |
| 2255 ImmediateMode immediate_mode = kNoImmediate; |
| 2256 switch (load_rep.representation()) { |
| 2257 case MachineRepresentation::kWord8: |
| 2258 opcode = load_rep.IsSigned() ? kAtomicLoadInt8 : kAtomicLoadUint8; |
| 2259 immediate_mode = kLoadStoreImm8; |
| 2260 break; |
| 2261 case MachineRepresentation::kWord16: |
| 2262 opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16; |
| 2263 immediate_mode = kLoadStoreImm16; |
| 2264 break; |
| 2265 case MachineRepresentation::kWord32: |
| 2266 opcode = kAtomicLoadWord32; |
| 2267 immediate_mode = kLoadStoreImm32; |
| 2268 break; |
| 2269 default: |
| 2270 UNREACHABLE(); |
| 2271 return; |
| 2272 } |
| 2273 Emit(opcode | AddressingModeField::encode(kMode_MRR), |
| 2274 g.DefineAsRegister(node), g.UseRegister(base), g.UseRegister(index)); |
| 2275 } |
2249 | 2276 |
2250 // static | 2277 // static |
2251 MachineOperatorBuilder::Flags | 2278 MachineOperatorBuilder::Flags |
2252 InstructionSelector::SupportedMachineOperatorFlags() { | 2279 InstructionSelector::SupportedMachineOperatorFlags() { |
2253 return MachineOperatorBuilder::kFloat32Max | | 2280 return MachineOperatorBuilder::kFloat32Max | |
2254 MachineOperatorBuilder::kFloat32Min | | 2281 MachineOperatorBuilder::kFloat32Min | |
2255 MachineOperatorBuilder::kFloat32RoundDown | | 2282 MachineOperatorBuilder::kFloat32RoundDown | |
2256 MachineOperatorBuilder::kFloat64Max | | 2283 MachineOperatorBuilder::kFloat64Max | |
2257 MachineOperatorBuilder::kFloat64Min | | 2284 MachineOperatorBuilder::kFloat64Min | |
2258 MachineOperatorBuilder::kFloat64RoundDown | | 2285 MachineOperatorBuilder::kFloat64RoundDown | |
2259 MachineOperatorBuilder::kFloat32RoundUp | | 2286 MachineOperatorBuilder::kFloat32RoundUp | |
2260 MachineOperatorBuilder::kFloat64RoundUp | | 2287 MachineOperatorBuilder::kFloat64RoundUp | |
2261 MachineOperatorBuilder::kFloat32RoundTruncate | | 2288 MachineOperatorBuilder::kFloat32RoundTruncate | |
2262 MachineOperatorBuilder::kFloat64RoundTruncate | | 2289 MachineOperatorBuilder::kFloat64RoundTruncate | |
2263 MachineOperatorBuilder::kFloat64RoundTiesAway | | 2290 MachineOperatorBuilder::kFloat64RoundTiesAway | |
2264 MachineOperatorBuilder::kFloat32RoundTiesEven | | 2291 MachineOperatorBuilder::kFloat32RoundTiesEven | |
2265 MachineOperatorBuilder::kFloat64RoundTiesEven | | 2292 MachineOperatorBuilder::kFloat64RoundTiesEven | |
2266 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2293 MachineOperatorBuilder::kWord32ShiftIsSafe | |
2267 MachineOperatorBuilder::kInt32DivIsSafe | | 2294 MachineOperatorBuilder::kInt32DivIsSafe | |
2268 MachineOperatorBuilder::kUint32DivIsSafe | | 2295 MachineOperatorBuilder::kUint32DivIsSafe | |
2269 MachineOperatorBuilder::kWord32ReverseBits | | 2296 MachineOperatorBuilder::kWord32ReverseBits | |
2270 MachineOperatorBuilder::kWord64ReverseBits; | 2297 MachineOperatorBuilder::kWord64ReverseBits; |
2271 } | 2298 } |
2272 | 2299 |
2273 } // namespace compiler | 2300 } // namespace compiler |
2274 } // namespace internal | 2301 } // namespace internal |
2275 } // namespace v8 | 2302 } // namespace v8 |
OLD | NEW |