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

Issue 6824074: X64: Tweak code generation slightly. (Closed)

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

Description

X64: Tweak code generation slightly. Uses a shorter opcode for movl and movb with immediates. Make movl preferable to movq in Set(register, int64_t) and use Set in more places. Committed: http://code.google.com/p/v8/source/detail?r=7589

Patch Set 1 #

Total comments: 12

Patch Set 2 : Addressed review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -50 lines) Patch
M src/x64/assembler-x64.cc View 4 chunks +19 lines, -10 lines 0 comments Download
M src/x64/builtins-x64.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 8 chunks +8 lines, -8 lines 0 comments Download
M src/x64/deoptimizer-x64.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/x64/disasm-x64.cc View 3 chunks +37 lines, -3 lines 0 comments Download
M src/x64/ic-x64.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 7 chunks +14 lines, -11 lines 0 comments Download
M src/x64/macro-assembler-x64.cc View 1 5 chunks +7 lines, -7 lines 0 comments Download
M src/x64/regexp-macro-assembler-x64.cc View 5 chunks +5 lines, -5 lines 0 comments Download
M src/x64/stub-cache-x64.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
9 years, 8 months ago (2011-04-12 11:50:00 UTC) #1
William Hesse
Only two comments about the correctness. All others are optimizations that you don't need to ...
9 years, 8 months ago (2011-04-12 13:04:59 UTC) #2
Lasse Reichstein
9 years, 8 months ago (2011-04-12 13:19:07 UTC) #3
http://codereview.chromium.org/6824074/diff/1/src/x64/code-stubs-x64.cc
File src/x64/code-stubs-x64.cc (right):

http://codereview.chromium.org/6824074/diff/1/src/x64/code-stubs-x64.cc#newco...
src/x64/code-stubs-x64.cc:1284: __ Set(r8, 0);
It can optimize xor better. The xorl is guaranteed to break dependencies, and it
also has a very short encoding. I don't think it can be optimized.
Also, I don't want to depend on the *value* of the smi constant register. I
really want to keep the door open for a different smi representation (even if it
might never happen).

http://codereview.chromium.org/6824074/diff/1/src/x64/code-stubs-x64.cc#newco...
src/x64/code-stubs-x64.cc:1461: __ Set(kScratchRegister, 0x01);
Unlikely to be faster, and definitely not shorter. This Set is five bytes, a
rol/xor/rdx with Imm8 is three bytes.

If anything, maybe I can try
  xorl(reg,reg);
  stc();
  rcr(1);
but it doesn't seem that great, with partial flag dependencies and slow
dependent operations.

http://codereview.chromium.org/6824074/diff/1/src/x64/code-stubs-x64.cc#newco...
src/x64/code-stubs-x64.cc:1466: __ movq(FieldOperand(rax,
HeapNumber::kValueOffset), rdx);
Again, I'd rather not depend on the value of the smi register for anything but
smi operations. Here it's a double operation.

http://codereview.chromium.org/6824074/diff/1/src/x64/lithium-codegen-x64.cc
File src/x64/lithium-codegen-x64.cc (right):

http://codereview.chromium.org/6824074/diff/1/src/x64/lithium-codegen-x64.cc#...
src/x64/lithium-codegen-x64.cc:2427: __ Set(result, scope()->num_parameters());
Ack. Will fix.

http://codereview.chromium.org/6824074/diff/1/src/x64/macro-assembler-x64.cc
File src/x64/macro-assembler-x64.cc (right):

http://codereview.chromium.org/6824074/diff/1/src/x64/macro-assembler-x64.cc#...
src/x64/macro-assembler-x64.cc:2005: movl(counter_operand, Immediate(value));
The counter is of type int*. I think this is actually a bug-fix.

http://codereview.chromium.org/6824074/diff/1/src/x64/macro-assembler-x64.cc#...
src/x64/macro-assembler-x64.cc:2223: Set(kScratchRegister, -kFrameAlignment);
Not really, -kFrameAlignment should be an imm8.
We should be able to do and_(rsp, Immediate(-kFrameAlignment)) directly.

Powered by Google App Engine
This is Rietveld 408576698