• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // REQUIRES: powerpc-registered-target
2 // RUN: %clang_cc1 -faltivec -target-feature +power8-vector \
3 // RUN: -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s
4 
5 // RUN: %clang_cc1 -faltivec -target-feature +power8-vector \
6 // RUN: -triple powerpc64le-unknown-unknown -emit-llvm %s -o - \
7 // RUN: | FileCheck %s -check-prefix=CHECK-LE
8 
9 // RUN: not %clang_cc1 -faltivec -triple powerpc-unknown-unknown \
10 // RUN: -emit-llvm %s -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PPC
11 
12 // CHECK-PPC: error: __int128 is not supported on this target
13 vector signed __int128 vlll = { -1 };
14 // CHECK-PPC: error: __int128 is not supported on this target
15 vector unsigned __int128 vulll = { 1 };
16 
17 // CHECK-PPC: error: __int128 is not supported on this target
18 vector signed __int128 res_vlll;
19 // CHECK-PPC: error: __int128 is not supported on this target
20 vector unsigned __int128 res_vulll;
21 
22 
23 // CHECK-LABEL: define void @test1
test1()24 void test1() {
25 
26   /* vec_add */
27   res_vlll = vec_add(vlll, vlll);
28 // CHECK: add <1 x i128>
29 // CHECK-LE: add <1 x i128>
30 // CHECK-PPC: error: call to 'vec_add' is ambiguous
31 
32   res_vulll = vec_add(vulll, vulll);
33 // CHECK: add <1 x i128>
34 // CHECK-LE: add <1 x i128>
35 // CHECK-PPC: error: call to 'vec_add' is ambiguous
36 
37   /* vec_vadduqm */
38   res_vlll = vec_vadduqm(vlll, vlll);
39 // CHECK: add <1 x i128>
40 // CHECK-LE: add <1 x i128>
41 // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int'
42 
43   res_vulll = vec_vadduqm(vulll, vulll);
44 // CHECK: add <1 x i128>
45 // CHECK-LE: add <1 x i128>
46 // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int'
47 
48   /* vec_vaddeuqm */
49   res_vlll = vec_vaddeuqm(vlll, vlll, vlll);
50 // CHECK: @llvm.ppc.altivec.vaddeuqm
51 // CHECK-LE: @llvm.ppc.altivec.vaddeuqm
52 // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int'
53 
54   res_vulll = vec_vaddeuqm(vulll, vulll, vulll);
55 // CHECK: @llvm.ppc.altivec.vaddeuqm
56 // CHECK-LE: @llvm.ppc.altivec.vaddeuqm
57 // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int'
58 
59   /* vec_addc */
60   res_vlll = vec_addc(vlll, vlll);
61 // CHECK: @llvm.ppc.altivec.vaddcuq
62 // CHECK-LE: @llvm.ppc.altivec.vaddcuq
63 // KCHECK-PPC: error: call to 'vec_addc' is ambiguous
64 
65   res_vulll = vec_addc(vulll, vulll);
66 // CHECK: @llvm.ppc.altivec.vaddcuq
67 // CHECK-LE: @llvm.ppc.altivec.vaddcuq
68 // KCHECK-PPC: error: call to 'vec_addc' is ambiguous
69 
70 
71   /* vec_vaddcuq */
72   res_vlll = vec_vaddcuq(vlll, vlll);
73 // CHECK: @llvm.ppc.altivec.vaddcuq
74 // CHECK-LE: @llvm.ppc.altivec.vaddcuq
75 // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int'
76 
77   res_vulll = vec_vaddcuq(vulll, vulll);
78 // CHECK: @llvm.ppc.altivec.vaddcuq
79 // CHECK-LE: @llvm.ppc.altivec.vaddcuq
80 // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int'
81 
82   /* vec_vaddecuq */
83   res_vlll = vec_vaddecuq(vlll, vlll, vlll);
84 // CHECK: @llvm.ppc.altivec.vaddecuq
85 // CHECK-LE: @llvm.ppc.altivec.vaddecuq
86 // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int'
87 
88   res_vulll = vec_vaddecuq(vulll, vulll, vulll);
89 // CHECK: @llvm.ppc.altivec.vaddecuq
90 // CHECK-LE: @llvm.ppc.altivec.vaddecuq
91 // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int'
92 
93   /* vec_sub */
94   res_vlll = vec_sub(vlll, vlll);
95 // CHECK: sub <1 x i128>
96 // CHECK-LE: sub <1 x i128>
97 // CHECK-PPC: error: call to 'vec_sub' is ambiguous
98 
99   res_vulll = vec_sub(vulll, vulll);
100 // CHECK: sub <1 x i128>
101 // CHECK-LE: sub <1 x i128>
102 // CHECK-PPC: error: call to 'vec_sub' is ambiguous
103 
104   /* vec_vsubuqm */
105   res_vlll = vec_vsubuqm(vlll, vlll);
106 // CHECK: sub <1 x i128>
107 // CHECK-LE: sub <1 x i128>
108 // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int'
109 
110   res_vulll = vec_vsubuqm(vulll, vulll);
111 // CHECK: sub <1 x i128>
112 // CHECK-LE: sub <1 x i128>
113 // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int'
114 
115   /* vec_vsubeuqm */
116   res_vlll = vec_vsubeuqm(vlll, vlll, vlll);
117 // CHECK: @llvm.ppc.altivec.vsubeuqm
118 // CHECK-LE: @llvm.ppc.altivec.vsubeuqm
119 // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int'
120 
121   res_vulll = vec_vsubeuqm(vulll, vulll, vulll);
122 // CHECK: @llvm.ppc.altivec.vsubeuqm
123 // CHECK-LE: @llvm.ppc.altivec.vsubeuqm
124 // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int'
125 
126   /* vec_subc */
127   res_vlll = vec_subc(vlll, vlll);
128 // CHECK: @llvm.ppc.altivec.vsubcuq
129 // CHECK-LE: @llvm.ppc.altivec.vsubcuq
130 // KCHECK-PPC: error: call to 'vec_subc' is ambiguous
131 
132   res_vulll = vec_subc(vulll, vulll);
133 // CHECK: @llvm.ppc.altivec.vsubcuq
134 // CHECK-LE: @llvm.ppc.altivec.vsubcuq
135 // KCHECK-PPC: error: call to 'vec_subc' is ambiguous
136 
137   /* vec_vsubcuq */
138   res_vlll = vec_vsubcuq(vlll, vlll);
139 // CHECK: @llvm.ppc.altivec.vsubcuq
140 // CHECK-LE: @llvm.ppc.altivec.vsubcuq
141 // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int'
142 
143   res_vulll = vec_vsubcuq(vulll, vulll);
144 // CHECK: @llvm.ppc.altivec.vsubcuq
145 // CHECK-LE: @llvm.ppc.altivec.vsubcuq
146 // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int'
147 
148   /* vec_vsubecuq */
149   res_vlll = vec_vsubecuq(vlll, vlll, vlll);
150 // CHECK: @llvm.ppc.altivec.vsubecuq
151 // CHECK-LE: @llvm.ppc.altivec.vsubecuq
152 // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int'
153 
154   res_vulll = vec_vsubecuq(vulll, vulll, vulll);
155 // CHECK: @llvm.ppc.altivec.vsubecuq
156 // CHECK-LE: @llvm.ppc.altivec.vsubecuq
157 // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int'
158 
159 }
160