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

Issue 7628017: Add roundsd instruction to ia32 and use it in optimized Math.floor. (Closed)

Created:
9 years, 4 months ago by fschneider
Modified:
9 years, 4 months ago
Reviewers:
Sven Panne
CC:
v8-dev
Visibility:
Public.

Description

Add roundsd instruction to ia32 and use it in optimized Math.floor. It is available platforms that have SSE 4.1 and allows us to handle negative numbers without deoptimization. Before we would deoptimize on negative inputs to Math.floor. x64 already uses this instruction. * Change Math.floor unit test to make sure every test case gets optimized by changing the source code for each test case. * Fix HIR debug printing for some instructions. Committed: http://code.google.com/p/v8/source/detail?r=8921

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -30 lines) Patch
M src/hydrogen-instructions.h View 3 chunks +6 lines, -0 lines 0 comments Download
M src/hydrogen-instructions.cc View 2 chunks +20 lines, -0 lines 0 comments Download
M src/ia32/assembler-ia32.h View 1 chunk +10 lines, -0 lines 0 comments Download
M src/ia32/assembler-ia32.cc View 1 chunk +12 lines, -0 lines 0 comments Download
M src/ia32/disasm-ia32.cc View 1 1 chunk +11 lines, -1 line 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 chunk +0 lines, -1 line 1 comment Download
M src/ia32/lithium-codegen-ia32.cc View 2 chunks +42 lines, -25 lines 1 comment Download
M test/mjsunit/math-floor.js View 1 chunk +4 lines, -3 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
fschneider
9 years, 4 months ago (2011-08-12 09:02:49 UTC) #1
Sven Panne
9 years, 4 months ago (2011-08-12 09:41:40 UTC) #2
LGTM if the -0 handling is really needed (a short comment why would be good
then).

General remark: The spec states "The value of Math.ceil(x) is the same as the
value of -Math.floor(-x).", so can we do something similar there?

http://codereview.chromium.org/7628017/diff/4002/src/ia32/full-codegen-ia32.cc
File src/ia32/full-codegen-ia32.cc (left):

http://codereview.chromium.org/7628017/diff/4002/src/ia32/full-codegen-ia32.c...
src/ia32/full-codegen-ia32.cc:3833: // TODO(svenpanne): Allowing format strings
in Comment would be nice here...
Not really related to the current patch, but I guess we can remove this TODO,
anyway... ;-)

http://codereview.chromium.org/7628017/diff/4002/src/ia32/lithium-codegen-ia3...
File src/ia32/lithium-codegen-ia32.cc (right):

http://codereview.chromium.org/7628017/diff/4002/src/ia32/lithium-codegen-ia3...
src/ia32/lithium-codegen-ia32.cc:2720: // Deoptimize on negative zero.
Why do we have to deoptimize on -0 when using roundsd?

Powered by Google App Engine
This is Rietveld 408576698