[PowerPC 3/4] Little-endian adjustments for VSX vector shuffle
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 9 Dec 2014 16:52:29 +0000 (16:52 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Tue, 9 Dec 2014 16:52:29 +0000 (16:52 +0000)
commit9a2a305ed489f2cddfafbebbe280c3cfe7b835f0
tree8549085ec4a356e05eaa6c887aef0a307f7316fa
parentf214fe8b32b78d414838f85d6e758cfca0e5c234
[PowerPC 3/4] Little-endian adjustments for VSX vector shuffle

When performing instruction selection for ISD::VECTOR_SHUFFLE, there
is special code for handling v2f64 and v2i64 using VSX instructions.
This code must be adjusted for little-endian.  Because the two inputs
are treated as a double-wide register, we must swap their order for
little endian.  To get the appropriate mask elements to use with the
big-endian biased XXPERMDI instruction, we must reverse their order
and invert the bits.

A new test is added to test the 16 possible values of the shuffle
mask.  It is initially disabled for reasons specified in the test.  It
is re-enabled by patch 4/4.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223791 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
test/CodeGen/PowerPC/vsx_shuffle_le.ll [new file with mode: 0644]