Reviewers: danno, Jakob, Yang,
Message:
This patch is submitted on behalf of the whole Intel V8 X32 team (Chih-Ping
Chen, Dale Schouten, Haitao Feng, Peter Jensen and Weiliang Lin).
X32 uses all the Intel 64-bit CPU features with 32-bit address space.
Basically
X32 shares the same assembler with X64, so we ported V8 for X32 based on
the x64
port. Here are the differences from V8 implementation's point of view (from
major to minor):
1) Default operation is 32-bit. For example, most of the movq should be
movl
except moving a 64-bit value or double into registers.
2) No 32-bit push/pop in the long mode. So we simulated the 32-bit
Push/Pop
and implemented them in macro assembler.
3) PC return address is 64-bit, not kPointerSize (32-bit). There is no
32-bit
call in the long mode.
4) FP register is 64-bit as we want to keep the function prologue smaller.
5) 31-bit SMI is used as kPointerSize is 32. We implemented Int32 type for
X32.
6) 32-bit stack slot is needed between JS calls and 64-bit stack slot is
needed(reserved) from JS to C++ because of X32 calling conversion
(https://sites.google.com/site/x32abi/documents).
7) The stack slot in the regexp is 32-bit and we use movsxlq to sign
extend
them into 64-bit as rdi is used as index register in the SIB. We need to
keep
the signness of this register. We tried carefully to keep the signness of
the
register when it is used as index register.
8) call/jmp memory operand is not allowed as they will fetch 64-bit, not
32-bit from memory operand.
In the end, we worked out a solution to automatically generate the X32 port
code
from annotated x64 sources to deal with the above differences. The script is
tools/generate-x32-sources.py (the annotation is explained in the
comments), and
the annotated x64 codes are also uploaded so that you could easily see the
difference for our annotation or modification.
I rebased with master today and we got 100% pass with the release build,
and 3
fails (mjsunit/div-mod) with the debug build. I will get it solved during
you
are reviewing the patch. For the performance, on my X32 VM, X32 is on par
with
IA32 and 6% faster than X64. We could merge the multi Push/Pop sequences
and use
Immediate(Heap Object) instead of LoadRoot and get ~2% performance gain
from our
experience tuning X32 on the 3.9.24 branch. Those are left for future
enhancement (We could do that in the x32 generator also:)).
Here the performance data for your reference (all release build, snapshot
on):
[haitao@haitao-fedora17 benchmarks]$ ../out/x32.release/d8 ./run.js
Richards: 21813
DeltaBlue: 24060
Crypto: 21471
RayTrace: 24888
EarleyBoyer: 33071
RegExp: 4728
Splay: 9380
NavierStokes: 23002
----
Score (version 7): 17660
[haitao@haitao-fedora17 benchmarks]$ ../out/ia32.release/d8 ./run.js
Richards: 20256
DeltaBlue: 23624
Crypto: 20327
RayTrace: 27306
EarleyBoyer: 33314
RegExp: 4555
Splay: 9469
NavierStokes: 24807
----
Score (version 7): 17662
[haitao@haitao-fedora17 benchmarks]$ ../out/x64.release/d8 ./run.js
Richards: 19762
DeltaBlue: 21264
Crypto: 20371
RayTrace: 21608
EarleyBoyer: 28453
RegExp: 4672
Splay: 7913
NavierStokes: 23993
----
Score (version 7): 16167
My host CPU is "Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz", X32 is significant
slow on Raytrace, the reason is not investigated.
We'd like to thanks H.J. Lu for his help and guidance when we are working on
this project.
Finally, I commit I will keep this port 100% pass if you accept it. I am
willing
to listen your idea on the best approach to maintain this port.
Description:
Add X32 port into V8
Please review this at https://codereview.chromium.org/18014003/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M Makefile
M build/common.gypi
M src/assembler.cc
M src/code-stubs.h
M src/codegen.h
M src/deoptimizer.cc
M src/frames-inl.h
M src/frames.h
M src/frames.cc
M src/full-codegen.h
M src/full-codegen.cc
M src/gdb-jit.cc
M src/globals.h
M src/heap.cc
M src/hydrogen-instructions.cc
M src/hydrogen.cc
M src/jsregexp.cc
M src/lithium-allocator-inl.h
M src/lithium-allocator.cc
M src/lithium.cc
M src/log.cc
M src/macro-assembler.h
M src/platform-posix.cc
M src/regexp-macro-assembler.h
M src/runtime.cc
M src/simulator.h
M src/v8utils.h
A src/x32/assembler-x32-inl.h
A src/x32/assembler-x32.h
A src/x32/assembler-x32.cc
A src/x32/builtins-x32.cc
A src/x32/code-stubs-x32.h
A src/x32/code-stubs-x32.cc
A src/x32/codegen-x32.h
A src/x32/codegen-x32.cc
A src/x32/cpu-x32.cc
A src/x32/debug-x32.cc
A src/x32/deoptimizer-x32.cc
A src/x32/disasm-x32.cc
A src/x32/frames-x32.h
A src/x32/frames-x32.cc
A src/x32/full-codegen-x32.cc
A src/x32/ic-x32.cc
A src/x32/lithium-codegen-x32.h
A src/x32/lithium-codegen-x32.cc
A src/x32/lithium-gap-resolver-x32.h
A src/x32/lithium-gap-resolver-x32.cc
A src/x32/lithium-x32.h
A src/x32/lithium-x32.cc
A src/x32/macro-assembler-x32.h
A src/x32/macro-assembler-x32.cc
A src/x32/regexp-macro-assembler-x32.h
A src/x32/regexp-macro-assembler-x32.cc
A src/x32/simulator-x32.h
A src/x32/simulator-x32.cc
A src/x32/stub-cache-x32.cc
M src/x64/assembler-x64-inl.h
M src/x64/assembler-x64.h
M src/x64/assembler-x64.cc
M src/x64/builtins-x64.cc
M src/x64/code-stubs-x64.cc
M src/x64/codegen-x64.cc
M src/x64/debug-x64.cc
M src/x64/deoptimizer-x64.cc
M src/x64/disasm-x64.cc
M src/x64/frames-x64.h
M src/x64/full-codegen-x64.cc
M src/x64/ic-x64.cc
M src/x64/lithium-codegen-x64.h
M src/x64/lithium-codegen-x64.cc
M src/x64/lithium-x64.cc
M src/x64/macro-assembler-x64.h
M src/x64/macro-assembler-x64.cc
M src/x64/regexp-macro-assembler-x64.h
M src/x64/regexp-macro-assembler-x64.cc
M src/x64/stub-cache-x64.cc
M test/cctest/test-hashing.cc
M test/cctest/test-lockers.cc
M test/cctest/test-mark-compact.cc
M test/cctest/test-regexp.cc
A tools/generate-x32-sources.py
M tools/gyp/v8.gyp
M tools/run-tests.py
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.