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

Issue 6148007: Speed up FastAsciiArrayJoin on ia32 by improving hand-written assembly code. (Closed)

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

Description

Speed up FastAsciiArrayJoin on ia32 by improving hand-written assembly code. Committed: http://code.google.com/p/v8/source/detail?r=6310

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 14

Patch Set 4 : '' #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+456 lines, -296 lines) Patch
M src/ia32/codegen-ia32.cc View 1 2 3 2 chunks +204 lines, -115 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 2 chunks +201 lines, -117 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 2 3 1 chunk +7 lines, -16 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 2 3 1 chunk +44 lines, -48 lines 6 comments Download

Messages

Total messages: 5 (0 generated)
William Hesse
9 years, 11 months ago (2011-01-12 16:05:45 UTC) #1
Lasse Reichstein
LGTM. Have you considered doing the copying using rep movsb and compare the speed/size? http://codereview.chromium.org/6148007/diff/6001/src/ia32/full-codegen-ia32.cc ...
9 years, 11 months ago (2011-01-13 09:20:32 UTC) #2
William Hesse
Comments addressed, CopyBytes function factored out, and optimized. http://codereview.chromium.org/6148007/diff/6001/src/ia32/full-codegen-ia32.cc File src/ia32/full-codegen-ia32.cc (right): http://codereview.chromium.org/6148007/diff/6001/src/ia32/full-codegen-ia32.cc#newcode3359 src/ia32/full-codegen-ia32.cc:3359: loop_3b, ...
9 years, 11 months ago (2011-01-13 16:25:59 UTC) #3
Lasse Reichstein
LGTM http://codereview.chromium.org/6148007/diff/11001/src/ia32/macro-assembler-ia32.cc File src/ia32/macro-assembler-ia32.cc (right): http://codereview.chromium.org/6148007/diff/11001/src/ia32/macro-assembler-ia32.cc#newcode902 src/ia32/macro-assembler-ia32.cc:902: // Because destination is 4-byte aligned, we keep ...
9 years, 11 months ago (2011-01-14 10:47:37 UTC) #4
William Hesse
9 years, 11 months ago (2011-01-14 10:54:44 UTC) #5
http://codereview.chromium.org/6148007/diff/11001/src/ia32/macro-assembler-ia...
File src/ia32/macro-assembler-ia32.cc (right):

http://codereview.chromium.org/6148007/diff/11001/src/ia32/macro-assembler-ia...
src/ia32/macro-assembler-ia32.cc:902: // Because destination is 4-byte aligned,
we keep it aligned for movs.
On 2011/01/14 10:47:37, Lasse Reichstein wrote:
> How do we know that destination is 4-byte aligned?
> Do you mean "If destination is 4-byte aligned"?

In our uses, source is 4-byte aligned.
Changed comment.

http://codereview.chromium.org/6148007/diff/11001/src/ia32/macro-assembler-ia...
src/ia32/macro-assembler-ia32.cc:906: shr(ecx, 2);
Long rep.movs averages much less than a cycle per word.  This would save one
word only 1/4 of the time.  Not worth the extra code, I think.

On 2011/01/14 10:47:37, Lasse Reichstein wrote:
> If length was divisible by four, you will copy the last word twice.
> Subtract one from ecx before shifting, to copy one less word if (length & 3)
==
> 0, but not otherwise.

http://codereview.chromium.org/6148007/diff/11001/src/ia32/macro-assembler-ia...
src/ia32/macro-assembler-ia32.cc:921: dec(length);
I tried that - it was slower. On 2011/01/14 10:47:37, Lasse Reichstein wrote:
> This won't be faster if you do:
> 
>  add(source, length);
>  add(destination, length);
>  neg(length);
>  bind(&short_loop);
>  mov_b(scratch, Operand(source, ecx));
>  mov_b(Operand(destination, ecx), scratch);
>  inc(ecx);
>  j(not_zero, &short_loop);
> 
> (It's quite possible that it won't. There's probably lots of latency available
> during reading and writing for updating all three registers, and it's actually
> one instruction longer in total).

Powered by Google App Engine
This is Rietveld 408576698