OSDN Git Service

Subzero ARM32: Lower shift and zext, sext, and trunc.
authorJan Voung <jvoung@chromium.org>
Fri, 5 Jun 2015 00:02:31 +0000 (17:02 -0700)
committerJan Voung <jvoung@chromium.org>
Fri, 5 Jun 2015 00:02:31 +0000 (17:02 -0700)
commit66c3d5ecf3b6a6ce3b3a63c85312777ecbacee24
tree65a34548cf440d3ef7e26ffe09222b570e0b74ba
parent03ffa5853606f11f470baa459ead04dfa1c06ec5
Subzero ARM32: Lower shift and zext, sext, and trunc.

Sext, etc. usually uses shifts (especially for i1 and i64)
so implement shift, then implement those casts.

Implement just enough of bitcast to handle accessing
global addresses (used by some tests). Otherwise,
most other bitcasts are from GPR to FP and FP regs
aren't modeled yet.

Generally following the GCC style for 64-bit shifts.
This takes advantage of the flexible second operand in a "orr",
and takes advantage of the shift-beyond bitwidth saturation.
LLVM is almost the same, but only seems to take advantage
on one side of the 32-bits, not the other side. Should really
get some of the execution tests running to test this behavior!

Fix InstARM32Str::dump(). Str doesn't have a Dest, so use Src.

BUG= https://code.google.com/p/nativeclient/issues/detail?id=4076
R=stichnot@chromium.org

Review URL: https://codereview.chromium.org/1143323013
src/IceInstARM32.cpp
src/IceInstARM32.h
src/IceTargetLoweringARM32.cpp
src/IceTargetLoweringARM32.h
tests_lit/llvm2ice_tests/64bit.pnacl.ll
tests_lit/llvm2ice_tests/convert.ll
tests_lit/llvm2ice_tests/shift.ll
tests_lit/llvm2ice_tests/test_i1.ll