| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 if (operand.NeedsRelocation(this)) { | 427 if (operand.NeedsRelocation(this)) { |
| 428 UseScratchRegisterScope temps(this); | 428 UseScratchRegisterScope temps(this); |
| 429 Register temp = temps.AcquireX(); | 429 Register temp = temps.AcquireX(); |
| 430 Ldr(temp, operand.immediate()); | 430 Ldr(temp, operand.immediate()); |
| 431 AddSubMacro(rd, rn, temp, S, op); | 431 AddSubMacro(rd, rn, temp, S, op); |
| 432 } else if ((operand.IsImmediate() && | 432 } else if ((operand.IsImmediate() && |
| 433 !IsImmAddSub(operand.ImmediateValue())) || | 433 !IsImmAddSub(operand.ImmediateValue())) || |
| 434 (rn.IsZero() && !operand.IsShiftedRegister()) || | 434 (rn.IsZero() && !operand.IsShiftedRegister()) || |
| 435 (operand.IsShiftedRegister() && (operand.shift() == ROR))) { | 435 (operand.IsShiftedRegister() && (operand.shift() == ROR))) { |
| 436 UseScratchRegisterScope temps(this); | 436 UseScratchRegisterScope temps(this); |
| 437 Register temp = temps.AcquireSameSizeAs(rn); | 437 // Use rd as a temp if possible. |
| 438 Register temp = |
| 439 (rd.Is(rn) || rd.IsSP() || rd.IsZero()) ? |
| 440 temps.AcquireSameSizeAs(rn) : rd; |
| 438 Mov(temp, operand); | 441 Mov(temp, operand); |
| 439 AddSub(rd, rn, temp, S, op); | 442 AddSub(rd, rn, temp, S, op); |
| 440 } else { | 443 } else { |
| 441 AddSub(rd, rn, operand, S, op); | 444 AddSub(rd, rn, operand, S, op); |
| 442 } | 445 } |
| 443 } | 446 } |
| 444 | 447 |
| 445 | 448 |
| 446 void MacroAssembler::AddSubWithCarryMacro(const Register& rd, | 449 void MacroAssembler::AddSubWithCarryMacro(const Register& rd, |
| 447 const Register& rn, | 450 const Register& rn, |
| (...skipping 4846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5294 } | 5297 } |
| 5295 } | 5298 } |
| 5296 | 5299 |
| 5297 | 5300 |
| 5298 #undef __ | 5301 #undef __ |
| 5299 | 5302 |
| 5300 | 5303 |
| 5301 } } // namespace v8::internal | 5304 } } // namespace v8::internal |
| 5302 | 5305 |
| 5303 #endif // V8_TARGET_ARCH_ARM64 | 5306 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |