[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 4 Aug 2014 23:21:26 +0000 (23:21 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 4 Aug 2014 23:21:26 +0000 (23:21 +0000)
commitccbe0a802217d0a422177ebc4649cfab465426c0
tree887b5a43393f04d9db1899567fb2b09c60abc183
parentf04e998e00d6c71241c29b86c2fadfe0d1601e64
[PPC64LE] Fix wrong IR for vec_sld and vec_vsldoi

My original LE implementation of the vsldoi instruction, with its
altivec.h interfaces vec_sld and vec_vsldoi, produces incorrect
shufflevector operations in the LLVM IR.  Correct code is generated
because the back end handles the incorrect shufflevector in a
consistent manner.

This patch and a companion patch for LLVM correct this problem by
removing the fixup from altivec.h and the corresponding fixup from the
PowerPC back end.  Several test cases are also modified to reflect the
now-correct LLVM IR.

The vec_sums and vec_vsumsws interfaces in altivec.h are also fixed,
because they used vec_perm calls intended to be recognized as vsldoi
instructions.  These vec_perm calls are now replaced with code that
more clearly shows the intent of the transformation.

llvm-svn: 214801
clang/lib/Headers/altivec.h
clang/test/CodeGen/builtins-ppc-altivec.c