blob: b825d55633129fa7db22c2e89c9a36f08a2938bd [file] [log] [blame]
Benjamin Kramerc7962452017-05-30 11:37:29 +00001// RUN: %clang_cc1 -triple powerpc64le-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature +vsx | FileCheck %s -check-prefix=CHECK -check-prefix=VSX
2// RUN: %clang_cc1 -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature -vsx | FileCheck %s
3
4#include <altivec.h>
5
6// CHECK-LABEL: test1
7// CHECK: vcfsx
8vector float test1(vector int x) {
9 return vec_ctf(x, 0);
10}
11
12// CHECK-LABEL: test2
13// CHECK: vcfux
14vector float test2(vector unsigned int x) {
15 return vec_ctf(x, 0);
16}
17
18#ifdef __VSX__
19// VSX-LABEL: test3
20vector double test3(vector signed long long x) {
21 return vec_ctf(x, 0);
22}
23
24// VSX-LABEL: test4
25vector double test4(vector unsigned long long x) {
26 return vec_ctf(x, 0);
27}
28#endif
29
30// CHECK-LABEL: test5
31// CHECK: vcfsx
32vector float test5(vector int x) {
33 return vec_vcfsx(x, 0);
34}
35
36// CHECK-LABEL: test6
37// CHECK: vcfux
38vector float test6(vector unsigned int x) {
39 return vec_vcfux(x, 0);
40}
41
42// CHECK-LABEL: test7
43// CHECK: vctsxs
44vector int test7(vector float x) {
45 return vec_cts(x, 0);
46}
47
48#ifdef __VSX__
49// VSX-LABEL: test8
50vector signed long long test8(vector double x) {
51 return vec_cts(x, 0);
52}
53
54#endif
55
56// CHECK-LABEL: test9
57// CHECK: vctsxs
58vector int test9(vector float x) {
59 return vec_vctsxs(x, 0);
60}
61
62// CHECK-LABEL: test10
63// CHECK: vctuxs
64vector unsigned test10(vector float x) {
65 return vec_ctu(x, 0);
66}
67
68#ifdef __VSX__
69// VSX-LABEL: test11
70vector unsigned long long test11(vector double x) {
71 return vec_ctu(x, 0);
72}
73
74#endif
75
76// CHECK-LABEL: test12
77// CHECK: vctuxs
78vector unsigned test12(vector float x) {
79 return vec_vctuxs(x, 0);
80}