OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 DiscardMoveMode discard_mode) { | 245 DiscardMoveMode discard_mode) { |
246 DCHECK(allow_macro_instructions_); | 246 DCHECK(allow_macro_instructions_); |
247 DCHECK(!rd.IsZero()); | 247 DCHECK(!rd.IsZero()); |
248 | 248 |
249 // Provide a swap register for instructions that need to write into the | 249 // Provide a swap register for instructions that need to write into the |
250 // system stack pointer (and can't do this inherently). | 250 // system stack pointer (and can't do this inherently). |
251 UseScratchRegisterScope temps(this); | 251 UseScratchRegisterScope temps(this); |
252 Register dst = (rd.IsSP()) ? temps.AcquireSameSizeAs(rd) : rd; | 252 Register dst = (rd.IsSP()) ? temps.AcquireSameSizeAs(rd) : rd; |
253 | 253 |
254 if (operand.NeedsRelocation(this)) { | 254 if (operand.NeedsRelocation(this)) { |
255 Ldr(dst, operand.immediate()); | 255 Ldr(dst, operand); |
256 | 256 |
257 } else if (operand.IsImmediate()) { | 257 } else if (operand.IsImmediate()) { |
258 // Call the macro assembler for generic immediates. | 258 // Call the macro assembler for generic immediates. |
259 Mov(dst, operand.ImmediateValue()); | 259 Mov(dst, operand.ImmediateValue()); |
260 | 260 |
261 } else if (operand.IsShiftedRegister() && (operand.shift_amount() != 0)) { | 261 } else if (operand.IsShiftedRegister() && (operand.shift_amount() != 0)) { |
262 // Emit a shift instruction if moving a shifted register. This operation | 262 // Emit a shift instruction if moving a shifted register. This operation |
263 // could also be achieved using an orr instruction (like orn used by Mvn), | 263 // could also be achieved using an orr instruction (like orn used by Mvn), |
264 // but using a shift instruction makes the disassembly clearer. | 264 // but using a shift instruction makes the disassembly clearer. |
265 EmitShift(dst, operand.reg(), operand.shift(), operand.shift_amount()); | 265 EmitShift(dst, operand.reg(), operand.shift(), operand.shift_amount()); |
(...skipping 4343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4609 } | 4609 } |
4610 | 4610 |
4611 | 4611 |
4612 #undef __ | 4612 #undef __ |
4613 | 4613 |
4614 | 4614 |
4615 } // namespace internal | 4615 } // namespace internal |
4616 } // namespace v8 | 4616 } // namespace v8 |
4617 | 4617 |
4618 #endif // V8_TARGET_ARCH_ARM64 | 4618 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |