Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 3c8cab2d83300cc4fc5684bdb58559bf2c3d8c95..3460da46e8eed70dc4f34bf7a89913d525302998 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -899,6 +899,21 @@ void MacroAssembler::Cvtqsi2sd(XMMRegister dst, const Operand& src) { |
} |
+void MacroAssembler::Cvtqui2sd(XMMRegister dst, Register src) { |
+ Label msb_set_src; |
+ Label jmp_return; |
+ testq(src, src); |
+ j(sign, &msb_set_src, Label::kNear); |
+ Cvtqsi2sd(dst, src); |
+ jmp(&jmp_return, Label::kNear); |
+ bind(&msb_set_src); |
+ shrq(src, Immediate(1)); |
+ Cvtqsi2sd(dst, src); |
+ addsd(dst, dst); |
+ bind(&jmp_return); |
+} |
+ |
+ |
void MacroAssembler::Cvtsd2si(Register dst, XMMRegister src) { |
if (CpuFeatures::IsSupported(AVX)) { |
CpuFeatureScope scope(this, AVX); |