[PowerPC] Handle VSX v2i64 SIGN_EXTEND_INREG
authorHal Finkel <hfinkel@anl.gov>
Sun, 30 Mar 2014 13:22:59 +0000 (13:22 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 30 Mar 2014 13:22:59 +0000 (13:22 +0000)
commitee8e48d4c9e834a05cea36bb83b2df6b718aaaa4
tree4d9dea3fa5a39fab5f38b6bede3cd3e5fabcaf91
parent368a97729890a878389a9995e426c1042947f37a
[PowerPC] Handle VSX v2i64 SIGN_EXTEND_INREG

sitofp from v2i32 to v2f64 ends up generating a SIGN_EXTEND_INREG v2i64 node
(and similarly for v2i16 and v2i8). Even though there are no sign-extension (or
algebraic shifts) for v2i64 types, we can handle v2i32 sign extensions by
converting two and from v2i64. The small trick necessary here is to shift the
i32 elements into the right lanes before the i32 -> f64 step. This is because
of the big Endian nature of the system, we need the i32 portion in the high
word of the i64 elements.

For v2i16 and v2i8 we can do the same, but we first use the default Altivec
shift-based expansion from v2i16 or v2i8 to v2i32 (by casting to v4i32) and
then apply the above procedure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205146 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCISelLowering.h
lib/Target/PowerPC/PPCInstrVSX.td
test/CodeGen/PowerPC/vsx.ll