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

Issue 597059: Added optimization for div/mod by constant power of 2. (Closed)

Created:
10 years, 10 months ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Added optimization for div/mod by constant power of 2.

Patch Set 1 #

Patch Set 2 : Moved div code, removed mod code, only div by 2. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -1 line) Patch
M src/ia32/codegen-ia32.cc View 1 1 chunk +33 lines, -0 lines 1 comment Download
M test/mjsunit/div-mod.js View 1 chunk +15 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Lasse Reichstein
Small review, please.
10 years, 10 months ago (2010-02-12 11:50:29 UTC) #1
fschneider
Drive-by comment: It seems there is already an optimization for MOD power-of-2 in CodeGenerator::ConstantSmiOperation. You ...
10 years, 10 months ago (2010-02-12 12:39:57 UTC) #2
Kevin Millikin (Chromium)
LGTM.
10 years, 10 months ago (2010-02-12 13:32:26 UTC) #3
William Hesse
10 years, 7 months ago (2010-05-10 14:10:43 UTC) #4
Just an idea, on division by a power of 2.

http://codereview.chromium.org/597059/diff/4001/4002
File src/ia32/codegen-ia32.cc (right):

http://codereview.chromium.org/597059/diff/4001/4002#newcode1854
src/ia32/codegen-ia32.cc:1854: frame_->Spill(operand->reg());
If we know that we are in a to-int32 context, where the result will be converted
to int32, then we should be able to handle odd numbers divided by 2!

Powered by Google App Engine
This is Rietveld 408576698