]> granicus.if.org Git - clang/commit
[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)
commit2691f6c129db1b244c08d3b6901b0bbaea6aa68d
tree1e437dd3a864a5ee6b30880eeb4dcc4ae24a3097
parentff0a7503ad24b069eae08a90a06a99a6048bb5e3
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214801 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Headers/altivec.h
test/CodeGen/builtins-ppc-altivec.c