Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index b1df77f9d7e14bdfedb7b7a7e789a471620239b7..073ee7ea7d44bd6bc821fdc6bfb96b0c51055f51 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -1147,6 +1147,99 @@ void MacroAssembler::LslPair(Register dst_low, Register dst_high, |
} |
} |
+void MacroAssembler::LsrPair(Register dst_low, Register dst_high, |
+ Register src_low, Register src_high, |
+ Register scratch, Register shift) { |
+ DCHECK(!AreAliased(dst_low, src_high)); |
+ DCHECK(!AreAliased(dst_low, shift)); |
+ |
+ Label less_than_32; |
+ Label done; |
+ rsb(scratch, shift, Operand(32), SetCC); |
+ b(gt, &less_than_32); |
+ // If shift >= 32 |
+ and_(scratch, shift, Operand(0x1f)); |
+ lsr(dst_low, src_high, Operand(scratch)); |
+ mov(dst_high, Operand(0)); |
+ jmp(&done); |
+ bind(&less_than_32); |
+ // If shift < 32 |
+ |
+ lsr(dst_low, src_low, Operand(shift)); |
+ orr(dst_low, dst_low, Operand(src_high, LSL, scratch)); |
+ lsr(dst_high, src_high, Operand(shift)); |
+ bind(&done); |
+} |
+ |
+void MacroAssembler::LsrPair(Register dst_low, Register dst_high, |
+ Register src_low, Register src_high, |
+ uint32_t shift) { |
+ DCHECK(!AreAliased(dst_low, src_high)); |
+ Label less_than_32; |
+ Label done; |
+ if (shift == 32) { |
+ mov(dst_low, src_high); |
+ mov(dst_high, Operand(0)); |
+ } else if (shift > 32) { |
+ shift &= 0x1f; |
+ lsr(dst_low, src_high, Operand(shift)); |
+ mov(dst_high, Operand(0)); |
+ } else if (shift == 0) { |
+ Move(dst_low, src_low); |
+ Move(dst_high, src_high); |
+ } else { |
+ lsr(dst_low, src_low, Operand(shift)); |
+ orr(dst_low, dst_low, Operand(src_high, LSL, 32 - shift)); |
+ lsr(dst_high, src_high, Operand(shift)); |
+ } |
+} |
+ |
+void MacroAssembler::AsrPair(Register dst_low, Register dst_high, |
+ Register src_low, Register src_high, |
+ Register scratch, Register shift) { |
+ DCHECK(!AreAliased(dst_low, src_high)); |
+ DCHECK(!AreAliased(dst_low, shift)); |
+ |
+ Label less_than_32; |
+ Label done; |
+ rsb(scratch, shift, Operand(32), SetCC); |
+ b(gt, &less_than_32); |
+ // If shift >= 32 |
+ and_(scratch, shift, Operand(0x1f)); |
+ asr(dst_low, src_high, Operand(scratch)); |
+ asr(dst_high, src_high, Operand(31)); |
+ jmp(&done); |
+ bind(&less_than_32); |
+ // If shift < 32 |
+ lsr(dst_low, src_low, Operand(shift)); |
+ orr(dst_low, dst_low, Operand(src_high, LSL, scratch)); |
+ asr(dst_high, src_high, Operand(shift)); |
+ bind(&done); |
+} |
+ |
+void MacroAssembler::AsrPair(Register dst_low, Register dst_high, |
+ Register src_low, Register src_high, |
+ uint32_t shift) { |
+ DCHECK(!AreAliased(dst_low, src_high)); |
+ Label less_than_32; |
+ Label done; |
+ if (shift == 32) { |
+ mov(dst_low, src_high); |
+ asr(dst_high, src_high, Operand(31)); |
+ } else if (shift > 32) { |
+ shift &= 0x1f; |
+ asr(dst_low, src_high, Operand(shift)); |
+ asr(dst_high, src_high, Operand(31)); |
+ } else if (shift == 0) { |
+ Move(dst_low, src_low); |
+ Move(dst_high, src_high); |
+ } else { |
+ lsr(dst_low, src_low, Operand(shift)); |
+ orr(dst_low, dst_low, Operand(src_high, LSL, 32 - shift)); |
+ asr(dst_high, src_high, Operand(shift)); |
+ } |
+} |
+ |
void MacroAssembler::LoadConstantPoolPointerRegisterFromCodeTargetAddress( |
Register code_target_address) { |
DCHECK(FLAG_enable_embedded_constant_pool); |