OSDN Git Service

Add the ARM32 FP register table entries, simple arith, and args.
authorJan Voung <jvoung@chromium.org>
Sun, 9 Aug 2015 14:58:35 +0000 (07:58 -0700)
committerJan Voung <jvoung@chromium.org>
Sun, 9 Aug 2015 14:58:35 +0000 (07:58 -0700)
commit86ebec12680b5268fcb7082f770a26394e8b8080
tree9176cacbdcf401c69792c101201406d25a4a5d08
parentf4fbf7fdff5a40c54a932073209ae9c224d729e3
Add the ARM32 FP register table entries, simple arith, and args.

Lower some instructions, without much guarantee of
correctness. *Running* generated code will be risky
because the register allocator isn't aware of register
aliasing.

Fill in v{add,div,mul,sub}.f{32,64}, vmov, vldr
and vsqrt.f{32,64}. I tried to make the nacl-other-intrinsics
test not explode, so added vsqrt too. That was pretty
easy for sqrt, but then fabs tests also exploded. Those are not
truly fixed but are currently "fixed" by adding a FakeDef to
satisfy liveness.

Propagate float/double arguments to the right register
in lowerArguments, lowerCall, and propagate to s0/d0/q0
for lowerReturn. May need to double check the calling convention.
Currently can't test call-ret because vpush/vpop for prologues
and epilogues isn't done.

Legalize FP immediates to make the nacl-other-intrinsics sqrt
test happy. Use the correct type of load (vldr (.32 and .64 are
optional) instead of ldr{b,h,,d}).

Whether or not the float/vector instructions can be
predicated is a bit interesting. The float/double ones
can, but the SIMD versions cannot. E.g.

vadd<cond>.f32 s0, s0, s1 is okay
vadd<cond>.f32 q0, q0, q1 is not okay.

For now, just omit conditions from instructions that may
end up being reused for SIMD.

Split up the fp.pnacl.ll test into multiple ones so that
parts of lowering can be tested incrementally.

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

Review URL: https://codereview.chromium.org/1266263003 .
13 files changed:
src/IceInstARM32.cpp
src/IceInstARM32.def
src/IceInstARM32.h
src/IceRegistersARM32.h
src/IceTargetLoweringARM32.cpp
src/IceTargetLoweringARM32.h
tests_lit/llvm2ice_tests/fp.arith.ll [new file with mode: 0644]
tests_lit/llvm2ice_tests/fp.call_ret.ll [new file with mode: 0644]
tests_lit/llvm2ice_tests/fp.cmp.ll [new file with mode: 0644]
tests_lit/llvm2ice_tests/fp.convert.ll [new file with mode: 0644]
tests_lit/llvm2ice_tests/fp.load_store.ll [new file with mode: 0644]
tests_lit/llvm2ice_tests/fp.pnacl.ll [deleted file]
tests_lit/llvm2ice_tests/nacl-other-intrinsics.ll