Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 9999ee1eddc35585408d83d43b21e6e7ae189956..f69d054a34d629072b7f89b8e842ffe7075b95da 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -1739,8 +1739,12 @@ LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
return AssignPointerMap(Define(result, result_temp)); |
} else { |
ASSERT(to.IsInteger32()); |
- LOperand* value = UseRegister(instr->value()); |
- return AssignEnvironment(DefineAsRegister(new LDoubleToI(value))); |
+ bool needs_temp = instr->CanTruncateToInt32() && |
+ !CpuFeatures::IsSupported(SSE3); |
+ LOperand* value = needs_temp ? |
+ UseTempRegister(instr->value()) : UseRegister(instr->value()); |
+ LOperand* temp = needs_temp ? TempRegister() : NULL; |
+ return AssignEnvironment(DefineAsRegister(new LDoubleToI(value, temp))); |
} |
} else if (from.IsInteger32()) { |
if (to.IsTagged()) { |