Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: src/compiler/ia32/code-generator-ia32.cc

Issue 582713002: [turbofan] IA: Float64ToUint32 supports mem operand (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/ia32/instruction-selector-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | src/compiler/ia32/instruction-selector-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698