Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index ad3827aba572e60eff81d0e83357704bd6bee525..461e097cd67c0131531d9945ba0dd06b530b5a8a 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -788,14 +788,26 @@ void MacroAssembler::PopCallerSaved(SaveFPRegsMode fp_mode, |
void MacroAssembler::Cvtlsi2sd(XMMRegister dst, Register src) { |
- xorps(dst, dst); |
- cvtlsi2sd(dst, src); |
+ if (CpuFeatures::IsSupported(AVX)) { |
+ CpuFeatureScope scope(this, AVX); |
+ vxorpd(dst, dst, dst); |
+ vcvtlsi2sd(dst, dst, src); |
+ } else { |
+ xorps(dst, dst); |
+ cvtlsi2sd(dst, src); |
+ } |
} |
void MacroAssembler::Cvtlsi2sd(XMMRegister dst, const Operand& src) { |
- xorps(dst, dst); |
- cvtlsi2sd(dst, src); |
+ if (CpuFeatures::IsSupported(AVX)) { |
+ CpuFeatureScope scope(this, AVX); |
+ vxorpd(dst, dst, dst); |
+ vcvtlsi2sd(dst, dst, src); |
+ } else { |
+ xorps(dst, dst); |
+ cvtlsi2sd(dst, src); |
+ } |
} |