Index: src/compiler/x87/code-generator-x87.cc |
diff --git a/src/compiler/x87/code-generator-x87.cc b/src/compiler/x87/code-generator-x87.cc |
index 30da40b1739beeee5f31ccbfae77e541e603c6da..37827b292f0185c4b4a72d052250b0fde0d0fc30 100644 |
--- a/src/compiler/x87/code-generator-x87.cc |
+++ b/src/compiler/x87/code-generator-x87.cc |
@@ -1209,6 +1209,26 @@ void CodeGenerator::AssembleArchInstruction(Instruction* instr) { |
} |
break; |
} |
+ case kX87Float32ToUint32: { |
+ if (!instr->InputAt(0)->IsDoubleRegister()) { |
+ __ fld_s(i.InputOperand(0)); |
+ } |
+ Label success; |
+ __ TruncateX87TOSToI(i.OutputRegister(0)); |
+ __ test(i.OutputRegister(0), i.OutputRegister(0)); |
+ __ j(positive, &success); |
+ __ push(Immediate(INT32_MIN)); |
+ __ fild_s(Operand(esp, 0)); |
+ __ lea(esp, Operand(esp, kPointerSize)); |
+ __ faddp(); |
+ __ TruncateX87TOSToI(i.OutputRegister(0)); |
+ __ or_(i.OutputRegister(0), Immediate(0x80000000)); |
+ __ bind(&success); |
+ if (!instr->InputAt(0)->IsDoubleRegister()) { |
+ __ fstp(0); |
+ } |
+ break; |
+ } |
case kX87Float64ToInt32: { |
if (!instr->InputAt(0)->IsDoubleRegister()) { |
__ fld_d(i.InputOperand(0)); |