[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 17 Oct 2014 15:13:38 +0000 (15:13 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Fri, 17 Oct 2014 15:13:38 +0000 (15:13 +0000)
commitb76f5ba1032418baefe3ea4dacc94cdb69c3c479
treea5ae38f64a2e81eb6659a8b15752a9ae67ac8798
parent7eee3b07b5e5ad758f8aa375f8051468dc84f328
[PowerPC] Enable use of lxvw4x/stxvw4x in VSX code generation

Currently the VSX support enables use of lxvd2x and stxvd2x for 2x64
types, but does not yet use lxvw4x and stxvw4x for 4x32 types.  This
patch adds that support.

As with lxvd2x/stxvd2x, this involves straightforward overriding of
the patterns normally recognized for lvx/stvx, with preference given
to the VSX patterns when VSX is enabled.

In addition, the logic for permitting misaligned memory accesses is
modified so that v4r32 and v4i32 are treated the same as v2f64 and
v2i64 when VSX is enabled.  Finally, the DAG generation for unaligned
loads is changed to just use a normal LOAD (which will become lxvw4x)
on P8 and later hardware, where unaligned loads are preferred over
lvsl/lvx/lvx/vperm.

A number of tests now generate the VSX loads/stores instead of
lvx/stvx, so this patch adds VSX variants to those tests.  I've also
added <4 x float> tests to the vsx.ll test case, and created a
vsx-p8.ll test case to be used for testing code generation for the
P8Vector feature.  For now, that simply tests the unaligned load/store
behavior.

This has been tested along with a temporary patch to enable the VSX
and P8Vector features, with no new regressions encountered with or
without the temporary patch applied.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220047 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCISelLowering.cpp
lib/Target/PowerPC/PPCInstrVSX.td
test/CodeGen/PowerPC/unal4-std.ll
test/CodeGen/PowerPC/unaligned.ll
test/CodeGen/PowerPC/vec-abi-align.ll
test/CodeGen/PowerPC/vec_misaligned.ll
test/CodeGen/PowerPC/vrspill.ll
test/CodeGen/PowerPC/vsx-p8.ll [new file with mode: 0644]
test/CodeGen/PowerPC/vsx.ll