Index: src/mips64/macro-assembler-mips64.cc |
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc |
index f59b28a51bcd1d2414e61474f7749aa3833cb50d..52b85796563477dd662186ea17c576d4175f4f1d 100644 |
--- a/src/mips64/macro-assembler-mips64.cc |
+++ b/src/mips64/macro-assembler-mips64.cc |
@@ -1548,6 +1548,41 @@ void MacroAssembler::Cvt_d_ul(FPURegister fd, Register rs) { |
} |
+void MacroAssembler::Cvt_s_ul(FPURegister fd, FPURegister fs) { |
+ // Move the data from fs to t8. |
+ dmfc1(t8, fs); |
+ Cvt_s_ul(fd, t8); |
+} |
+ |
+ |
+void MacroAssembler::Cvt_s_ul(FPURegister fd, Register rs) { |
+ // Convert rs to a FP value in fd. |
+ |
+ DCHECK(!rs.is(t9)); |
+ DCHECK(!rs.is(at)); |
+ |
+ Label positive, conversion_done; |
+ |
+ Branch(&positive, ge, rs, Operand(zero_reg)); |
+ |
+ // Rs >= 2^31. |
+ andi(t9, rs, 1); |
+ dsrl(rs, rs, 1); |
+ or_(t9, t9, rs); |
+ dmtc1(t9, fd); |
+ cvt_s_l(fd, fd); |
+ Branch(USE_DELAY_SLOT, &conversion_done); |
+ add_s(fd, fd, fd); // In delay slot. |
+ |
+ bind(&positive); |
+ // Rs < 2^31, we can do simple conversion. |
+ dmtc1(rs, fd); |
+ cvt_s_l(fd, fd); |
+ |
+ bind(&conversion_done); |
+} |
+ |
+ |
void MacroAssembler::Round_l_d(FPURegister fd, FPURegister fs) { |
round_l_d(fd, fs); |
} |