Commit 4d74d4d2 authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

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
parent a1cf6f26
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment