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

Issue 155047: ARM improvements to constant div, mod and mul.... (Closed)

Created:
11 years, 5 months ago by Erik Corry
Modified:
9 years, 7 months ago
Reviewers:
William Hesse
CC:
v8-dev
Visibility:
Public.

Description

ARM improvements to constant div, mod and mul. * Fast runtime calls for div and mod. * Fix assembly and disassembly of multiply instructions. * Strength reduce and inline multiplications to shift-add. * Strength reduce and inline mod by power of 2. * Strength reduce mod by other small integers to mul. * Strength reduce div by 2 and 3. Committed: http://code.google.com/p/v8/source/detail?r=2355

Patch Set 1 #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+580 lines, -142 lines) Patch
M src/arm/assembler-arm.cc View 2 chunks +2 lines, -1 line 0 comments Download
M src/arm/codegen-arm.h View 2 chunks +5 lines, -1 line 0 comments Download
M src/arm/codegen-arm.cc View 16 chunks +376 lines, -82 lines 11 comments Download
M src/arm/disasm-arm.cc View 2 chunks +20 lines, -3 lines 0 comments Download
M src/arm/simulator-arm.cc View 1 chunk +15 lines, -12 lines 0 comments Download
M src/assembler.cc View 2 chunks +16 lines, -0 lines 0 comments Download
M src/serialize.cc View 1 chunk +9 lines, -1 line 0 comments Download
A test/mjsunit/div-mod.js View 1 chunk +95 lines, -0 lines 0 comments Download
M test/mjsunit/smi-negative-zero.js View 1 chunk +42 lines, -42 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Erik Corry
11 years, 5 months ago (2009-07-03 10:28:24 UTC) #1
William Hesse
LGTM, with comments. http://codereview.chromium.org/155047/diff/1/8 File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/155047/diff/1/8#newcode779 Line 779: PrintF("GenericBinaryOpStub (%s)\n", Token::String(op_)); Why not ...
11 years, 5 months ago (2009-07-03 11:27:01 UTC) #2
Erik Corry
11 years, 5 months ago (2009-07-03 17:43:38 UTC) #3
http://codereview.chromium.org/155047/diff/1/8
File src/arm/codegen-arm.cc (right):

http://codereview.chromium.org/155047/diff/1/8#newcode779
Line 779: PrintF("GenericBinaryOpStub (%s)\n", Token::String(op_));
On 2009/07/03 11:27:01, William Hesse wrote:
> Why not make this message more informative, by including known_rhs_?

Oops, that is what I was trying to do, but I got the sense of the 'if' wrong.

http://codereview.chromium.org/155047/diff/1/8#newcode792
Line 792: int known_rhs) {
On 2009/07/03 11:27:01, William Hesse wrote:
> Would "constant_rhs" be a better name than "known_rhs"?

Probably

http://codereview.chromium.org/155047/diff/1/8#newcode925
Line 925: if (popcnt > 2) return false;
On 2009/07/03 11:27:01, William Hesse wrote:
> The whole function can be replaced by:
> x &= x - 1;
> return (x & (x-1)) != 0;

Cool

http://codereview.chromium.org/155047/diff/1/8#newcode1045
Line 1045: case Token::SHL: {
On 2009/07/03 11:27:01, William Hesse wrote:
> Why no check of shift_value with 0 for SHL?  If it is ok, comment it.

Shift left by zero is the way reg-reg mov is encoded.  Section A5.1.4 in the
reference manual.  But since that would make this instruction a NOP I will not
emit it.

http://codereview.chromium.org/155047/diff/1/8#newcode5477
Line 5477: __ mov(destination, Operand(destination, LSL, first_bit));
On 2009/07/03 11:27:01, William Hesse wrote:
> Are you going to find out if the value overflowed from the flags?  Will they
be
> set right from this combination of add and move?

No, the flags are not set by this routine.  Comment added.  You have to check
that the result will not overflow beforehand.

Powered by Google App Engine
This is Rietveld 408576698