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

Issue 9177001: Optimize simple constant cases for bitwise &, | and ^. (Closed)

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

Description

Optimize simple constant cases for bitwise &, | and ^. For integer bitwise operations we can replace x & -1 with x, x | 0 with x and x ^ 0 with x. Committed: http://code.google.com/p/v8/source/detail?r=10382

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 4

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -0 lines) Patch
M src/hydrogen-instructions.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/hydrogen-instructions.cc View 1 2 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
fschneider
8 years, 11 months ago (2012-01-11 09:23:57 UTC) #1
Sven Panne
LGTM with 2 nits... http://codereview.chromium.org/9177001/diff/4001/src/hydrogen-instructions.cc File src/hydrogen-instructions.cc (right): http://codereview.chromium.org/9177001/diff/4001/src/hydrogen-instructions.cc#newcode793 src/hydrogen-instructions.cc:793: if (op() == Token::BIT_XOR) return ...
8 years, 11 months ago (2012-01-11 09:54:03 UTC) #2
fschneider
8 years, 11 months ago (2012-01-11 10:00:30 UTC) #3
http://codereview.chromium.org/9177001/diff/4001/src/hydrogen-instructions.cc
File src/hydrogen-instructions.cc (right):

http://codereview.chromium.org/9177001/diff/4001/src/hydrogen-instructions.cc...
src/hydrogen-instructions.cc:793: if (op() == Token::BIT_XOR) return this;
On 2012/01/11 09:54:03, Sven wrote:
> I don't think we need this special case, because 'x ^ 0 == x', just like 'x |
0
> == x'.

Done.

http://codereview.chromium.org/9177001/diff/4001/src/hydrogen-instructions.cc...
src/hydrogen-instructions.cc:795: int nop_constant = (op() == Token::BIT_AND) ?
-1 : 0;
On 2012/01/11 09:54:03, Sven wrote:
> Use int32_t, not int.

Done.

Powered by Google App Engine
This is Rietveld 408576698