[PPC64LE] Generate correct little-endian code for v16i8 multiply
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 9 Jun 2014 16:06:29 +0000 (16:06 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 9 Jun 2014 16:06:29 +0000 (16:06 +0000)
commit4cef3fb022ddcd6d6d1f2f6894f3661f3000d022
tree79f6b697b598e9ab2171f20d165fd3ad6d903aa8
parent35d5a437ea159603bcbce903b05fff162415b68d
[PPC64LE] Generate correct little-endian code for v16i8 multiply

The existing code in PPCTargetLowering::LowerMUL() for multiplying two
v16i8 values assumes that vector elements are numbered in big-endian
order.  For little-endian targets, the vector element numbering is
reversed, but the vmuleub, vmuloub, and vperm instructions still
assume big-endian numbering.  To account for this, we must adjust the
permute control vector and reverse the order of the input registers on
the vperm instruction.

The existing test/CodeGen/PowerPC/vec_mul.ll is updated to be executed
on powerpc64 and powerpc64le targets as well as the original powerpc
(32-bit) target.

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