summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/builtins-ppc-altivec.c
diff options
context:
space:
mode:
authorKit Barton <kbarton@ca.ibm.com>2016-03-09 19:28:31 +0000
committerKit Barton <kbarton@ca.ibm.com>2016-03-09 19:28:31 +0000
commitfbab158767932208ee6e360c455b2dd9249c31a8 (patch)
treed592cbe8949ef27a4ec59b6391a9dd19602f552a /clang/test/CodeGen/builtins-ppc-altivec.c
parent206ba844135e0462661371bb8bcf6652f4e360e9 (diff)
downloadbcm5719-llvm-fbab158767932208ee6e360c455b2dd9249c31a8.tar.gz
bcm5719-llvm-fbab158767932208ee6e360c455b2dd9249c31a8.zip
[PPC] FE support for generating VSX [negated] absolute value instructions
Includes new built-in, conversion of built-in to target-independent intrinsic and update in the header file. Tests are also updated. There is a second part in the backend for which I will post a separate code-review. BACKEND PART SHOULD BE COMMITTED FIRST. Phabricator: http://reviews.llvm.org/D17816 llvm-svn: 263051
Diffstat (limited to 'clang/test/CodeGen/builtins-ppc-altivec.c')
-rw-r--r--clang/test/CodeGen/builtins-ppc-altivec.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/clang/test/CodeGen/builtins-ppc-altivec.c b/clang/test/CodeGen/builtins-ppc-altivec.c
index 9539d6ca7af..f9e0584ad05 100644
--- a/clang/test/CodeGen/builtins-ppc-altivec.c
+++ b/clang/test/CodeGen/builtins-ppc-altivec.c
@@ -1,7 +1,13 @@
// REQUIRES: powerpc-registered-target
-// RUN: %clang_cc1 -faltivec -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s
-// RUN: %clang_cc1 -faltivec -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
-// RUN: %clang_cc1 -faltivec -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=CHECK-LE
+// RUN: %clang_cc1 -faltivec -triple powerpc-unknown-unknown -emit-llvm %s \
+// RUN: -o - | FileCheck %s
+// RUN: %clang_cc1 -faltivec -triple powerpc64-unknown-unknown -emit-llvm %s \
+// RUN: -o - | FileCheck %s
+// RUN: %clang_cc1 -faltivec -triple powerpc64le-unknown-unknown -emit-llvm %s \
+// RUN: -o - | FileCheck %s -check-prefix=CHECK-LE
+// RUN: not %clang_cc1 -triple powerpc64le-unknown-unknown -emit-llvm %s \
+// RUN: -ferror-limit 0 -o - 2>&1 \
+// RUN: | FileCheck %s -check-prefix=CHECK-NOALTIVEC
vector bool char vbc = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 };
vector signed char vsc = { 1, -2, 3, -4, 5, -6, 7, -8, 9, -10, 11, -12, 13, -14, 15, -16 };
@@ -27,6 +33,8 @@ vector int res_vi;
vector unsigned int res_vui;
vector float res_vf;
+// CHECK-NOALTIVEC: error: unknown type name 'vector'
+
signed char param_sc;
unsigned char param_uc;
short param_s;
@@ -66,8 +74,16 @@ void test1() {
// CHECK-LE: @llvm.ppc.altivec.vmaxsw
vf = vec_abs(vf);
-// CHECK: and <4 x i32>
-// CHECK-LE: and <4 x i32>
+// CHECK: bitcast <4 x float> %{{.*}} to <4 x i32>
+// CHECK: and <4 x i32> {{.*}}, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
+// CHECK: bitcast <4 x i32> %{{.*}} to <4 x float>
+// CHECK: store <4 x float> %{{.*}}, <4 x float>* @vf
+// CHECK-LE: bitcast <4 x float> %{{.*}} to <4 x i32>
+// CHECK-LE: and <4 x i32> {{.*}}, <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>
+// CHECK-LE: bitcast <4 x i32> %{{.*}} to <4 x float>
+// CHECK-LE: store <4 x float> %{{.*}}, <4 x float>* @vf
+// CHECK-NOALTIVEC: error: use of undeclared identifier 'vf'
+// CHECK-NOALTIVEC: vf = vec_abs(vf)
/* vec_abs */
vsc = vec_abss(vsc);
OpenPOWER on IntegriCloud