From 4d74d4d2c4b35d6388f7b3b6da434e08ffeb8479 Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Fri, 25 Feb 2011 13:04:07 +0000 Subject: [PATCH] ARM: Fix instruction double to i The double to i convertion should round to zero not infinity. Thes bug was revealed by http://codereview.chromium.org/6597003, where the value of (x * 1.0000000001) | 0 was x - 1 and not x when x was a negative smi. I will not commit http://codereview.chromium.org/6597003 before this is committed. TEST=test/mjsunit/smi-ops-inlined.js Review URL: http://codereview.chromium.org/6594008 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6951 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/lithium-codegen-arm.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index 73f05f5..d375617 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -3371,10 +3371,7 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) { Register scratch1 = scratch0(); Register scratch2 = ToRegister(instr->TempAt(0)); - VFPRoundingMode rounding_mode = instr->truncating() ? kRoundToMinusInf - : kRoundToNearest; - - EmitVFPTruncate(rounding_mode, + EmitVFPTruncate(kRoundToZero, single_scratch, double_input, scratch1, -- 2.7.4