Fix math.round with SSE4.1.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 28 Feb 2013 10:39:34 +0000 (10:39 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 28 Feb 2013 10:39:34 +0000 (10:39 +0000)
R=verwaest@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/12388015

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@13771 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/ia32/lithium-codegen-ia32.cc
src/x64/lithium-codegen-x64.cc

index 5fc069b..464d0a9 100644 (file)
@@ -3755,7 +3755,7 @@ void LCodeGen::DoMathRound(LUnaryMathOperation* instr) {
     CpuFeatures::Scope scope(SSE4_1);
 
     __ addsd(xmm_scratch, input_reg);
-    __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown);
+    __ roundsd(xmm_scratch, xmm_scratch, Assembler::kRoundDown);
     __ cvttsd2si(output_reg, Operand(xmm_scratch));
     // Overflow is signalled with minint.
     __ cmp(output_reg, 0x80000000u);
index c6bbba0..3722f14 100644 (file)
@@ -3543,7 +3543,7 @@ void LCodeGen::DoMathRound(LUnaryMathOperation* instr) {
   if (CpuFeatures::IsSupported(SSE4_1) && !minus_zero_check) {
     CpuFeatures::Scope scope(SSE4_1);
     __ addsd(xmm_scratch, input_reg);
-    __ roundsd(xmm_scratch, input_reg, Assembler::kRoundDown);
+    __ roundsd(xmm_scratch, xmm_scratch, Assembler::kRoundDown);
     __ cvttsd2si(output_reg, xmm_scratch);
     // Overflow is signalled with minint.
     __ cmpl(output_reg, Immediate(0x80000000));