diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2014-06-09 03:31:47 +0000 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2014-06-09 03:31:47 +0000 |
commit | 7f6596bb13e85cd11f16c997c9aa62ad5a09376f (patch) | |
tree | d5bc1af04832f8d121d559feae48af93b5d34967 /clang/test/CodeGen/builtins-ppc-altivec.c | |
parent | 4b56692e3032a41e3a172905ff9407649cba004e (diff) | |
download | bcm5719-llvm-7f6596bb13e85cd11f16c997c9aa62ad5a09376f.tar.gz bcm5719-llvm-7f6596bb13e85cd11f16c997c9aa62ad5a09376f.zip |
[PPC64LE] Implement little-endian semantics for vec_sums
The PowerPC vsumsws instruction, accessed via vec_sums, is defined
architecturally with a big-endian bias, in that the second input vector
and the result always reference big-endian element 3 (little-endian
element 0). For ease of porting, the programmer wants elements 3 in
both cases.
To provide this semantics, for little endian we generate a permute for
the second input vector prior to the vsumsws instruction, and generate
a permute for the result vector following the vsumsws instruction.
The correctness of this code is tested by the new sums.c test added in
a previous patch, as well as the modifications to
builtins-ppc-altivec.c in the present patch.
llvm-svn: 210449
Diffstat (limited to 'clang/test/CodeGen/builtins-ppc-altivec.c')
-rw-r--r-- | clang/test/CodeGen/builtins-ppc-altivec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtins-ppc-altivec.c b/clang/test/CodeGen/builtins-ppc-altivec.c index 8277f5dda7d..c94656e6b5e 100644 --- a/clang/test/CodeGen/builtins-ppc-altivec.c +++ b/clang/test/CodeGen/builtins-ppc-altivec.c @@ -5155,11 +5155,15 @@ void test6() { /* vec_sums */ res_vi = vec_sums(vi, vi); // CHECK: @llvm.ppc.altivec.vsumsws +// CHECK-LE: @llvm.ppc.altivec.vperm // CHECK-LE: @llvm.ppc.altivec.vsumsws +// CHECK-LE: @llvm.ppc.altivec.vperm res_vi = vec_vsumsws(vi, vi); // CHECK: @llvm.ppc.altivec.vsumsws +// CHECK-LE: @llvm.ppc.altivec.vperm // CHECK-LE: @llvm.ppc.altivec.vsumsws +// CHECK-LE: @llvm.ppc.altivec.vperm /* vec_trunc */ res_vf = vec_trunc(vf); |