Index: src/compiler/ia32/code-generator-ia32.cc |
diff --git a/src/compiler/ia32/code-generator-ia32.cc b/src/compiler/ia32/code-generator-ia32.cc |
index 3a3fd795d8d38cd164fc68e7f6129265548d05f5..a0d30e6ba8038b79527f1da11748388c65896682 100644 |
--- a/src/compiler/ia32/code-generator-ia32.cc |
+++ b/src/compiler/ia32/code-generator-ia32.cc |
@@ -302,11 +302,17 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
break; |
case kSSEFloat64ToUint32: { |
XMMRegister scratch = xmm0; |
+ Label done; |
__ Move(scratch, -2147483648.0); |
- // TODO(turbofan): IA32 SSE subsd() should take an operand. |
- __ addsd(scratch, i.InputDoubleRegister(0)); |
+ __ addsd(scratch, i.InputOperand(0)); |
__ cvttsd2si(i.OutputRegister(), scratch); |
__ add(i.OutputRegister(), Immediate(0x80000000)); |
+ __ j(not_carry, &done, Label::kNear); |
titzer
2014/09/18 14:03:06
What does this extra condition here check?
Note t
Weiliang
2014/09/18 14:11:01
cvttsd2si truncates the result by rounding toward
|
+ __ cvtsi2sd(scratch, i.OutputRegister()); |
+ __ ucomisd(scratch, i.InputOperand(0)); |
+ __ j(equal, &done, Label::kNear); |
+ __ sub(i.OutputRegister(), Immediate(1)); |
+ __ bind(&done); |
break; |
} |
case kSSEInt32ToFloat64: |