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

Issue 6303012: Truncate rather than round to nearest when performing float-to-integer... (Closed)

Created:
9 years, 11 months ago by Ken Russell (switch to Gerrit)
Modified:
9 years, 7 months ago
Reviewers:
Erik Corry
CC:
v8-dev, Vyacheslav Egorov (Chromium), Mads Ager (chromium)
Visibility:
Public.

Description

Truncate rather than round to nearest when performing float-to-integer conversions for external array types, which implement the Typed Array spec. (Revision of http://codereview.chromium.org/6315004 .) Prefer SSE2 code path on x86 processors. Non-SSE2 processors now make a slow runtime call for float-to-int conversions. Use SSE3 for 32-bit signed and unsigned int array types where possible. The movement of code from ic-arm.cc to stub-cache-arm.cc caused the VFP3 code path to be tested for the first time. Fixed bugs in the register usage and in the constant value stored into integer arrays for NaN and +/-Infinity. Added new truncation test to test-api.cc. Storage of NaN and +/-Inf was already covered. Ran unit tests on x86, x64 and ARM simulator. Tested ia32 and x64 code in Chromium on Mac and Linux respectively with Typed Array unit tests and WebGL content. BUG=http://code.google.com/p/chromium/issues/detail?id=50972 TEST=test-api/ExternalArrays Committed: http://code.google.com/p/v8/source/detail?r=6431

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1540 lines, -1465 lines) Patch
M src/arm/ic-arm.cc View 2 chunks +0 lines, -683 lines 0 comments Download
M src/arm/stub-cache-arm.cc View 1 2 chunks +702 lines, -0 lines 0 comments Download
M src/builtins.h View 2 chunks +0 lines, -14 lines 0 comments Download
M src/builtins.cc View 2 chunks +0 lines, -76 lines 0 comments Download
M src/heap.h View 1 chunk +3 lines, -1 line 0 comments Download
M src/ia32/ic-ia32.cc View 2 chunks +0 lines, -342 lines 0 comments Download
M src/ia32/stub-cache-ia32.cc View 1 2 1 chunk +359 lines, -0 lines 1 comment Download
M src/ic.h View 4 chunks +0 lines, -15 lines 0 comments Download
M src/ic.cc View 3 chunks +8 lines, -51 lines 0 comments Download
M src/mips/ic-mips.cc View 1 chunk +0 lines, -12 lines 0 comments Download
M src/mips/stub-cache-mips.cc View 1 chunk +14 lines, -0 lines 0 comments Download
M src/stub-cache.h View 2 chunks +18 lines, -0 lines 0 comments Download
M src/stub-cache.cc View 2 chunks +80 lines, -0 lines 0 comments Download
M src/x64/assembler-x64.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/x64/assembler-x64.cc View 2 chunks +22 lines, -0 lines 0 comments Download
M src/x64/disasm-x64.cc View 1 chunk +5 lines, -3 lines 0 comments Download
M src/x64/ic-x64.cc View 2 chunks +0 lines, -268 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 chunk +300 lines, -0 lines 0 comments Download
M test/cctest/test-api.cc View 1 3 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Ken Russell (switch to Gerrit)
9 years, 11 months ago (2011-01-19 21:30:59 UTC) #1
Erik Corry
This needs tests in our own v8/test directory that test rounding, infinities, NaNs, large numbers. ...
9 years, 11 months ago (2011-01-20 14:41:23 UTC) #2
Ken Russell (switch to Gerrit)
On 2011/01/20 14:41:23, Erik Corry wrote: > This needs tests in our own v8/test directory ...
9 years, 11 months ago (2011-01-20 15:51:10 UTC) #3
Ken Russell (switch to Gerrit)
Added truncation test cases to test-api.cc. NaN, Infinity were already tested. Rewrote ia32 stub. Now ...
9 years, 11 months ago (2011-01-21 07:45:37 UTC) #4
Erik Corry
LGTM http://codereview.chromium.org/6303012/diff/42002/src/ia32/stub-cache-ia32.cc File src/ia32/stub-cache-ia32.cc (right): http://codereview.chromium.org/6303012/diff/42002/src/ia32/stub-cache-ia32.cc#newcode3590 src/ia32/stub-cache-ia32.cc:3590: __ jmp(&slow); This jmp is not needed.
9 years, 11 months ago (2011-01-21 08:20:29 UTC) #5
Ken Russell (switch to Gerrit)
9 years, 11 months ago (2011-01-22 00:00:35 UTC) #6
On 2011/01/21 08:20:29, Erik Corry wrote:
>
http://codereview.chromium.org/6303012/diff/42002/src/ia32/stub-cache-ia32.cc...
> src/ia32/stub-cache-ia32.cc:3590: __ jmp(&slow);
> This jmp is not needed.

Removed in committed version.

Powered by Google App Engine
This is Rietveld 408576698