Chromium Code Reviews| Index: src/arm64/assembler-arm64.cc |
| diff --git a/src/arm64/assembler-arm64.cc b/src/arm64/assembler-arm64.cc |
| index c45910c7bc799895c3175f092625d71277659851..70c44dd4b39cf084918f237e1dcd43a1c06d062a 100644 |
| --- a/src/arm64/assembler-arm64.cc |
| +++ b/src/arm64/assembler-arm64.cc |
| @@ -294,6 +294,34 @@ bool Operand::NeedsRelocation(const Assembler* assembler) const { |
| } |
| +MemOperand::PairResult MemOperand::AreConsistentForPair( |
| + const MemOperand& operandA, |
|
ulan
2014/06/04 09:28:19
Nit: indent to four spaces
vincent.belliard
2014/06/09 10:31:15
Done.
|
| + const MemOperand& operandB, |
| + int access_size_log2) { |
| + ASSERT(access_size_log2 >= 0); |
| + ASSERT(access_size_log2 <= 3); |
| + // Step one: check that they share the same base, that the mode is Offset |
| + // and that the offset is a multiple of 8. |
| + if (!operandA.base().Is(operandB.base()) || |
| + (operandA.addrmode() != Offset) || |
| + (operandB.addrmode() != Offset) || |
| + ((operandA.offset() & 0x7) != 0)) { |
|
ulan
2014/06/04 09:28:19
Is the offset required to be multiple of 8 or mult
vincent.belliard
2014/06/09 10:31:15
Fixed: offset multiple of access size.
The follow
|
| + return kNotPair; |
| + } |
| + // Step two: check that the offsets are contiguous and that the range |
| + // is OK for ldp/stp. |
| + if ((operandB.offset() == operandA.offset() + (1 << access_size_log2)) && |
| + is_int7(operandA.offset() >> access_size_log2)) { |
| + return kPairAB; |
| + } |
| + if ((operandA.offset() == operandB.offset() + (1 << access_size_log2)) && |
| + is_int7(operandB.offset() >> access_size_log2)) { |
| + return kPairBA; |
| + } |
| + return kNotPair; |
| +} |
| + |
| + |
| // Assembler |
| Assembler::Assembler(Isolate* isolate, void* buffer, int buffer_size) |