Index: src/compiler/arm64/code-generator-arm64.cc |
diff --git a/src/compiler/arm64/code-generator-arm64.cc b/src/compiler/arm64/code-generator-arm64.cc |
index 5c27bbec2bdc9dd245faa7e8f61bbf50bacf73b3..54930c79a61c653f2ae0f2560e263b858b743a50 100644 |
--- a/src/compiler/arm64/code-generator-arm64.cc |
+++ b/src/compiler/arm64/code-generator-arm64.cc |
@@ -1956,10 +1956,14 @@ void CodeGenerator::AssembleMove(InstructionOperand* source, |
__ Fmov(dst, src.ToFloat32()); |
} else { |
DCHECK(destination->IsFPStackSlot()); |
- UseScratchRegisterScope scope(masm()); |
- FPRegister temp = scope.AcquireS(); |
- __ Fmov(temp, src.ToFloat32()); |
- __ Str(temp, g.ToMemOperand(destination, masm())); |
+ if (bit_cast<int32_t>(src.ToFloat32()) == 0) { |
+ __ Str(wzr, g.ToMemOperand(destination, masm())); |
+ } else { |
+ UseScratchRegisterScope scope(masm()); |
+ FPRegister temp = scope.AcquireS(); |
+ __ Fmov(temp, src.ToFloat32()); |
+ __ Str(temp, g.ToMemOperand(destination, masm())); |
+ } |
} |
} else { |
DCHECK_EQ(Constant::kFloat64, src.type()); |
@@ -1968,10 +1972,14 @@ void CodeGenerator::AssembleMove(InstructionOperand* source, |
__ Fmov(dst, src.ToFloat64()); |
} else { |
DCHECK(destination->IsFPStackSlot()); |
- UseScratchRegisterScope scope(masm()); |
- FPRegister temp = scope.AcquireD(); |
- __ Fmov(temp, src.ToFloat64()); |
- __ Str(temp, g.ToMemOperand(destination, masm())); |
+ if (bit_cast<int64_t>(src.ToFloat64()) == 0) { |
+ __ Str(xzr, g.ToMemOperand(destination, masm())); |
+ } else { |
+ UseScratchRegisterScope scope(masm()); |
+ FPRegister temp = scope.AcquireD(); |
+ __ Fmov(temp, src.ToFloat64()); |
+ __ Str(temp, g.ToMemOperand(destination, masm())); |
+ } |
} |
} |
} else if (source->IsFPRegister()) { |