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

Issue 506052: Optimize bitops with non-Smi inputs. Instead of converting both inputs... (Closed)

Created:
11 years ago by Erik Corry
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein, sra1
CC:
v8-dev
Visibility:
Public.

Description

Optimize bitops with non-Smi inputs. Instead of converting both inputs to floating point and then converting back we convert directly to a 32 bit integer. In addition the bit twiddling implementation of float- to-integer conversion has been ported from ARM. Testing has shown that this runs faster than the x87 or SSE3 rounding instructions. This change is IA32 only. There may be a smaller benefit from doing the same on x64. Committed: http://code.google.com/p/v8/source/detail?r=3492

Patch Set 1 #

Total comments: 16
Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -55 lines) Patch
M src/codegen.h View 1 chunk +3 lines, -1 line 0 comments Download
M src/ia32/codegen-ia32.cc View 6 chunks +168 lines, -54 lines 16 comments Download

Messages

Total messages: 5 (0 generated)
Erik Corry
11 years ago (2009-12-17 13:52:30 UTC) #1
Lasse Reichstein
Not done. Looks good so far http://codereview.chromium.org/506052/diff/1/2 File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/506052/diff/1/2#newcode7172 src/ia32/codegen-ia32.cc:7172: __ mov(ecx, Immediate(0)); ...
11 years ago (2009-12-17 16:35:50 UTC) #2
Lasse Reichstein
LGTM http://codereview.chromium.org/506052/diff/1/2 File src/ia32/codegen-ia32.cc (right): http://codereview.chromium.org/506052/diff/1/2#newcode7267 src/ia32/codegen-ia32.cc:7267: But there wasn't much more, I can see ...
11 years ago (2009-12-18 08:06:45 UTC) #3
sra1
I do find that the bit-twiddling is faster to be surprising. How much of the ...
11 years ago (2009-12-18 08:30:21 UTC) #4
Erik Corry
11 years ago (2009-12-18 09:33:36 UTC) #5
Everything else fixed.

http://codereview.chromium.org/506052/diff/1/2
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/506052/diff/1/2#newcode7232
src/ia32/codegen-ia32.cc:7232: __ sub(ecx, Operand(scratch2));
On 2009/12/17 16:35:50, Lasse Reichstein wrote:
> Complex rewrite: If you make ecx one larger here (loading immediate 31), and
> then below increase shift_distance by one as well to shift out the sign bit
out,
> then the shr_cl further down will shift in a zero sign bit. This allows you to
> drop the and_ with kMantissaMask.
> (I think.)

Nice idea, but it ruins the fast case for zero shift or zero answer, so I don't
think it's worth it.

Powered by Google App Engine
This is Rietveld 408576698