Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 02f7bee24811f9280148137a2df53782e9508855..4ff52afc8947a5a819a344056c2e855c78a44d4c 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -804,6 +804,34 @@ void MacroAssembler::Mul(Register rd_hi, Register rd_lo, |
} |
} |
+void MacroAssembler::Mulu(Register rd_hi, Register rd_lo, Register rs, |
+ const Operand& rt) { |
+ Register reg; |
+ if (rt.is_reg()) { |
+ reg = rt.rm(); |
+ } else { |
+ DCHECK(!rs.is(at)); |
+ reg = at; |
+ li(reg, rt); |
+ } |
+ |
+ if (!IsMipsArchVariant(kMips32r6)) { |
+ multu(rs, reg); |
+ mflo(rd_lo); |
+ mfhi(rd_hi); |
+ } else { |
+ if (rd_lo.is(rs)) { |
+ DCHECK(!rd_hi.is(rs)); |
+ DCHECK(!rd_hi.is(reg) && !rd_lo.is(reg)); |
+ muhu(rd_hi, rs, reg); |
+ mulu(rd_lo, rs, reg); |
+ } else { |
+ DCHECK(!rd_hi.is(reg) && !rd_lo.is(reg)); |
+ mulu(rd_lo, rs, reg); |
+ muhu(rd_hi, rs, reg); |
+ } |
+ } |
+} |
void MacroAssembler::Mulh(Register rd, Register rs, const Operand& rt) { |
if (rt.is_reg()) { |