Index: src/compiler/x64/code-generator-x64.cc |
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc |
index 1e5d62f7e3c522a336c29bbf9214d5d24afc5d3a..4213c9f135131957dc51e93505a2b7f4444df20f 100644 |
--- a/src/compiler/x64/code-generator-x64.cc |
+++ b/src/compiler/x64/code-generator-x64.cc |
@@ -726,6 +726,9 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kSSEFloat32Div: |
ASSEMBLE_SSE_BINOP(divss); |
+ // Don't delete this mov. It may improve performance on some CPUs, |
+ // when there is a (v)mulss depending on the result. |
+ __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister()); |
break; |
case kSSEFloat32Abs: { |
// TODO(bmeurer): Use RIP relative 128-bit constants. |
@@ -767,6 +770,9 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kSSEFloat64Div: |
ASSEMBLE_SSE_BINOP(divsd); |
+ // Don't delete this mov. It may improve performance on some CPUs, |
+ // when there is a (v)mulsd depending on the result. |
+ __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister()); |
break; |
case kSSEFloat64Mod: { |
__ subq(rsp, Immediate(kDoubleSize)); |
@@ -919,6 +925,9 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kAVXFloat32Div: |
ASSEMBLE_AVX_BINOP(vdivss); |
+ // Don't delete this mov. It may improve performance on some CPUs, |
+ // when there is a (v)mulss depending on the result. |
+ __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister()); |
break; |
case kAVXFloat32Max: |
ASSEMBLE_AVX_BINOP(vmaxss); |
@@ -946,6 +955,9 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kAVXFloat64Div: |
ASSEMBLE_AVX_BINOP(vdivsd); |
+ // Don't delete this mov. It may improve performance on some CPUs, |
+ // when there is a (v)mulsd depending on the result. |
+ __ movaps(i.OutputDoubleRegister(), i.OutputDoubleRegister()); |
break; |
case kAVXFloat64Max: |
ASSEMBLE_AVX_BINOP(vmaxsd); |