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

Issue 67163: Avoid a call to the runtime system when doing binary fp ops on ARM... (Closed)

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

Description

Avoid a call to the runtime system when doing binary fp ops on ARM (at the moment only if we do not need to allocate a heap number). Find a few more oportunities to avoid heap number allocation on IA32. Add some infrastructure to test coverage of generated ARM code in our tests. Committed: http://code.google.com/p/v8/source/detail?r=1720

Patch Set 1 #

Total comments: 20

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+529 lines, -130 lines) Patch
M src/assembler.h View 1 2 chunks +3 lines, -0 lines 0 comments Download
M src/assembler.cc View 1 1 chunk +36 lines, -0 lines 0 comments Download
M src/builtins-arm.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M src/codegen.h View 1 chunk +5 lines, -0 lines 0 comments Download
M src/codegen-arm.h View 2 chunks +5 lines, -5 lines 0 comments Download
M src/codegen-arm.cc View 1 28 chunks +212 lines, -93 lines 0 comments Download
M src/codegen-ia32.h View 1 2 chunks +1 line, -4 lines 0 comments Download
M src/codegen-ia32.cc View 2 chunks +6 lines, -1 line 0 comments Download
M src/constants-arm.h View 1 chunk +6 lines, -1 line 0 comments Download
M src/debug-arm.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/disasm-arm.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/globals.h View 1 chunk +10 lines, -0 lines 0 comments Download
M src/ic-arm.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M src/macro-assembler-arm.h View 1 chunk +1 line, -1 line 0 comments Download
M src/macro-assembler-arm.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M src/runtime.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/serialize.cc View 1 1 chunk +12 lines, -0 lines 0 comments Download
M src/simulator-arm.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M src/simulator-arm.cc View 1 5 chunks +90 lines, -1 line 0 comments Download
M src/stub-cache-arm.cc View 7 chunks +7 lines, -8 lines 0 comments Download
M src/virtual-frame-arm.cc View 1 chunk +2 lines, -1 line 0 comments Download
M test/mjsunit/negate.js View 1 chunk +3 lines, -3 lines 0 comments Download
M test/mjsunit/number-limits.js View 1 1 chunk +8 lines, -4 lines 0 comments Download
M test/mjsunit/smi-ops.js View 1 chunk +95 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Erik Corry
11 years, 8 months ago (2009-04-15 07:09:56 UTC) #1
Kasper Lund
LG. I hope we have good coverage of the generated code. You should try sprinkling ...
11 years, 8 months ago (2009-04-15 07:40:36 UTC) #2
Kevin Millikin (Chromium)
http://codereview.chromium.org/67163/diff/1/11 File src/codegen-arm.cc (right): http://codereview.chromium.org/67163/diff/1/11#newcode688 Line 688: // Minor key encoding in 16 bits FOOOOOOOOOOOOOMM. ...
11 years, 8 months ago (2009-04-15 08:01:04 UTC) #3
iposva
11 years, 8 months ago (2009-04-15 23:25:21 UTC) #4
Comments from the side to help cleanup the code...

-Ivan

http://codereview.chromium.org/67163/diff/1/11
File src/codegen-arm.cc (right):

http://codereview.chromium.org/67163/diff/1/11#newcode4550
Line 4550: __ ldr(r2, MemOperand(r0, HeapNumber::kValueOffset -
kHeapObjectTag));
On 2009/04/15 08:01:04, Kevin Millikin wrote:
> On IA32 there is a FieldOperand abstraction (in macro-assembler-ia32.h) that
> does the subtract kHeapObjectTag thing.  You might consider the same for ARm
and
> using it here.  

There is a FieldMemOperand(Register object, int offset) in
macro-assembler-arm.cc which should be used here and in many other places in
this new code.

http://codereview.chromium.org/67163/diff/1/9
File src/simulator-arm.cc (right):

http://codereview.chromium.org/67163/diff/1/9#newcode435
Line 435: sixty_four_bits[0] = registers_[0];
There is an accessor for this: get_register(r0)

http://codereview.chromium.org/67163/diff/1/9#newcode438
Line 438: memcpy(x, buffer, sizeof(sixty_four_bits));
Can you please explain why you copy registers->sixty_four_bits->buffer->x?
This seems a very round-about way of doing something like this:
int32_t* xpointer = reinterpret_cast<int32_t>(x);
xpointer[0] = registers_[0];
xpointer[1] = registers_[1];

If this does not work, then please explain in comments exactly why these
multiple steps are necessary.

http://codereview.chromium.org/67163/diff/1/9#newcode451
Line 451: registers_[0] = sixty_four_bits[0];
There is an accessor for this: set_register(r0, value).

http://codereview.chromium.org/67163/diff/1/9#newcode452
Line 452: registers_[1] = sixty_four_bits[1];
Again multiple copies. Why?

http://codereview.chromium.org/67163/diff/1/9#newcode456
Line 456: void Simulator::TrashCalleeSaveRegisters() {
You probably mean to trash the CallerSaved registers. CalleeSavedRegisters
should be preserved across the call and not trashed.

Also this method seems to be not used. How about just removing it for now?

http://codereview.chromium.org/67163/diff/1/9#newcode936
Line 936: GetFpArgs(&x, &y);
How about making the Simulator API a bit more generic?
x = GetDoubleValue(r0, r1);
y = GetDoubleValue(r2, r3);

http://codereview.chromium.org/67163/diff/1/9#newcode937
Line 937: double z = (swi == simulator_fp_add) ?
On 2009/04/15 07:40:36, Kasper Lund wrote:
> This looks nasty. Why not write it as a series of if-else-if?

Yes, please!

Powered by Google App Engine
This is Rietveld 408576698