File: | build/llvm-toolchain-snapshot-16~++20221003111214+1fa2019828ca/build-llvm/tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc |
Warning: | line 12870, column 3 Value stored to 'DefaultPolicy' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | case RISCVVector::BI__builtin_rvv_vget_v: |
2 | DefaultPolicy = 1; |
3 | |
4 | { |
5 | ID = Intrinsic::vector_extract; |
6 | auto *VecTy = cast<ScalableVectorType>(ResultType); |
7 | auto *OpVecTy = cast<ScalableVectorType>(Ops[0]->getType()); |
8 | // Mask to only valid indices. |
9 | unsigned MaxIndex = OpVecTy->getMinNumElements() / VecTy->getMinNumElements(); |
10 | assert(isPowerOf2_32(MaxIndex))(static_cast <bool> (isPowerOf2_32(MaxIndex)) ? void (0 ) : __assert_fail ("isPowerOf2_32(MaxIndex)", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10, __extension__ __PRETTY_FUNCTION__)); |
11 | Ops[1] = Builder.CreateZExt(Ops[1], Builder.getInt64Ty()); |
12 | Ops[1] = Builder.CreateAnd(Ops[1], MaxIndex - 1); |
13 | Ops[1] = Builder.CreateMul(Ops[1], |
14 | ConstantInt::get(Ops[1]->getType(), |
15 | VecTy->getMinNumElements())); |
16 | IntrinsicTypes = {ResultType, Ops[0]->getType()}; |
17 | return Builder.CreateCall(CGM.getIntrinsic(ID, IntrinsicTypes), Ops, ""); |
18 | } |
19 | break; |
20 | case RISCVVector::BI__builtin_rvv_vset_v: |
21 | DefaultPolicy = 1; |
22 | |
23 | { |
24 | ID = Intrinsic::vector_insert; |
25 | IntrinsicTypes = {ResultType, Ops[2]->getType()}; |
26 | auto *ResVecTy = cast<ScalableVectorType>(ResultType); |
27 | auto *VecTy = cast<ScalableVectorType>(Ops[2]->getType()); |
28 | // Mask to only valid indices. |
29 | unsigned MaxIndex = ResVecTy->getMinNumElements() / VecTy->getMinNumElements(); |
30 | assert(isPowerOf2_32(MaxIndex))(static_cast <bool> (isPowerOf2_32(MaxIndex)) ? void (0 ) : __assert_fail ("isPowerOf2_32(MaxIndex)", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 30, __extension__ __PRETTY_FUNCTION__)); |
31 | Ops[1] = Builder.CreateZExt(Ops[1], Builder.getInt64Ty()); |
32 | Ops[1] = Builder.CreateAnd(Ops[1], MaxIndex - 1); |
33 | Ops[1] = Builder.CreateMul(Ops[1], |
34 | ConstantInt::get(Ops[1]->getType(), |
35 | VecTy->getMinNumElements())); |
36 | std::swap(Ops[1], Ops[2]); |
37 | return Builder.CreateCall(CGM.getIntrinsic(ID, IntrinsicTypes), Ops, ""); |
38 | } |
39 | break; |
40 | case RISCVVector::BI__builtin_rvv_vlmul_ext_v: |
41 | DefaultPolicy = 1; |
42 | |
43 | ID = Intrinsic::vector_insert; |
44 | IntrinsicTypes = {ResultType, Ops[0]->getType()}; |
45 | Ops.push_back(llvm::PoisonValue::get(ResultType)); |
46 | std::swap(Ops[0], Ops[1]); |
47 | Ops.push_back(ConstantInt::get(Int64Ty, 0)); |
48 | return Builder.CreateCall(CGM.getIntrinsic(ID, IntrinsicTypes), Ops, ""); |
49 | break; |
50 | case RISCVVector::BI__builtin_rvv_vlmul_trunc_v: |
51 | DefaultPolicy = 1; |
52 | { |
53 | ID = Intrinsic::vector_extract; |
54 | IntrinsicTypes = {ResultType, Ops[0]->getType()}; |
55 | Ops.push_back(ConstantInt::get(Int64Ty, 0)); |
56 | return Builder.CreateCall(CGM.getIntrinsic(ID, IntrinsicTypes), Ops, ""); |
57 | } break; |
58 | case RISCVVector::BI__builtin_rvv_vreinterpret_v: |
59 | DefaultPolicy = 1; |
60 | |
61 | return Builder.CreateBitCast(Ops[0], ResultType); |
62 | break; |
63 | case RISCVVector::BI__builtin_rvv_vundefined: |
64 | DefaultPolicy = 1; |
65 | |
66 | return llvm::PoisonValue::get(ResultType); |
67 | break; |
68 | case RISCVVector::BI__builtin_rvv_vaadd_vv_tu: |
69 | case RISCVVector::BI__builtin_rvv_vaadd_vx_tu: |
70 | ID = Intrinsic::riscv_vaadd; |
71 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
72 | break; |
73 | case RISCVVector::BI__builtin_rvv_vaadd_vv_ta: |
74 | case RISCVVector::BI__builtin_rvv_vaadd_vx_ta: |
75 | ID = Intrinsic::riscv_vaadd; |
76 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
77 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
78 | break; |
79 | case RISCVVector::BI__builtin_rvv_vaadd_vv_tuma: |
80 | case RISCVVector::BI__builtin_rvv_vaadd_vx_tuma: |
81 | ID = Intrinsic::riscv_vaadd_mask; |
82 | DefaultPolicy = 2; |
83 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
84 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
85 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
86 | break; |
87 | case RISCVVector::BI__builtin_rvv_vaadd_vv_tama: |
88 | case RISCVVector::BI__builtin_rvv_vaadd_vx_tama: |
89 | ID = Intrinsic::riscv_vaadd_mask; |
90 | DefaultPolicy = 3; |
91 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
92 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
93 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
94 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
95 | break; |
96 | case RISCVVector::BI__builtin_rvv_vaadd_vv_tumu: |
97 | case RISCVVector::BI__builtin_rvv_vaadd_vx_tumu: |
98 | ID = Intrinsic::riscv_vaadd_mask; |
99 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
100 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
101 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
102 | break; |
103 | case RISCVVector::BI__builtin_rvv_vaadd_vv_tamu: |
104 | case RISCVVector::BI__builtin_rvv_vaadd_vx_tamu: |
105 | ID = Intrinsic::riscv_vaadd_mask; |
106 | DefaultPolicy = 1; |
107 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
108 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
109 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
110 | break; |
111 | case RISCVVector::BI__builtin_rvv_vaaddu_vv_tu: |
112 | case RISCVVector::BI__builtin_rvv_vaaddu_vx_tu: |
113 | ID = Intrinsic::riscv_vaaddu; |
114 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
115 | break; |
116 | case RISCVVector::BI__builtin_rvv_vaaddu_vv_ta: |
117 | case RISCVVector::BI__builtin_rvv_vaaddu_vx_ta: |
118 | ID = Intrinsic::riscv_vaaddu; |
119 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
120 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
121 | break; |
122 | case RISCVVector::BI__builtin_rvv_vaaddu_vv_tuma: |
123 | case RISCVVector::BI__builtin_rvv_vaaddu_vx_tuma: |
124 | ID = Intrinsic::riscv_vaaddu_mask; |
125 | DefaultPolicy = 2; |
126 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
127 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
128 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
129 | break; |
130 | case RISCVVector::BI__builtin_rvv_vaaddu_vv_tama: |
131 | case RISCVVector::BI__builtin_rvv_vaaddu_vx_tama: |
132 | ID = Intrinsic::riscv_vaaddu_mask; |
133 | DefaultPolicy = 3; |
134 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
135 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
136 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
137 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
138 | break; |
139 | case RISCVVector::BI__builtin_rvv_vaaddu_vv_tumu: |
140 | case RISCVVector::BI__builtin_rvv_vaaddu_vx_tumu: |
141 | ID = Intrinsic::riscv_vaaddu_mask; |
142 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
143 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
144 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
145 | break; |
146 | case RISCVVector::BI__builtin_rvv_vaaddu_vv_tamu: |
147 | case RISCVVector::BI__builtin_rvv_vaaddu_vx_tamu: |
148 | ID = Intrinsic::riscv_vaaddu_mask; |
149 | DefaultPolicy = 1; |
150 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
151 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
152 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
153 | break; |
154 | case RISCVVector::BI__builtin_rvv_vadc_vvm_tu: |
155 | case RISCVVector::BI__builtin_rvv_vadc_vxm_tu: |
156 | ID = Intrinsic::riscv_vadc; |
157 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
158 | break; |
159 | case RISCVVector::BI__builtin_rvv_vadc_vvm_ta: |
160 | case RISCVVector::BI__builtin_rvv_vadc_vxm_ta: |
161 | ID = Intrinsic::riscv_vadc; |
162 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
163 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
164 | break; |
165 | case RISCVVector::BI__builtin_rvv_vadd_vv_tu: |
166 | case RISCVVector::BI__builtin_rvv_vadd_vx_tu: |
167 | ID = Intrinsic::riscv_vadd; |
168 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
169 | break; |
170 | case RISCVVector::BI__builtin_rvv_vadd_vv_ta: |
171 | case RISCVVector::BI__builtin_rvv_vadd_vx_ta: |
172 | ID = Intrinsic::riscv_vadd; |
173 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
174 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
175 | break; |
176 | case RISCVVector::BI__builtin_rvv_vadd_vv_tuma: |
177 | case RISCVVector::BI__builtin_rvv_vadd_vx_tuma: |
178 | ID = Intrinsic::riscv_vadd_mask; |
179 | DefaultPolicy = 2; |
180 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
181 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
182 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
183 | break; |
184 | case RISCVVector::BI__builtin_rvv_vadd_vv_tama: |
185 | case RISCVVector::BI__builtin_rvv_vadd_vx_tama: |
186 | ID = Intrinsic::riscv_vadd_mask; |
187 | DefaultPolicy = 3; |
188 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
189 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
190 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
191 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
192 | break; |
193 | case RISCVVector::BI__builtin_rvv_vadd_vv_tumu: |
194 | case RISCVVector::BI__builtin_rvv_vadd_vx_tumu: |
195 | ID = Intrinsic::riscv_vadd_mask; |
196 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
197 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
198 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
199 | break; |
200 | case RISCVVector::BI__builtin_rvv_vadd_vv_tamu: |
201 | case RISCVVector::BI__builtin_rvv_vadd_vx_tamu: |
202 | ID = Intrinsic::riscv_vadd_mask; |
203 | DefaultPolicy = 1; |
204 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
205 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
206 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
207 | break; |
208 | case RISCVVector::BI__builtin_rvv_vand_vv_tu: |
209 | case RISCVVector::BI__builtin_rvv_vand_vx_tu: |
210 | ID = Intrinsic::riscv_vand; |
211 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
212 | break; |
213 | case RISCVVector::BI__builtin_rvv_vand_vv_ta: |
214 | case RISCVVector::BI__builtin_rvv_vand_vx_ta: |
215 | ID = Intrinsic::riscv_vand; |
216 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
217 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
218 | break; |
219 | case RISCVVector::BI__builtin_rvv_vand_vv_tuma: |
220 | case RISCVVector::BI__builtin_rvv_vand_vx_tuma: |
221 | ID = Intrinsic::riscv_vand_mask; |
222 | DefaultPolicy = 2; |
223 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
224 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
225 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
226 | break; |
227 | case RISCVVector::BI__builtin_rvv_vand_vv_tama: |
228 | case RISCVVector::BI__builtin_rvv_vand_vx_tama: |
229 | ID = Intrinsic::riscv_vand_mask; |
230 | DefaultPolicy = 3; |
231 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
232 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
233 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
234 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
235 | break; |
236 | case RISCVVector::BI__builtin_rvv_vand_vv_tumu: |
237 | case RISCVVector::BI__builtin_rvv_vand_vx_tumu: |
238 | ID = Intrinsic::riscv_vand_mask; |
239 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
240 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
241 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
242 | break; |
243 | case RISCVVector::BI__builtin_rvv_vand_vv_tamu: |
244 | case RISCVVector::BI__builtin_rvv_vand_vx_tamu: |
245 | ID = Intrinsic::riscv_vand_mask; |
246 | DefaultPolicy = 1; |
247 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
248 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
249 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
250 | break; |
251 | case RISCVVector::BI__builtin_rvv_vasub_vv_tu: |
252 | case RISCVVector::BI__builtin_rvv_vasub_vx_tu: |
253 | ID = Intrinsic::riscv_vasub; |
254 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
255 | break; |
256 | case RISCVVector::BI__builtin_rvv_vasub_vv_ta: |
257 | case RISCVVector::BI__builtin_rvv_vasub_vx_ta: |
258 | ID = Intrinsic::riscv_vasub; |
259 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
260 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
261 | break; |
262 | case RISCVVector::BI__builtin_rvv_vasub_vv_tuma: |
263 | case RISCVVector::BI__builtin_rvv_vasub_vx_tuma: |
264 | ID = Intrinsic::riscv_vasub_mask; |
265 | DefaultPolicy = 2; |
266 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
267 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
268 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
269 | break; |
270 | case RISCVVector::BI__builtin_rvv_vasub_vv_tama: |
271 | case RISCVVector::BI__builtin_rvv_vasub_vx_tama: |
272 | ID = Intrinsic::riscv_vasub_mask; |
273 | DefaultPolicy = 3; |
274 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
275 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
276 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
277 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
278 | break; |
279 | case RISCVVector::BI__builtin_rvv_vasub_vv_tumu: |
280 | case RISCVVector::BI__builtin_rvv_vasub_vx_tumu: |
281 | ID = Intrinsic::riscv_vasub_mask; |
282 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
283 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
284 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
285 | break; |
286 | case RISCVVector::BI__builtin_rvv_vasub_vv_tamu: |
287 | case RISCVVector::BI__builtin_rvv_vasub_vx_tamu: |
288 | ID = Intrinsic::riscv_vasub_mask; |
289 | DefaultPolicy = 1; |
290 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
291 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
292 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
293 | break; |
294 | case RISCVVector::BI__builtin_rvv_vasubu_vv_tu: |
295 | case RISCVVector::BI__builtin_rvv_vasubu_vx_tu: |
296 | ID = Intrinsic::riscv_vasubu; |
297 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
298 | break; |
299 | case RISCVVector::BI__builtin_rvv_vasubu_vv_ta: |
300 | case RISCVVector::BI__builtin_rvv_vasubu_vx_ta: |
301 | ID = Intrinsic::riscv_vasubu; |
302 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
303 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
304 | break; |
305 | case RISCVVector::BI__builtin_rvv_vasubu_vv_tuma: |
306 | case RISCVVector::BI__builtin_rvv_vasubu_vx_tuma: |
307 | ID = Intrinsic::riscv_vasubu_mask; |
308 | DefaultPolicy = 2; |
309 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
310 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
311 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
312 | break; |
313 | case RISCVVector::BI__builtin_rvv_vasubu_vv_tama: |
314 | case RISCVVector::BI__builtin_rvv_vasubu_vx_tama: |
315 | ID = Intrinsic::riscv_vasubu_mask; |
316 | DefaultPolicy = 3; |
317 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
318 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
319 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
320 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
321 | break; |
322 | case RISCVVector::BI__builtin_rvv_vasubu_vv_tumu: |
323 | case RISCVVector::BI__builtin_rvv_vasubu_vx_tumu: |
324 | ID = Intrinsic::riscv_vasubu_mask; |
325 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
326 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
327 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
328 | break; |
329 | case RISCVVector::BI__builtin_rvv_vasubu_vv_tamu: |
330 | case RISCVVector::BI__builtin_rvv_vasubu_vx_tamu: |
331 | ID = Intrinsic::riscv_vasubu_mask; |
332 | DefaultPolicy = 1; |
333 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
334 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
335 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
336 | break; |
337 | case RISCVVector::BI__builtin_rvv_vcompress_vm_tu: |
338 | ID = Intrinsic::riscv_vcompress; |
339 | DefaultPolicy = 0; |
340 | |
341 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
342 | // insert poison passthru |
343 | if (DefaultPolicy == TAIL_AGNOSTIC) |
344 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
345 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
346 | break; |
347 | case RISCVVector::BI__builtin_rvv_vcompress_vm_ta: |
348 | ID = Intrinsic::riscv_vcompress; |
349 | DefaultPolicy = 1; |
350 | |
351 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
352 | // insert poison passthru |
353 | if (DefaultPolicy == TAIL_AGNOSTIC) |
354 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
355 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
356 | break; |
357 | case RISCVVector::BI__builtin_rvv_vcpop_m: |
358 | ID = Intrinsic::riscv_vcpop; |
359 | DefaultPolicy = 1; |
360 | IntrinsicTypes = {Ops[0]->getType(), Ops.back()->getType()}; |
361 | break; |
362 | case RISCVVector::BI__builtin_rvv_vcpop_m_m: |
363 | ID = Intrinsic::riscv_vcpop_mask; |
364 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
365 | IntrinsicTypes = {Ops[0]->getType(), Ops.back()->getType()}; |
366 | break; |
367 | case RISCVVector::BI__builtin_rvv_vdiv_vv_tu: |
368 | case RISCVVector::BI__builtin_rvv_vdiv_vx_tu: |
369 | ID = Intrinsic::riscv_vdiv; |
370 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
371 | break; |
372 | case RISCVVector::BI__builtin_rvv_vdiv_vv_ta: |
373 | case RISCVVector::BI__builtin_rvv_vdiv_vx_ta: |
374 | ID = Intrinsic::riscv_vdiv; |
375 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
376 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
377 | break; |
378 | case RISCVVector::BI__builtin_rvv_vdiv_vv_tuma: |
379 | case RISCVVector::BI__builtin_rvv_vdiv_vx_tuma: |
380 | ID = Intrinsic::riscv_vdiv_mask; |
381 | DefaultPolicy = 2; |
382 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
383 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
384 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
385 | break; |
386 | case RISCVVector::BI__builtin_rvv_vdiv_vv_tama: |
387 | case RISCVVector::BI__builtin_rvv_vdiv_vx_tama: |
388 | ID = Intrinsic::riscv_vdiv_mask; |
389 | DefaultPolicy = 3; |
390 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
391 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
392 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
393 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
394 | break; |
395 | case RISCVVector::BI__builtin_rvv_vdiv_vv_tumu: |
396 | case RISCVVector::BI__builtin_rvv_vdiv_vx_tumu: |
397 | ID = Intrinsic::riscv_vdiv_mask; |
398 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
399 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
400 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
401 | break; |
402 | case RISCVVector::BI__builtin_rvv_vdiv_vv_tamu: |
403 | case RISCVVector::BI__builtin_rvv_vdiv_vx_tamu: |
404 | ID = Intrinsic::riscv_vdiv_mask; |
405 | DefaultPolicy = 1; |
406 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
407 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
408 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
409 | break; |
410 | case RISCVVector::BI__builtin_rvv_vdivu_vv_tu: |
411 | case RISCVVector::BI__builtin_rvv_vdivu_vx_tu: |
412 | ID = Intrinsic::riscv_vdivu; |
413 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
414 | break; |
415 | case RISCVVector::BI__builtin_rvv_vdivu_vv_ta: |
416 | case RISCVVector::BI__builtin_rvv_vdivu_vx_ta: |
417 | ID = Intrinsic::riscv_vdivu; |
418 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
419 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
420 | break; |
421 | case RISCVVector::BI__builtin_rvv_vdivu_vv_tuma: |
422 | case RISCVVector::BI__builtin_rvv_vdivu_vx_tuma: |
423 | ID = Intrinsic::riscv_vdivu_mask; |
424 | DefaultPolicy = 2; |
425 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
426 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
427 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
428 | break; |
429 | case RISCVVector::BI__builtin_rvv_vdivu_vv_tama: |
430 | case RISCVVector::BI__builtin_rvv_vdivu_vx_tama: |
431 | ID = Intrinsic::riscv_vdivu_mask; |
432 | DefaultPolicy = 3; |
433 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
434 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
435 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
436 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
437 | break; |
438 | case RISCVVector::BI__builtin_rvv_vdivu_vv_tumu: |
439 | case RISCVVector::BI__builtin_rvv_vdivu_vx_tumu: |
440 | ID = Intrinsic::riscv_vdivu_mask; |
441 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
442 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
443 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
444 | break; |
445 | case RISCVVector::BI__builtin_rvv_vdivu_vv_tamu: |
446 | case RISCVVector::BI__builtin_rvv_vdivu_vx_tamu: |
447 | ID = Intrinsic::riscv_vdivu_mask; |
448 | DefaultPolicy = 1; |
449 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
450 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
451 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
452 | break; |
453 | case RISCVVector::BI__builtin_rvv_vfadd_vv_tu: |
454 | case RISCVVector::BI__builtin_rvv_vfadd_vf_tu: |
455 | ID = Intrinsic::riscv_vfadd; |
456 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
457 | break; |
458 | case RISCVVector::BI__builtin_rvv_vfadd_vv_ta: |
459 | case RISCVVector::BI__builtin_rvv_vfadd_vf_ta: |
460 | ID = Intrinsic::riscv_vfadd; |
461 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
462 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
463 | break; |
464 | case RISCVVector::BI__builtin_rvv_vfadd_vv_tuma: |
465 | case RISCVVector::BI__builtin_rvv_vfadd_vf_tuma: |
466 | ID = Intrinsic::riscv_vfadd_mask; |
467 | DefaultPolicy = 2; |
468 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
469 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
470 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
471 | break; |
472 | case RISCVVector::BI__builtin_rvv_vfadd_vv_tama: |
473 | case RISCVVector::BI__builtin_rvv_vfadd_vf_tama: |
474 | ID = Intrinsic::riscv_vfadd_mask; |
475 | DefaultPolicy = 3; |
476 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
477 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
478 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
479 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
480 | break; |
481 | case RISCVVector::BI__builtin_rvv_vfadd_vv_tumu: |
482 | case RISCVVector::BI__builtin_rvv_vfadd_vf_tumu: |
483 | ID = Intrinsic::riscv_vfadd_mask; |
484 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
485 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
486 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
487 | break; |
488 | case RISCVVector::BI__builtin_rvv_vfadd_vv_tamu: |
489 | case RISCVVector::BI__builtin_rvv_vfadd_vf_tamu: |
490 | ID = Intrinsic::riscv_vfadd_mask; |
491 | DefaultPolicy = 1; |
492 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
493 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
494 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
495 | break; |
496 | case RISCVVector::BI__builtin_rvv_vfclass_v_tu: |
497 | ID = Intrinsic::riscv_vfclass; |
498 | IntrinsicTypes = {Ops[1]->getType(), Ops.back()->getType()}; |
499 | break; |
500 | case RISCVVector::BI__builtin_rvv_vfclass_v_ta: |
501 | ID = Intrinsic::riscv_vfclass; |
502 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
503 | IntrinsicTypes = {Ops[1]->getType(), Ops.back()->getType()}; |
504 | break; |
505 | case RISCVVector::BI__builtin_rvv_vfclass_v_tuma: |
506 | ID = Intrinsic::riscv_vfclass_mask; |
507 | DefaultPolicy = 2; |
508 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
509 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
510 | IntrinsicTypes = {Ops[1]->getType(), Ops.back()->getType()}; |
511 | break; |
512 | case RISCVVector::BI__builtin_rvv_vfclass_v_tama: |
513 | ID = Intrinsic::riscv_vfclass_mask; |
514 | DefaultPolicy = 3; |
515 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
516 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
517 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
518 | IntrinsicTypes = {Ops[1]->getType(), Ops.back()->getType()}; |
519 | break; |
520 | case RISCVVector::BI__builtin_rvv_vfclass_v_tumu: |
521 | ID = Intrinsic::riscv_vfclass_mask; |
522 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
523 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
524 | IntrinsicTypes = {Ops[1]->getType(), Ops.back()->getType()}; |
525 | break; |
526 | case RISCVVector::BI__builtin_rvv_vfclass_v_tamu: |
527 | ID = Intrinsic::riscv_vfclass_mask; |
528 | DefaultPolicy = 1; |
529 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
530 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
531 | IntrinsicTypes = {Ops[1]->getType(), Ops.back()->getType()}; |
532 | break; |
533 | case RISCVVector::BI__builtin_rvv_vfcvt_f_x_v_tu: |
534 | ID = Intrinsic::riscv_vfcvt_f_x_v; |
535 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
536 | break; |
537 | case RISCVVector::BI__builtin_rvv_vfcvt_f_x_v_ta: |
538 | ID = Intrinsic::riscv_vfcvt_f_x_v; |
539 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
540 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
541 | break; |
542 | case RISCVVector::BI__builtin_rvv_vfcvt_f_x_v_tuma: |
543 | ID = Intrinsic::riscv_vfcvt_f_x_v_mask; |
544 | DefaultPolicy = 2; |
545 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
546 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
547 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
548 | break; |
549 | case RISCVVector::BI__builtin_rvv_vfcvt_f_x_v_tama: |
550 | ID = Intrinsic::riscv_vfcvt_f_x_v_mask; |
551 | DefaultPolicy = 3; |
552 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
553 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
554 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
555 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
556 | break; |
557 | case RISCVVector::BI__builtin_rvv_vfcvt_f_x_v_tumu: |
558 | ID = Intrinsic::riscv_vfcvt_f_x_v_mask; |
559 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
560 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
561 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
562 | break; |
563 | case RISCVVector::BI__builtin_rvv_vfcvt_f_x_v_tamu: |
564 | ID = Intrinsic::riscv_vfcvt_f_x_v_mask; |
565 | DefaultPolicy = 1; |
566 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
567 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
568 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
569 | break; |
570 | case RISCVVector::BI__builtin_rvv_vfcvt_f_xu_v_tu: |
571 | ID = Intrinsic::riscv_vfcvt_f_xu_v; |
572 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
573 | break; |
574 | case RISCVVector::BI__builtin_rvv_vfcvt_f_xu_v_ta: |
575 | ID = Intrinsic::riscv_vfcvt_f_xu_v; |
576 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
577 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
578 | break; |
579 | case RISCVVector::BI__builtin_rvv_vfcvt_f_xu_v_tuma: |
580 | ID = Intrinsic::riscv_vfcvt_f_xu_v_mask; |
581 | DefaultPolicy = 2; |
582 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
583 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
584 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
585 | break; |
586 | case RISCVVector::BI__builtin_rvv_vfcvt_f_xu_v_tama: |
587 | ID = Intrinsic::riscv_vfcvt_f_xu_v_mask; |
588 | DefaultPolicy = 3; |
589 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
590 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
591 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
592 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
593 | break; |
594 | case RISCVVector::BI__builtin_rvv_vfcvt_f_xu_v_tumu: |
595 | ID = Intrinsic::riscv_vfcvt_f_xu_v_mask; |
596 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
597 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
598 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
599 | break; |
600 | case RISCVVector::BI__builtin_rvv_vfcvt_f_xu_v_tamu: |
601 | ID = Intrinsic::riscv_vfcvt_f_xu_v_mask; |
602 | DefaultPolicy = 1; |
603 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
604 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
605 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
606 | break; |
607 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_x_f_v_tu: |
608 | ID = Intrinsic::riscv_vfcvt_rtz_x_f_v; |
609 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
610 | break; |
611 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_x_f_v_ta: |
612 | ID = Intrinsic::riscv_vfcvt_rtz_x_f_v; |
613 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
614 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
615 | break; |
616 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_x_f_v_tuma: |
617 | ID = Intrinsic::riscv_vfcvt_rtz_x_f_v_mask; |
618 | DefaultPolicy = 2; |
619 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
620 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
621 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
622 | break; |
623 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_x_f_v_tama: |
624 | ID = Intrinsic::riscv_vfcvt_rtz_x_f_v_mask; |
625 | DefaultPolicy = 3; |
626 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
627 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
628 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
629 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
630 | break; |
631 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_x_f_v_tumu: |
632 | ID = Intrinsic::riscv_vfcvt_rtz_x_f_v_mask; |
633 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
634 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
635 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
636 | break; |
637 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_x_f_v_tamu: |
638 | ID = Intrinsic::riscv_vfcvt_rtz_x_f_v_mask; |
639 | DefaultPolicy = 1; |
640 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
641 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
642 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
643 | break; |
644 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_xu_f_v_tu: |
645 | ID = Intrinsic::riscv_vfcvt_rtz_xu_f_v; |
646 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
647 | break; |
648 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_xu_f_v_ta: |
649 | ID = Intrinsic::riscv_vfcvt_rtz_xu_f_v; |
650 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
651 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
652 | break; |
653 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_xu_f_v_tuma: |
654 | ID = Intrinsic::riscv_vfcvt_rtz_xu_f_v_mask; |
655 | DefaultPolicy = 2; |
656 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
657 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
658 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
659 | break; |
660 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_xu_f_v_tama: |
661 | ID = Intrinsic::riscv_vfcvt_rtz_xu_f_v_mask; |
662 | DefaultPolicy = 3; |
663 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
664 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
665 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
666 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
667 | break; |
668 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_xu_f_v_tumu: |
669 | ID = Intrinsic::riscv_vfcvt_rtz_xu_f_v_mask; |
670 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
671 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
672 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
673 | break; |
674 | case RISCVVector::BI__builtin_rvv_vfcvt_rtz_xu_f_v_tamu: |
675 | ID = Intrinsic::riscv_vfcvt_rtz_xu_f_v_mask; |
676 | DefaultPolicy = 1; |
677 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
678 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
679 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
680 | break; |
681 | case RISCVVector::BI__builtin_rvv_vfcvt_x_f_v_tu: |
682 | ID = Intrinsic::riscv_vfcvt_x_f_v; |
683 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
684 | break; |
685 | case RISCVVector::BI__builtin_rvv_vfcvt_x_f_v_ta: |
686 | ID = Intrinsic::riscv_vfcvt_x_f_v; |
687 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
688 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
689 | break; |
690 | case RISCVVector::BI__builtin_rvv_vfcvt_x_f_v_tuma: |
691 | ID = Intrinsic::riscv_vfcvt_x_f_v_mask; |
692 | DefaultPolicy = 2; |
693 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
694 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
695 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
696 | break; |
697 | case RISCVVector::BI__builtin_rvv_vfcvt_x_f_v_tama: |
698 | ID = Intrinsic::riscv_vfcvt_x_f_v_mask; |
699 | DefaultPolicy = 3; |
700 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
701 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
702 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
703 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
704 | break; |
705 | case RISCVVector::BI__builtin_rvv_vfcvt_x_f_v_tumu: |
706 | ID = Intrinsic::riscv_vfcvt_x_f_v_mask; |
707 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
708 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
709 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
710 | break; |
711 | case RISCVVector::BI__builtin_rvv_vfcvt_x_f_v_tamu: |
712 | ID = Intrinsic::riscv_vfcvt_x_f_v_mask; |
713 | DefaultPolicy = 1; |
714 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
715 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
716 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
717 | break; |
718 | case RISCVVector::BI__builtin_rvv_vfcvt_xu_f_v_tu: |
719 | ID = Intrinsic::riscv_vfcvt_xu_f_v; |
720 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
721 | break; |
722 | case RISCVVector::BI__builtin_rvv_vfcvt_xu_f_v_ta: |
723 | ID = Intrinsic::riscv_vfcvt_xu_f_v; |
724 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
725 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
726 | break; |
727 | case RISCVVector::BI__builtin_rvv_vfcvt_xu_f_v_tuma: |
728 | ID = Intrinsic::riscv_vfcvt_xu_f_v_mask; |
729 | DefaultPolicy = 2; |
730 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
731 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
732 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
733 | break; |
734 | case RISCVVector::BI__builtin_rvv_vfcvt_xu_f_v_tama: |
735 | ID = Intrinsic::riscv_vfcvt_xu_f_v_mask; |
736 | DefaultPolicy = 3; |
737 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
738 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
739 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
740 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
741 | break; |
742 | case RISCVVector::BI__builtin_rvv_vfcvt_xu_f_v_tumu: |
743 | ID = Intrinsic::riscv_vfcvt_xu_f_v_mask; |
744 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
745 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
746 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
747 | break; |
748 | case RISCVVector::BI__builtin_rvv_vfcvt_xu_f_v_tamu: |
749 | ID = Intrinsic::riscv_vfcvt_xu_f_v_mask; |
750 | DefaultPolicy = 1; |
751 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
752 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
753 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
754 | break; |
755 | case RISCVVector::BI__builtin_rvv_vfdiv_vv_tu: |
756 | case RISCVVector::BI__builtin_rvv_vfdiv_vf_tu: |
757 | ID = Intrinsic::riscv_vfdiv; |
758 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
759 | break; |
760 | case RISCVVector::BI__builtin_rvv_vfdiv_vv_ta: |
761 | case RISCVVector::BI__builtin_rvv_vfdiv_vf_ta: |
762 | ID = Intrinsic::riscv_vfdiv; |
763 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
764 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
765 | break; |
766 | case RISCVVector::BI__builtin_rvv_vfdiv_vv_tuma: |
767 | case RISCVVector::BI__builtin_rvv_vfdiv_vf_tuma: |
768 | ID = Intrinsic::riscv_vfdiv_mask; |
769 | DefaultPolicy = 2; |
770 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
771 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
772 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
773 | break; |
774 | case RISCVVector::BI__builtin_rvv_vfdiv_vv_tama: |
775 | case RISCVVector::BI__builtin_rvv_vfdiv_vf_tama: |
776 | ID = Intrinsic::riscv_vfdiv_mask; |
777 | DefaultPolicy = 3; |
778 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
779 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
780 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
781 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
782 | break; |
783 | case RISCVVector::BI__builtin_rvv_vfdiv_vv_tumu: |
784 | case RISCVVector::BI__builtin_rvv_vfdiv_vf_tumu: |
785 | ID = Intrinsic::riscv_vfdiv_mask; |
786 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
787 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
788 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
789 | break; |
790 | case RISCVVector::BI__builtin_rvv_vfdiv_vv_tamu: |
791 | case RISCVVector::BI__builtin_rvv_vfdiv_vf_tamu: |
792 | ID = Intrinsic::riscv_vfdiv_mask; |
793 | DefaultPolicy = 1; |
794 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
795 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
796 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
797 | break; |
798 | case RISCVVector::BI__builtin_rvv_vfirst_m: |
799 | ID = Intrinsic::riscv_vfirst; |
800 | DefaultPolicy = 1; |
801 | IntrinsicTypes = {Ops[0]->getType(), Ops.back()->getType()}; |
802 | break; |
803 | case RISCVVector::BI__builtin_rvv_vfirst_m_m: |
804 | ID = Intrinsic::riscv_vfirst_mask; |
805 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
806 | IntrinsicTypes = {Ops[0]->getType(), Ops.back()->getType()}; |
807 | break; |
808 | case RISCVVector::BI__builtin_rvv_vfmacc_vv_tu: |
809 | case RISCVVector::BI__builtin_rvv_vfmacc_vf_tu: |
810 | ID = Intrinsic::riscv_vfmacc; |
811 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
812 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
813 | break; |
814 | case RISCVVector::BI__builtin_rvv_vfmacc_vv_ta: |
815 | case RISCVVector::BI__builtin_rvv_vfmacc_vf_ta: |
816 | ID = Intrinsic::riscv_vfmacc; |
817 | DefaultPolicy = 1; |
818 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
819 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
820 | break; |
821 | case RISCVVector::BI__builtin_rvv_vfmacc_vv_tuma: |
822 | case RISCVVector::BI__builtin_rvv_vfmacc_vf_tuma: |
823 | ID = Intrinsic::riscv_vfmacc_mask; |
824 | DefaultPolicy = 2; |
825 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
826 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
827 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
828 | break; |
829 | case RISCVVector::BI__builtin_rvv_vfmacc_vv_tama: |
830 | case RISCVVector::BI__builtin_rvv_vfmacc_vf_tama: |
831 | ID = Intrinsic::riscv_vfmacc_mask; |
832 | DefaultPolicy = 3; |
833 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
834 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
835 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
836 | break; |
837 | case RISCVVector::BI__builtin_rvv_vfmacc_vv_tumu: |
838 | case RISCVVector::BI__builtin_rvv_vfmacc_vf_tumu: |
839 | ID = Intrinsic::riscv_vfmacc_mask; |
840 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
841 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
842 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
843 | break; |
844 | case RISCVVector::BI__builtin_rvv_vfmacc_vv_tamu: |
845 | case RISCVVector::BI__builtin_rvv_vfmacc_vf_tamu: |
846 | ID = Intrinsic::riscv_vfmacc_mask; |
847 | DefaultPolicy = 1; |
848 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
849 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
850 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
851 | break; |
852 | case RISCVVector::BI__builtin_rvv_vfmadd_vv_tu: |
853 | case RISCVVector::BI__builtin_rvv_vfmadd_vf_tu: |
854 | ID = Intrinsic::riscv_vfmadd; |
855 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
856 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
857 | break; |
858 | case RISCVVector::BI__builtin_rvv_vfmadd_vv_ta: |
859 | case RISCVVector::BI__builtin_rvv_vfmadd_vf_ta: |
860 | ID = Intrinsic::riscv_vfmadd; |
861 | DefaultPolicy = 1; |
862 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
863 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
864 | break; |
865 | case RISCVVector::BI__builtin_rvv_vfmadd_vv_tuma: |
866 | case RISCVVector::BI__builtin_rvv_vfmadd_vf_tuma: |
867 | ID = Intrinsic::riscv_vfmadd_mask; |
868 | DefaultPolicy = 2; |
869 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
870 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
871 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
872 | break; |
873 | case RISCVVector::BI__builtin_rvv_vfmadd_vv_tama: |
874 | case RISCVVector::BI__builtin_rvv_vfmadd_vf_tama: |
875 | ID = Intrinsic::riscv_vfmadd_mask; |
876 | DefaultPolicy = 3; |
877 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
878 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
879 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
880 | break; |
881 | case RISCVVector::BI__builtin_rvv_vfmadd_vv_tumu: |
882 | case RISCVVector::BI__builtin_rvv_vfmadd_vf_tumu: |
883 | ID = Intrinsic::riscv_vfmadd_mask; |
884 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
885 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
886 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
887 | break; |
888 | case RISCVVector::BI__builtin_rvv_vfmadd_vv_tamu: |
889 | case RISCVVector::BI__builtin_rvv_vfmadd_vf_tamu: |
890 | ID = Intrinsic::riscv_vfmadd_mask; |
891 | DefaultPolicy = 1; |
892 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
893 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
894 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
895 | break; |
896 | case RISCVVector::BI__builtin_rvv_vfmax_vv_tu: |
897 | case RISCVVector::BI__builtin_rvv_vfmax_vf_tu: |
898 | ID = Intrinsic::riscv_vfmax; |
899 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
900 | break; |
901 | case RISCVVector::BI__builtin_rvv_vfmax_vv_ta: |
902 | case RISCVVector::BI__builtin_rvv_vfmax_vf_ta: |
903 | ID = Intrinsic::riscv_vfmax; |
904 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
905 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
906 | break; |
907 | case RISCVVector::BI__builtin_rvv_vfmax_vv_tuma: |
908 | case RISCVVector::BI__builtin_rvv_vfmax_vf_tuma: |
909 | ID = Intrinsic::riscv_vfmax_mask; |
910 | DefaultPolicy = 2; |
911 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
912 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
913 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
914 | break; |
915 | case RISCVVector::BI__builtin_rvv_vfmax_vv_tama: |
916 | case RISCVVector::BI__builtin_rvv_vfmax_vf_tama: |
917 | ID = Intrinsic::riscv_vfmax_mask; |
918 | DefaultPolicy = 3; |
919 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
920 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
921 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
922 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
923 | break; |
924 | case RISCVVector::BI__builtin_rvv_vfmax_vv_tumu: |
925 | case RISCVVector::BI__builtin_rvv_vfmax_vf_tumu: |
926 | ID = Intrinsic::riscv_vfmax_mask; |
927 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
928 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
929 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
930 | break; |
931 | case RISCVVector::BI__builtin_rvv_vfmax_vv_tamu: |
932 | case RISCVVector::BI__builtin_rvv_vfmax_vf_tamu: |
933 | ID = Intrinsic::riscv_vfmax_mask; |
934 | DefaultPolicy = 1; |
935 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
936 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
937 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
938 | break; |
939 | case RISCVVector::BI__builtin_rvv_vfmerge_vfm_tu: |
940 | ID = Intrinsic::riscv_vfmerge; |
941 | DefaultPolicy = 0; |
942 | |
943 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
944 | // insert poison passthru |
945 | if (DefaultPolicy == TAIL_AGNOSTIC) |
946 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
947 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
948 | break; |
949 | case RISCVVector::BI__builtin_rvv_vfmerge_vfm_ta: |
950 | ID = Intrinsic::riscv_vfmerge; |
951 | DefaultPolicy = 1; |
952 | |
953 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
954 | // insert poison passthru |
955 | if (DefaultPolicy == TAIL_AGNOSTIC) |
956 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
957 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
958 | break; |
959 | case RISCVVector::BI__builtin_rvv_vfmin_vv_tu: |
960 | case RISCVVector::BI__builtin_rvv_vfmin_vf_tu: |
961 | ID = Intrinsic::riscv_vfmin; |
962 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
963 | break; |
964 | case RISCVVector::BI__builtin_rvv_vfmin_vv_ta: |
965 | case RISCVVector::BI__builtin_rvv_vfmin_vf_ta: |
966 | ID = Intrinsic::riscv_vfmin; |
967 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
968 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
969 | break; |
970 | case RISCVVector::BI__builtin_rvv_vfmin_vv_tuma: |
971 | case RISCVVector::BI__builtin_rvv_vfmin_vf_tuma: |
972 | ID = Intrinsic::riscv_vfmin_mask; |
973 | DefaultPolicy = 2; |
974 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
975 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
976 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
977 | break; |
978 | case RISCVVector::BI__builtin_rvv_vfmin_vv_tama: |
979 | case RISCVVector::BI__builtin_rvv_vfmin_vf_tama: |
980 | ID = Intrinsic::riscv_vfmin_mask; |
981 | DefaultPolicy = 3; |
982 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
983 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
984 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
985 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
986 | break; |
987 | case RISCVVector::BI__builtin_rvv_vfmin_vv_tumu: |
988 | case RISCVVector::BI__builtin_rvv_vfmin_vf_tumu: |
989 | ID = Intrinsic::riscv_vfmin_mask; |
990 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
991 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
992 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
993 | break; |
994 | case RISCVVector::BI__builtin_rvv_vfmin_vv_tamu: |
995 | case RISCVVector::BI__builtin_rvv_vfmin_vf_tamu: |
996 | ID = Intrinsic::riscv_vfmin_mask; |
997 | DefaultPolicy = 1; |
998 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
999 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1000 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1001 | break; |
1002 | case RISCVVector::BI__builtin_rvv_vfmsac_vv_tu: |
1003 | case RISCVVector::BI__builtin_rvv_vfmsac_vf_tu: |
1004 | ID = Intrinsic::riscv_vfmsac; |
1005 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1006 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1007 | break; |
1008 | case RISCVVector::BI__builtin_rvv_vfmsac_vv_ta: |
1009 | case RISCVVector::BI__builtin_rvv_vfmsac_vf_ta: |
1010 | ID = Intrinsic::riscv_vfmsac; |
1011 | DefaultPolicy = 1; |
1012 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1013 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1014 | break; |
1015 | case RISCVVector::BI__builtin_rvv_vfmsac_vv_tuma: |
1016 | case RISCVVector::BI__builtin_rvv_vfmsac_vf_tuma: |
1017 | ID = Intrinsic::riscv_vfmsac_mask; |
1018 | DefaultPolicy = 2; |
1019 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1020 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1021 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1022 | break; |
1023 | case RISCVVector::BI__builtin_rvv_vfmsac_vv_tama: |
1024 | case RISCVVector::BI__builtin_rvv_vfmsac_vf_tama: |
1025 | ID = Intrinsic::riscv_vfmsac_mask; |
1026 | DefaultPolicy = 3; |
1027 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1028 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1029 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1030 | break; |
1031 | case RISCVVector::BI__builtin_rvv_vfmsac_vv_tumu: |
1032 | case RISCVVector::BI__builtin_rvv_vfmsac_vf_tumu: |
1033 | ID = Intrinsic::riscv_vfmsac_mask; |
1034 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1035 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1036 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1037 | break; |
1038 | case RISCVVector::BI__builtin_rvv_vfmsac_vv_tamu: |
1039 | case RISCVVector::BI__builtin_rvv_vfmsac_vf_tamu: |
1040 | ID = Intrinsic::riscv_vfmsac_mask; |
1041 | DefaultPolicy = 1; |
1042 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1043 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1044 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1045 | break; |
1046 | case RISCVVector::BI__builtin_rvv_vfmsub_vv_tu: |
1047 | case RISCVVector::BI__builtin_rvv_vfmsub_vf_tu: |
1048 | ID = Intrinsic::riscv_vfmsub; |
1049 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1050 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1051 | break; |
1052 | case RISCVVector::BI__builtin_rvv_vfmsub_vv_ta: |
1053 | case RISCVVector::BI__builtin_rvv_vfmsub_vf_ta: |
1054 | ID = Intrinsic::riscv_vfmsub; |
1055 | DefaultPolicy = 1; |
1056 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1057 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1058 | break; |
1059 | case RISCVVector::BI__builtin_rvv_vfmsub_vv_tuma: |
1060 | case RISCVVector::BI__builtin_rvv_vfmsub_vf_tuma: |
1061 | ID = Intrinsic::riscv_vfmsub_mask; |
1062 | DefaultPolicy = 2; |
1063 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1064 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1065 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1066 | break; |
1067 | case RISCVVector::BI__builtin_rvv_vfmsub_vv_tama: |
1068 | case RISCVVector::BI__builtin_rvv_vfmsub_vf_tama: |
1069 | ID = Intrinsic::riscv_vfmsub_mask; |
1070 | DefaultPolicy = 3; |
1071 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1072 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1073 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1074 | break; |
1075 | case RISCVVector::BI__builtin_rvv_vfmsub_vv_tumu: |
1076 | case RISCVVector::BI__builtin_rvv_vfmsub_vf_tumu: |
1077 | ID = Intrinsic::riscv_vfmsub_mask; |
1078 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1079 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1080 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1081 | break; |
1082 | case RISCVVector::BI__builtin_rvv_vfmsub_vv_tamu: |
1083 | case RISCVVector::BI__builtin_rvv_vfmsub_vf_tamu: |
1084 | ID = Intrinsic::riscv_vfmsub_mask; |
1085 | DefaultPolicy = 1; |
1086 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1087 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1088 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1089 | break; |
1090 | case RISCVVector::BI__builtin_rvv_vfmul_vv_tu: |
1091 | case RISCVVector::BI__builtin_rvv_vfmul_vf_tu: |
1092 | ID = Intrinsic::riscv_vfmul; |
1093 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1094 | break; |
1095 | case RISCVVector::BI__builtin_rvv_vfmul_vv_ta: |
1096 | case RISCVVector::BI__builtin_rvv_vfmul_vf_ta: |
1097 | ID = Intrinsic::riscv_vfmul; |
1098 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1099 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1100 | break; |
1101 | case RISCVVector::BI__builtin_rvv_vfmul_vv_tuma: |
1102 | case RISCVVector::BI__builtin_rvv_vfmul_vf_tuma: |
1103 | ID = Intrinsic::riscv_vfmul_mask; |
1104 | DefaultPolicy = 2; |
1105 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1106 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1107 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1108 | break; |
1109 | case RISCVVector::BI__builtin_rvv_vfmul_vv_tama: |
1110 | case RISCVVector::BI__builtin_rvv_vfmul_vf_tama: |
1111 | ID = Intrinsic::riscv_vfmul_mask; |
1112 | DefaultPolicy = 3; |
1113 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1114 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1115 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1116 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1117 | break; |
1118 | case RISCVVector::BI__builtin_rvv_vfmul_vv_tumu: |
1119 | case RISCVVector::BI__builtin_rvv_vfmul_vf_tumu: |
1120 | ID = Intrinsic::riscv_vfmul_mask; |
1121 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1122 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1123 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1124 | break; |
1125 | case RISCVVector::BI__builtin_rvv_vfmul_vv_tamu: |
1126 | case RISCVVector::BI__builtin_rvv_vfmul_vf_tamu: |
1127 | ID = Intrinsic::riscv_vfmul_mask; |
1128 | DefaultPolicy = 1; |
1129 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1130 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1131 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1132 | break; |
1133 | case RISCVVector::BI__builtin_rvv_vfmv_f_s: |
1134 | ID = Intrinsic::riscv_vfmv_f_s; |
1135 | IntrinsicTypes = {Ops[0]->getType()}; |
1136 | break; |
1137 | case RISCVVector::BI__builtin_rvv_vfmv_s_f_tu: |
1138 | case RISCVVector::BI__builtin_rvv_vfmv_s_x_tu: |
1139 | ID = Intrinsic::riscv_vfmv_s_f; |
1140 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1141 | break; |
1142 | case RISCVVector::BI__builtin_rvv_vfmv_s_f_ta: |
1143 | case RISCVVector::BI__builtin_rvv_vfmv_s_x_ta: |
1144 | ID = Intrinsic::riscv_vfmv_s_f; |
1145 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1146 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1147 | break; |
1148 | case RISCVVector::BI__builtin_rvv_vfmv_v_f_tu: |
1149 | ID = Intrinsic::riscv_vfmv_v_f; |
1150 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1151 | break; |
1152 | case RISCVVector::BI__builtin_rvv_vfmv_v_f_ta: |
1153 | ID = Intrinsic::riscv_vfmv_v_f; |
1154 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1155 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1156 | break; |
1157 | case RISCVVector::BI__builtin_rvv_vfncvt_f_f_w_tu: |
1158 | ID = Intrinsic::riscv_vfncvt_f_f_w; |
1159 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1160 | break; |
1161 | case RISCVVector::BI__builtin_rvv_vfncvt_f_f_w_ta: |
1162 | ID = Intrinsic::riscv_vfncvt_f_f_w; |
1163 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1164 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1165 | break; |
1166 | case RISCVVector::BI__builtin_rvv_vfncvt_f_f_w_tuma: |
1167 | ID = Intrinsic::riscv_vfncvt_f_f_w_mask; |
1168 | DefaultPolicy = 2; |
1169 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1170 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1171 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1172 | break; |
1173 | case RISCVVector::BI__builtin_rvv_vfncvt_f_f_w_tama: |
1174 | ID = Intrinsic::riscv_vfncvt_f_f_w_mask; |
1175 | DefaultPolicy = 3; |
1176 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1177 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1178 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1179 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1180 | break; |
1181 | case RISCVVector::BI__builtin_rvv_vfncvt_f_f_w_tumu: |
1182 | ID = Intrinsic::riscv_vfncvt_f_f_w_mask; |
1183 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1184 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1185 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1186 | break; |
1187 | case RISCVVector::BI__builtin_rvv_vfncvt_f_f_w_tamu: |
1188 | ID = Intrinsic::riscv_vfncvt_f_f_w_mask; |
1189 | DefaultPolicy = 1; |
1190 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1191 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1192 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1193 | break; |
1194 | case RISCVVector::BI__builtin_rvv_vfncvt_f_x_w_tu: |
1195 | ID = Intrinsic::riscv_vfncvt_f_x_w; |
1196 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1197 | break; |
1198 | case RISCVVector::BI__builtin_rvv_vfncvt_f_x_w_ta: |
1199 | ID = Intrinsic::riscv_vfncvt_f_x_w; |
1200 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1201 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1202 | break; |
1203 | case RISCVVector::BI__builtin_rvv_vfncvt_f_x_w_tuma: |
1204 | ID = Intrinsic::riscv_vfncvt_f_x_w_mask; |
1205 | DefaultPolicy = 2; |
1206 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1207 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1208 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1209 | break; |
1210 | case RISCVVector::BI__builtin_rvv_vfncvt_f_x_w_tama: |
1211 | ID = Intrinsic::riscv_vfncvt_f_x_w_mask; |
1212 | DefaultPolicy = 3; |
1213 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1214 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1215 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1216 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1217 | break; |
1218 | case RISCVVector::BI__builtin_rvv_vfncvt_f_x_w_tumu: |
1219 | ID = Intrinsic::riscv_vfncvt_f_x_w_mask; |
1220 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1221 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1222 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1223 | break; |
1224 | case RISCVVector::BI__builtin_rvv_vfncvt_f_x_w_tamu: |
1225 | ID = Intrinsic::riscv_vfncvt_f_x_w_mask; |
1226 | DefaultPolicy = 1; |
1227 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1228 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1229 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1230 | break; |
1231 | case RISCVVector::BI__builtin_rvv_vfncvt_f_xu_w_tu: |
1232 | ID = Intrinsic::riscv_vfncvt_f_xu_w; |
1233 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1234 | break; |
1235 | case RISCVVector::BI__builtin_rvv_vfncvt_f_xu_w_ta: |
1236 | ID = Intrinsic::riscv_vfncvt_f_xu_w; |
1237 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1238 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1239 | break; |
1240 | case RISCVVector::BI__builtin_rvv_vfncvt_f_xu_w_tuma: |
1241 | ID = Intrinsic::riscv_vfncvt_f_xu_w_mask; |
1242 | DefaultPolicy = 2; |
1243 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1244 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1245 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1246 | break; |
1247 | case RISCVVector::BI__builtin_rvv_vfncvt_f_xu_w_tama: |
1248 | ID = Intrinsic::riscv_vfncvt_f_xu_w_mask; |
1249 | DefaultPolicy = 3; |
1250 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1251 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1252 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1253 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1254 | break; |
1255 | case RISCVVector::BI__builtin_rvv_vfncvt_f_xu_w_tumu: |
1256 | ID = Intrinsic::riscv_vfncvt_f_xu_w_mask; |
1257 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1258 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1259 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1260 | break; |
1261 | case RISCVVector::BI__builtin_rvv_vfncvt_f_xu_w_tamu: |
1262 | ID = Intrinsic::riscv_vfncvt_f_xu_w_mask; |
1263 | DefaultPolicy = 1; |
1264 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1265 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1266 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1267 | break; |
1268 | case RISCVVector::BI__builtin_rvv_vfncvt_rod_f_f_w_tu: |
1269 | ID = Intrinsic::riscv_vfncvt_rod_f_f_w; |
1270 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1271 | break; |
1272 | case RISCVVector::BI__builtin_rvv_vfncvt_rod_f_f_w_ta: |
1273 | ID = Intrinsic::riscv_vfncvt_rod_f_f_w; |
1274 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1275 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1276 | break; |
1277 | case RISCVVector::BI__builtin_rvv_vfncvt_rod_f_f_w_tuma: |
1278 | ID = Intrinsic::riscv_vfncvt_rod_f_f_w_mask; |
1279 | DefaultPolicy = 2; |
1280 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1281 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1282 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1283 | break; |
1284 | case RISCVVector::BI__builtin_rvv_vfncvt_rod_f_f_w_tama: |
1285 | ID = Intrinsic::riscv_vfncvt_rod_f_f_w_mask; |
1286 | DefaultPolicy = 3; |
1287 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1288 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1289 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1290 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1291 | break; |
1292 | case RISCVVector::BI__builtin_rvv_vfncvt_rod_f_f_w_tumu: |
1293 | ID = Intrinsic::riscv_vfncvt_rod_f_f_w_mask; |
1294 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1295 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1296 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1297 | break; |
1298 | case RISCVVector::BI__builtin_rvv_vfncvt_rod_f_f_w_tamu: |
1299 | ID = Intrinsic::riscv_vfncvt_rod_f_f_w_mask; |
1300 | DefaultPolicy = 1; |
1301 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1302 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1303 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1304 | break; |
1305 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_x_f_w_tu: |
1306 | ID = Intrinsic::riscv_vfncvt_rtz_x_f_w; |
1307 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1308 | break; |
1309 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_x_f_w_ta: |
1310 | ID = Intrinsic::riscv_vfncvt_rtz_x_f_w; |
1311 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1312 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1313 | break; |
1314 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_x_f_w_tuma: |
1315 | ID = Intrinsic::riscv_vfncvt_rtz_x_f_w_mask; |
1316 | DefaultPolicy = 2; |
1317 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1318 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1319 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1320 | break; |
1321 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_x_f_w_tama: |
1322 | ID = Intrinsic::riscv_vfncvt_rtz_x_f_w_mask; |
1323 | DefaultPolicy = 3; |
1324 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1325 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1326 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1327 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1328 | break; |
1329 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_x_f_w_tumu: |
1330 | ID = Intrinsic::riscv_vfncvt_rtz_x_f_w_mask; |
1331 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1332 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1333 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1334 | break; |
1335 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_x_f_w_tamu: |
1336 | ID = Intrinsic::riscv_vfncvt_rtz_x_f_w_mask; |
1337 | DefaultPolicy = 1; |
1338 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1339 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1340 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1341 | break; |
1342 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_xu_f_w_tu: |
1343 | ID = Intrinsic::riscv_vfncvt_rtz_xu_f_w; |
1344 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1345 | break; |
1346 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_xu_f_w_ta: |
1347 | ID = Intrinsic::riscv_vfncvt_rtz_xu_f_w; |
1348 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1349 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1350 | break; |
1351 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_xu_f_w_tuma: |
1352 | ID = Intrinsic::riscv_vfncvt_rtz_xu_f_w_mask; |
1353 | DefaultPolicy = 2; |
1354 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1355 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1356 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1357 | break; |
1358 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_xu_f_w_tama: |
1359 | ID = Intrinsic::riscv_vfncvt_rtz_xu_f_w_mask; |
1360 | DefaultPolicy = 3; |
1361 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1362 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1363 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1364 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1365 | break; |
1366 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_xu_f_w_tumu: |
1367 | ID = Intrinsic::riscv_vfncvt_rtz_xu_f_w_mask; |
1368 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1369 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1370 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1371 | break; |
1372 | case RISCVVector::BI__builtin_rvv_vfncvt_rtz_xu_f_w_tamu: |
1373 | ID = Intrinsic::riscv_vfncvt_rtz_xu_f_w_mask; |
1374 | DefaultPolicy = 1; |
1375 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1376 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1377 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1378 | break; |
1379 | case RISCVVector::BI__builtin_rvv_vfncvt_x_f_w_tu: |
1380 | ID = Intrinsic::riscv_vfncvt_x_f_w; |
1381 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1382 | break; |
1383 | case RISCVVector::BI__builtin_rvv_vfncvt_x_f_w_ta: |
1384 | ID = Intrinsic::riscv_vfncvt_x_f_w; |
1385 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1386 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1387 | break; |
1388 | case RISCVVector::BI__builtin_rvv_vfncvt_x_f_w_tuma: |
1389 | ID = Intrinsic::riscv_vfncvt_x_f_w_mask; |
1390 | DefaultPolicy = 2; |
1391 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1392 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1393 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1394 | break; |
1395 | case RISCVVector::BI__builtin_rvv_vfncvt_x_f_w_tama: |
1396 | ID = Intrinsic::riscv_vfncvt_x_f_w_mask; |
1397 | DefaultPolicy = 3; |
1398 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1399 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1400 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1401 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1402 | break; |
1403 | case RISCVVector::BI__builtin_rvv_vfncvt_x_f_w_tumu: |
1404 | ID = Intrinsic::riscv_vfncvt_x_f_w_mask; |
1405 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1406 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1407 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1408 | break; |
1409 | case RISCVVector::BI__builtin_rvv_vfncvt_x_f_w_tamu: |
1410 | ID = Intrinsic::riscv_vfncvt_x_f_w_mask; |
1411 | DefaultPolicy = 1; |
1412 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1413 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1414 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1415 | break; |
1416 | case RISCVVector::BI__builtin_rvv_vfncvt_xu_f_w_tu: |
1417 | ID = Intrinsic::riscv_vfncvt_xu_f_w; |
1418 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1419 | break; |
1420 | case RISCVVector::BI__builtin_rvv_vfncvt_xu_f_w_ta: |
1421 | ID = Intrinsic::riscv_vfncvt_xu_f_w; |
1422 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1423 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1424 | break; |
1425 | case RISCVVector::BI__builtin_rvv_vfncvt_xu_f_w_tuma: |
1426 | ID = Intrinsic::riscv_vfncvt_xu_f_w_mask; |
1427 | DefaultPolicy = 2; |
1428 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1429 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1430 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1431 | break; |
1432 | case RISCVVector::BI__builtin_rvv_vfncvt_xu_f_w_tama: |
1433 | ID = Intrinsic::riscv_vfncvt_xu_f_w_mask; |
1434 | DefaultPolicy = 3; |
1435 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1436 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1437 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1438 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1439 | break; |
1440 | case RISCVVector::BI__builtin_rvv_vfncvt_xu_f_w_tumu: |
1441 | ID = Intrinsic::riscv_vfncvt_xu_f_w_mask; |
1442 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1443 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1444 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1445 | break; |
1446 | case RISCVVector::BI__builtin_rvv_vfncvt_xu_f_w_tamu: |
1447 | ID = Intrinsic::riscv_vfncvt_xu_f_w_mask; |
1448 | DefaultPolicy = 1; |
1449 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1450 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1451 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1452 | break; |
1453 | case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tu: |
1454 | case RISCVVector::BI__builtin_rvv_vfnmacc_vf_tu: |
1455 | ID = Intrinsic::riscv_vfnmacc; |
1456 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1457 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1458 | break; |
1459 | case RISCVVector::BI__builtin_rvv_vfnmacc_vv_ta: |
1460 | case RISCVVector::BI__builtin_rvv_vfnmacc_vf_ta: |
1461 | ID = Intrinsic::riscv_vfnmacc; |
1462 | DefaultPolicy = 1; |
1463 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1464 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1465 | break; |
1466 | case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tuma: |
1467 | case RISCVVector::BI__builtin_rvv_vfnmacc_vf_tuma: |
1468 | ID = Intrinsic::riscv_vfnmacc_mask; |
1469 | DefaultPolicy = 2; |
1470 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1471 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1472 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1473 | break; |
1474 | case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tama: |
1475 | case RISCVVector::BI__builtin_rvv_vfnmacc_vf_tama: |
1476 | ID = Intrinsic::riscv_vfnmacc_mask; |
1477 | DefaultPolicy = 3; |
1478 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1479 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1480 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1481 | break; |
1482 | case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tumu: |
1483 | case RISCVVector::BI__builtin_rvv_vfnmacc_vf_tumu: |
1484 | ID = Intrinsic::riscv_vfnmacc_mask; |
1485 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1486 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1487 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1488 | break; |
1489 | case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tamu: |
1490 | case RISCVVector::BI__builtin_rvv_vfnmacc_vf_tamu: |
1491 | ID = Intrinsic::riscv_vfnmacc_mask; |
1492 | DefaultPolicy = 1; |
1493 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1494 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1495 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1496 | break; |
1497 | case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tu: |
1498 | case RISCVVector::BI__builtin_rvv_vfnmadd_vf_tu: |
1499 | ID = Intrinsic::riscv_vfnmadd; |
1500 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1501 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1502 | break; |
1503 | case RISCVVector::BI__builtin_rvv_vfnmadd_vv_ta: |
1504 | case RISCVVector::BI__builtin_rvv_vfnmadd_vf_ta: |
1505 | ID = Intrinsic::riscv_vfnmadd; |
1506 | DefaultPolicy = 1; |
1507 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1508 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1509 | break; |
1510 | case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tuma: |
1511 | case RISCVVector::BI__builtin_rvv_vfnmadd_vf_tuma: |
1512 | ID = Intrinsic::riscv_vfnmadd_mask; |
1513 | DefaultPolicy = 2; |
1514 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1515 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1516 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1517 | break; |
1518 | case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tama: |
1519 | case RISCVVector::BI__builtin_rvv_vfnmadd_vf_tama: |
1520 | ID = Intrinsic::riscv_vfnmadd_mask; |
1521 | DefaultPolicy = 3; |
1522 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1523 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1524 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1525 | break; |
1526 | case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tumu: |
1527 | case RISCVVector::BI__builtin_rvv_vfnmadd_vf_tumu: |
1528 | ID = Intrinsic::riscv_vfnmadd_mask; |
1529 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1530 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1531 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1532 | break; |
1533 | case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tamu: |
1534 | case RISCVVector::BI__builtin_rvv_vfnmadd_vf_tamu: |
1535 | ID = Intrinsic::riscv_vfnmadd_mask; |
1536 | DefaultPolicy = 1; |
1537 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1538 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1539 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1540 | break; |
1541 | case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tu: |
1542 | case RISCVVector::BI__builtin_rvv_vfnmsac_vf_tu: |
1543 | ID = Intrinsic::riscv_vfnmsac; |
1544 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1545 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1546 | break; |
1547 | case RISCVVector::BI__builtin_rvv_vfnmsac_vv_ta: |
1548 | case RISCVVector::BI__builtin_rvv_vfnmsac_vf_ta: |
1549 | ID = Intrinsic::riscv_vfnmsac; |
1550 | DefaultPolicy = 1; |
1551 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1552 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1553 | break; |
1554 | case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tuma: |
1555 | case RISCVVector::BI__builtin_rvv_vfnmsac_vf_tuma: |
1556 | ID = Intrinsic::riscv_vfnmsac_mask; |
1557 | DefaultPolicy = 2; |
1558 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1559 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1560 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1561 | break; |
1562 | case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tama: |
1563 | case RISCVVector::BI__builtin_rvv_vfnmsac_vf_tama: |
1564 | ID = Intrinsic::riscv_vfnmsac_mask; |
1565 | DefaultPolicy = 3; |
1566 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1567 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1568 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1569 | break; |
1570 | case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tumu: |
1571 | case RISCVVector::BI__builtin_rvv_vfnmsac_vf_tumu: |
1572 | ID = Intrinsic::riscv_vfnmsac_mask; |
1573 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1574 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1575 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1576 | break; |
1577 | case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tamu: |
1578 | case RISCVVector::BI__builtin_rvv_vfnmsac_vf_tamu: |
1579 | ID = Intrinsic::riscv_vfnmsac_mask; |
1580 | DefaultPolicy = 1; |
1581 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1582 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1583 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1584 | break; |
1585 | case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tu: |
1586 | case RISCVVector::BI__builtin_rvv_vfnmsub_vf_tu: |
1587 | ID = Intrinsic::riscv_vfnmsub; |
1588 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1589 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1590 | break; |
1591 | case RISCVVector::BI__builtin_rvv_vfnmsub_vv_ta: |
1592 | case RISCVVector::BI__builtin_rvv_vfnmsub_vf_ta: |
1593 | ID = Intrinsic::riscv_vfnmsub; |
1594 | DefaultPolicy = 1; |
1595 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1596 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1597 | break; |
1598 | case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tuma: |
1599 | case RISCVVector::BI__builtin_rvv_vfnmsub_vf_tuma: |
1600 | ID = Intrinsic::riscv_vfnmsub_mask; |
1601 | DefaultPolicy = 2; |
1602 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1603 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1604 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1605 | break; |
1606 | case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tama: |
1607 | case RISCVVector::BI__builtin_rvv_vfnmsub_vf_tama: |
1608 | ID = Intrinsic::riscv_vfnmsub_mask; |
1609 | DefaultPolicy = 3; |
1610 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1611 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1612 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1613 | break; |
1614 | case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tumu: |
1615 | case RISCVVector::BI__builtin_rvv_vfnmsub_vf_tumu: |
1616 | ID = Intrinsic::riscv_vfnmsub_mask; |
1617 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1618 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1619 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1620 | break; |
1621 | case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tamu: |
1622 | case RISCVVector::BI__builtin_rvv_vfnmsub_vf_tamu: |
1623 | ID = Intrinsic::riscv_vfnmsub_mask; |
1624 | DefaultPolicy = 1; |
1625 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1626 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1627 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1628 | break; |
1629 | case RISCVVector::BI__builtin_rvv_vfrdiv_vf_tu: |
1630 | ID = Intrinsic::riscv_vfrdiv; |
1631 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1632 | break; |
1633 | case RISCVVector::BI__builtin_rvv_vfrdiv_vf_ta: |
1634 | ID = Intrinsic::riscv_vfrdiv; |
1635 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1636 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1637 | break; |
1638 | case RISCVVector::BI__builtin_rvv_vfrdiv_vf_tuma: |
1639 | ID = Intrinsic::riscv_vfrdiv_mask; |
1640 | DefaultPolicy = 2; |
1641 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1642 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1643 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1644 | break; |
1645 | case RISCVVector::BI__builtin_rvv_vfrdiv_vf_tama: |
1646 | ID = Intrinsic::riscv_vfrdiv_mask; |
1647 | DefaultPolicy = 3; |
1648 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1649 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1650 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1651 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1652 | break; |
1653 | case RISCVVector::BI__builtin_rvv_vfrdiv_vf_tumu: |
1654 | ID = Intrinsic::riscv_vfrdiv_mask; |
1655 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1656 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1657 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1658 | break; |
1659 | case RISCVVector::BI__builtin_rvv_vfrdiv_vf_tamu: |
1660 | ID = Intrinsic::riscv_vfrdiv_mask; |
1661 | DefaultPolicy = 1; |
1662 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1663 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1664 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1665 | break; |
1666 | case RISCVVector::BI__builtin_rvv_vfrec7_v_tu: |
1667 | ID = Intrinsic::riscv_vfrec7; |
1668 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1669 | break; |
1670 | case RISCVVector::BI__builtin_rvv_vfrec7_v_ta: |
1671 | ID = Intrinsic::riscv_vfrec7; |
1672 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1673 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1674 | break; |
1675 | case RISCVVector::BI__builtin_rvv_vfrec7_v_tuma: |
1676 | ID = Intrinsic::riscv_vfrec7_mask; |
1677 | DefaultPolicy = 2; |
1678 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1679 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1680 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1681 | break; |
1682 | case RISCVVector::BI__builtin_rvv_vfrec7_v_tama: |
1683 | ID = Intrinsic::riscv_vfrec7_mask; |
1684 | DefaultPolicy = 3; |
1685 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1686 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1687 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1688 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1689 | break; |
1690 | case RISCVVector::BI__builtin_rvv_vfrec7_v_tumu: |
1691 | ID = Intrinsic::riscv_vfrec7_mask; |
1692 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1693 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1694 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1695 | break; |
1696 | case RISCVVector::BI__builtin_rvv_vfrec7_v_tamu: |
1697 | ID = Intrinsic::riscv_vfrec7_mask; |
1698 | DefaultPolicy = 1; |
1699 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1700 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1701 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1702 | break; |
1703 | case RISCVVector::BI__builtin_rvv_vfredmax_vs_tu: |
1704 | ID = Intrinsic::riscv_vfredmax; |
1705 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1706 | break; |
1707 | case RISCVVector::BI__builtin_rvv_vfredmax_vs_ta: |
1708 | ID = Intrinsic::riscv_vfredmax; |
1709 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1710 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1711 | break; |
1712 | case RISCVVector::BI__builtin_rvv_vfredmax_vs_tum: |
1713 | ID = Intrinsic::riscv_vfredmax_mask; |
1714 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1715 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1716 | break; |
1717 | case RISCVVector::BI__builtin_rvv_vfredmax_vs_tam: |
1718 | ID = Intrinsic::riscv_vfredmax_mask; |
1719 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1720 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1721 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1722 | break; |
1723 | case RISCVVector::BI__builtin_rvv_vfredmax_vs_tumu: |
1724 | ID = Intrinsic::riscv_vfredmax_mask; |
1725 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1726 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1727 | break; |
1728 | case RISCVVector::BI__builtin_rvv_vfredmin_vs_tu: |
1729 | ID = Intrinsic::riscv_vfredmin; |
1730 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1731 | break; |
1732 | case RISCVVector::BI__builtin_rvv_vfredmin_vs_ta: |
1733 | ID = Intrinsic::riscv_vfredmin; |
1734 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1735 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1736 | break; |
1737 | case RISCVVector::BI__builtin_rvv_vfredmin_vs_tum: |
1738 | ID = Intrinsic::riscv_vfredmin_mask; |
1739 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1740 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1741 | break; |
1742 | case RISCVVector::BI__builtin_rvv_vfredmin_vs_tam: |
1743 | ID = Intrinsic::riscv_vfredmin_mask; |
1744 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1745 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1746 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1747 | break; |
1748 | case RISCVVector::BI__builtin_rvv_vfredmin_vs_tumu: |
1749 | ID = Intrinsic::riscv_vfredmin_mask; |
1750 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1751 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1752 | break; |
1753 | case RISCVVector::BI__builtin_rvv_vfredosum_vs_tu: |
1754 | ID = Intrinsic::riscv_vfredosum; |
1755 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1756 | break; |
1757 | case RISCVVector::BI__builtin_rvv_vfredosum_vs_ta: |
1758 | ID = Intrinsic::riscv_vfredosum; |
1759 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1760 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1761 | break; |
1762 | case RISCVVector::BI__builtin_rvv_vfredosum_vs_tum: |
1763 | ID = Intrinsic::riscv_vfredosum_mask; |
1764 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1765 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1766 | break; |
1767 | case RISCVVector::BI__builtin_rvv_vfredosum_vs_tam: |
1768 | ID = Intrinsic::riscv_vfredosum_mask; |
1769 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1770 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1771 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1772 | break; |
1773 | case RISCVVector::BI__builtin_rvv_vfredosum_vs_tumu: |
1774 | ID = Intrinsic::riscv_vfredosum_mask; |
1775 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1776 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1777 | break; |
1778 | case RISCVVector::BI__builtin_rvv_vfredusum_vs_tu: |
1779 | ID = Intrinsic::riscv_vfredusum; |
1780 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1781 | break; |
1782 | case RISCVVector::BI__builtin_rvv_vfredusum_vs_ta: |
1783 | ID = Intrinsic::riscv_vfredusum; |
1784 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1785 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1786 | break; |
1787 | case RISCVVector::BI__builtin_rvv_vfredusum_vs_tum: |
1788 | ID = Intrinsic::riscv_vfredusum_mask; |
1789 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1790 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1791 | break; |
1792 | case RISCVVector::BI__builtin_rvv_vfredusum_vs_tam: |
1793 | ID = Intrinsic::riscv_vfredusum_mask; |
1794 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1795 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1796 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1797 | break; |
1798 | case RISCVVector::BI__builtin_rvv_vfredusum_vs_tumu: |
1799 | ID = Intrinsic::riscv_vfredusum_mask; |
1800 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1801 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
1802 | break; |
1803 | case RISCVVector::BI__builtin_rvv_vfrsqrt7_v_tu: |
1804 | ID = Intrinsic::riscv_vfrsqrt7; |
1805 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1806 | break; |
1807 | case RISCVVector::BI__builtin_rvv_vfrsqrt7_v_ta: |
1808 | ID = Intrinsic::riscv_vfrsqrt7; |
1809 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1810 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1811 | break; |
1812 | case RISCVVector::BI__builtin_rvv_vfrsqrt7_v_tuma: |
1813 | ID = Intrinsic::riscv_vfrsqrt7_mask; |
1814 | DefaultPolicy = 2; |
1815 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1816 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1817 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1818 | break; |
1819 | case RISCVVector::BI__builtin_rvv_vfrsqrt7_v_tama: |
1820 | ID = Intrinsic::riscv_vfrsqrt7_mask; |
1821 | DefaultPolicy = 3; |
1822 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1823 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1824 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1825 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1826 | break; |
1827 | case RISCVVector::BI__builtin_rvv_vfrsqrt7_v_tumu: |
1828 | ID = Intrinsic::riscv_vfrsqrt7_mask; |
1829 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1830 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1831 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1832 | break; |
1833 | case RISCVVector::BI__builtin_rvv_vfrsqrt7_v_tamu: |
1834 | ID = Intrinsic::riscv_vfrsqrt7_mask; |
1835 | DefaultPolicy = 1; |
1836 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1837 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1838 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
1839 | break; |
1840 | case RISCVVector::BI__builtin_rvv_vfrsub_vf_tu: |
1841 | ID = Intrinsic::riscv_vfrsub; |
1842 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1843 | break; |
1844 | case RISCVVector::BI__builtin_rvv_vfrsub_vf_ta: |
1845 | ID = Intrinsic::riscv_vfrsub; |
1846 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1847 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1848 | break; |
1849 | case RISCVVector::BI__builtin_rvv_vfrsub_vf_tuma: |
1850 | ID = Intrinsic::riscv_vfrsub_mask; |
1851 | DefaultPolicy = 2; |
1852 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1853 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1854 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1855 | break; |
1856 | case RISCVVector::BI__builtin_rvv_vfrsub_vf_tama: |
1857 | ID = Intrinsic::riscv_vfrsub_mask; |
1858 | DefaultPolicy = 3; |
1859 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1860 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1861 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1862 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1863 | break; |
1864 | case RISCVVector::BI__builtin_rvv_vfrsub_vf_tumu: |
1865 | ID = Intrinsic::riscv_vfrsub_mask; |
1866 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1867 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1868 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1869 | break; |
1870 | case RISCVVector::BI__builtin_rvv_vfrsub_vf_tamu: |
1871 | ID = Intrinsic::riscv_vfrsub_mask; |
1872 | DefaultPolicy = 1; |
1873 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1874 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1875 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1876 | break; |
1877 | case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tu: |
1878 | case RISCVVector::BI__builtin_rvv_vfsgnj_vf_tu: |
1879 | ID = Intrinsic::riscv_vfsgnj; |
1880 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1881 | break; |
1882 | case RISCVVector::BI__builtin_rvv_vfsgnj_vv_ta: |
1883 | case RISCVVector::BI__builtin_rvv_vfsgnj_vf_ta: |
1884 | ID = Intrinsic::riscv_vfsgnj; |
1885 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1886 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1887 | break; |
1888 | case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tuma: |
1889 | case RISCVVector::BI__builtin_rvv_vfsgnj_vf_tuma: |
1890 | ID = Intrinsic::riscv_vfsgnj_mask; |
1891 | DefaultPolicy = 2; |
1892 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1893 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1894 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1895 | break; |
1896 | case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tama: |
1897 | case RISCVVector::BI__builtin_rvv_vfsgnj_vf_tama: |
1898 | ID = Intrinsic::riscv_vfsgnj_mask; |
1899 | DefaultPolicy = 3; |
1900 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1901 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1902 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1903 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1904 | break; |
1905 | case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tumu: |
1906 | case RISCVVector::BI__builtin_rvv_vfsgnj_vf_tumu: |
1907 | ID = Intrinsic::riscv_vfsgnj_mask; |
1908 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1909 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1910 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1911 | break; |
1912 | case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tamu: |
1913 | case RISCVVector::BI__builtin_rvv_vfsgnj_vf_tamu: |
1914 | ID = Intrinsic::riscv_vfsgnj_mask; |
1915 | DefaultPolicy = 1; |
1916 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1917 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1918 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1919 | break; |
1920 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tu: |
1921 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vf_tu: |
1922 | ID = Intrinsic::riscv_vfsgnjn; |
1923 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1924 | break; |
1925 | case RISCVVector::BI__builtin_rvv_vfneg_v_tu: |
1926 | ID = Intrinsic::riscv_vfsgnjn; |
1927 | DefaultPolicy = 0; |
1928 | |
1929 | { |
1930 | if (DefaultPolicy == TAIL_AGNOSTIC) |
1931 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
1932 | // op1, po2, vl |
1933 | IntrinsicTypes = {ResultType, |
1934 | Ops[1]->getType(), Ops[2]->getType()}; |
1935 | Ops.insert(Ops.begin() + 2, Ops[1]); |
1936 | break; |
1937 | } |
1938 | break; |
1939 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_ta: |
1940 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vf_ta: |
1941 | ID = Intrinsic::riscv_vfsgnjn; |
1942 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1943 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1944 | break; |
1945 | case RISCVVector::BI__builtin_rvv_vfneg_v_ta: |
1946 | ID = Intrinsic::riscv_vfsgnjn; |
1947 | DefaultPolicy = 1; |
1948 | |
1949 | { |
1950 | if (DefaultPolicy == TAIL_AGNOSTIC) |
1951 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
1952 | // op1, po2, vl |
1953 | IntrinsicTypes = {ResultType, |
1954 | Ops[1]->getType(), Ops[2]->getType()}; |
1955 | Ops.insert(Ops.begin() + 2, Ops[1]); |
1956 | break; |
1957 | } |
1958 | break; |
1959 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tuma: |
1960 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vf_tuma: |
1961 | ID = Intrinsic::riscv_vfsgnjn_mask; |
1962 | DefaultPolicy = 2; |
1963 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1964 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1965 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1966 | break; |
1967 | case RISCVVector::BI__builtin_rvv_vfneg_v_tuma: |
1968 | ID = Intrinsic::riscv_vfsgnjn_mask; |
1969 | DefaultPolicy = 2; |
1970 | |
1971 | { |
1972 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1973 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
1974 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
1975 | Ops.insert(Ops.begin() + 2, Ops[1]); |
1976 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1977 | // maskedoff, op1, op2, mask, vl |
1978 | IntrinsicTypes = {ResultType, |
1979 | Ops[2]->getType(), |
1980 | Ops.back()->getType()}; |
1981 | break; |
1982 | } |
1983 | break; |
1984 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tama: |
1985 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vf_tama: |
1986 | ID = Intrinsic::riscv_vfsgnjn_mask; |
1987 | DefaultPolicy = 3; |
1988 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1989 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
1990 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
1991 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
1992 | break; |
1993 | case RISCVVector::BI__builtin_rvv_vfneg_v_tama: |
1994 | ID = Intrinsic::riscv_vfsgnjn_mask; |
1995 | DefaultPolicy = 3; |
1996 | |
1997 | { |
1998 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
1999 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
2000 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2001 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2002 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2003 | // maskedoff, op1, op2, mask, vl |
2004 | IntrinsicTypes = {ResultType, |
2005 | Ops[2]->getType(), |
2006 | Ops.back()->getType()}; |
2007 | break; |
2008 | } |
2009 | break; |
2010 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tumu: |
2011 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vf_tumu: |
2012 | ID = Intrinsic::riscv_vfsgnjn_mask; |
2013 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2014 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2015 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2016 | break; |
2017 | case RISCVVector::BI__builtin_rvv_vfneg_v_tumu: |
2018 | ID = Intrinsic::riscv_vfsgnjn_mask; |
2019 | DefaultPolicy = 0; |
2020 | |
2021 | { |
2022 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2023 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
2024 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2025 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2026 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2027 | // maskedoff, op1, op2, mask, vl |
2028 | IntrinsicTypes = {ResultType, |
2029 | Ops[2]->getType(), |
2030 | Ops.back()->getType()}; |
2031 | break; |
2032 | } |
2033 | break; |
2034 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tamu: |
2035 | case RISCVVector::BI__builtin_rvv_vfsgnjn_vf_tamu: |
2036 | ID = Intrinsic::riscv_vfsgnjn_mask; |
2037 | DefaultPolicy = 1; |
2038 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2039 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2040 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2041 | break; |
2042 | case RISCVVector::BI__builtin_rvv_vfneg_v_tamu: |
2043 | ID = Intrinsic::riscv_vfsgnjn_mask; |
2044 | DefaultPolicy = 1; |
2045 | |
2046 | { |
2047 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2048 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
2049 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2050 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2051 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2052 | // maskedoff, op1, op2, mask, vl |
2053 | IntrinsicTypes = {ResultType, |
2054 | Ops[2]->getType(), |
2055 | Ops.back()->getType()}; |
2056 | break; |
2057 | } |
2058 | break; |
2059 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tu: |
2060 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vf_tu: |
2061 | ID = Intrinsic::riscv_vfsgnjx; |
2062 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2063 | break; |
2064 | case RISCVVector::BI__builtin_rvv_vfabs_v_tu: |
2065 | ID = Intrinsic::riscv_vfsgnjx; |
2066 | DefaultPolicy = 0; |
2067 | |
2068 | { |
2069 | if (DefaultPolicy == TAIL_AGNOSTIC) |
2070 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2071 | // op1, po2, vl |
2072 | IntrinsicTypes = {ResultType, |
2073 | Ops[1]->getType(), Ops[2]->getType()}; |
2074 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2075 | break; |
2076 | } |
2077 | break; |
2078 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_ta: |
2079 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vf_ta: |
2080 | ID = Intrinsic::riscv_vfsgnjx; |
2081 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2082 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2083 | break; |
2084 | case RISCVVector::BI__builtin_rvv_vfabs_v_ta: |
2085 | ID = Intrinsic::riscv_vfsgnjx; |
2086 | DefaultPolicy = 1; |
2087 | |
2088 | { |
2089 | if (DefaultPolicy == TAIL_AGNOSTIC) |
2090 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2091 | // op1, po2, vl |
2092 | IntrinsicTypes = {ResultType, |
2093 | Ops[1]->getType(), Ops[2]->getType()}; |
2094 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2095 | break; |
2096 | } |
2097 | break; |
2098 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tuma: |
2099 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vf_tuma: |
2100 | ID = Intrinsic::riscv_vfsgnjx_mask; |
2101 | DefaultPolicy = 2; |
2102 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2103 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2104 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2105 | break; |
2106 | case RISCVVector::BI__builtin_rvv_vfabs_v_tuma: |
2107 | ID = Intrinsic::riscv_vfsgnjx_mask; |
2108 | DefaultPolicy = 2; |
2109 | |
2110 | { |
2111 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2112 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
2113 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2114 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2115 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2116 | // maskedoff, op1, op2, mask, vl |
2117 | IntrinsicTypes = {ResultType, |
2118 | Ops[2]->getType(), |
2119 | Ops.back()->getType()}; |
2120 | break; |
2121 | } |
2122 | break; |
2123 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tama: |
2124 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vf_tama: |
2125 | ID = Intrinsic::riscv_vfsgnjx_mask; |
2126 | DefaultPolicy = 3; |
2127 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2128 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2129 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2130 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2131 | break; |
2132 | case RISCVVector::BI__builtin_rvv_vfabs_v_tama: |
2133 | ID = Intrinsic::riscv_vfsgnjx_mask; |
2134 | DefaultPolicy = 3; |
2135 | |
2136 | { |
2137 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2138 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
2139 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2140 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2141 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2142 | // maskedoff, op1, op2, mask, vl |
2143 | IntrinsicTypes = {ResultType, |
2144 | Ops[2]->getType(), |
2145 | Ops.back()->getType()}; |
2146 | break; |
2147 | } |
2148 | break; |
2149 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tumu: |
2150 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vf_tumu: |
2151 | ID = Intrinsic::riscv_vfsgnjx_mask; |
2152 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2153 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2154 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2155 | break; |
2156 | case RISCVVector::BI__builtin_rvv_vfabs_v_tumu: |
2157 | ID = Intrinsic::riscv_vfsgnjx_mask; |
2158 | DefaultPolicy = 0; |
2159 | |
2160 | { |
2161 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2162 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
2163 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2164 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2165 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2166 | // maskedoff, op1, op2, mask, vl |
2167 | IntrinsicTypes = {ResultType, |
2168 | Ops[2]->getType(), |
2169 | Ops.back()->getType()}; |
2170 | break; |
2171 | } |
2172 | break; |
2173 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tamu: |
2174 | case RISCVVector::BI__builtin_rvv_vfsgnjx_vf_tamu: |
2175 | ID = Intrinsic::riscv_vfsgnjx_mask; |
2176 | DefaultPolicy = 1; |
2177 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2178 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2179 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2180 | break; |
2181 | case RISCVVector::BI__builtin_rvv_vfabs_v_tamu: |
2182 | ID = Intrinsic::riscv_vfsgnjx_mask; |
2183 | DefaultPolicy = 1; |
2184 | |
2185 | { |
2186 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2187 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
2188 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
2189 | Ops.insert(Ops.begin() + 2, Ops[1]); |
2190 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2191 | // maskedoff, op1, op2, mask, vl |
2192 | IntrinsicTypes = {ResultType, |
2193 | Ops[2]->getType(), |
2194 | Ops.back()->getType()}; |
2195 | break; |
2196 | } |
2197 | break; |
2198 | case RISCVVector::BI__builtin_rvv_vfslide1down_vf_tu: |
2199 | ID = Intrinsic::riscv_vfslide1down; |
2200 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2201 | break; |
2202 | case RISCVVector::BI__builtin_rvv_vfslide1down_vf_ta: |
2203 | ID = Intrinsic::riscv_vfslide1down; |
2204 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2205 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2206 | break; |
2207 | case RISCVVector::BI__builtin_rvv_vfslide1down_vf_tuma: |
2208 | ID = Intrinsic::riscv_vfslide1down_mask; |
2209 | DefaultPolicy = 2; |
2210 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2211 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2212 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2213 | break; |
2214 | case RISCVVector::BI__builtin_rvv_vfslide1down_vf_tama: |
2215 | ID = Intrinsic::riscv_vfslide1down_mask; |
2216 | DefaultPolicy = 3; |
2217 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2218 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2219 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2220 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2221 | break; |
2222 | case RISCVVector::BI__builtin_rvv_vfslide1down_vf_tumu: |
2223 | ID = Intrinsic::riscv_vfslide1down_mask; |
2224 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2225 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2226 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2227 | break; |
2228 | case RISCVVector::BI__builtin_rvv_vfslide1down_vf_tamu: |
2229 | ID = Intrinsic::riscv_vfslide1down_mask; |
2230 | DefaultPolicy = 1; |
2231 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2232 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2233 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2234 | break; |
2235 | case RISCVVector::BI__builtin_rvv_vfslide1up_vf_tu: |
2236 | ID = Intrinsic::riscv_vfslide1up; |
2237 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2238 | break; |
2239 | case RISCVVector::BI__builtin_rvv_vfslide1up_vf_ta: |
2240 | ID = Intrinsic::riscv_vfslide1up; |
2241 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2242 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2243 | break; |
2244 | case RISCVVector::BI__builtin_rvv_vfslide1up_vf_tuma: |
2245 | ID = Intrinsic::riscv_vfslide1up_mask; |
2246 | DefaultPolicy = 2; |
2247 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2248 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2249 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2250 | break; |
2251 | case RISCVVector::BI__builtin_rvv_vfslide1up_vf_tama: |
2252 | ID = Intrinsic::riscv_vfslide1up_mask; |
2253 | DefaultPolicy = 3; |
2254 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2255 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2256 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2257 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2258 | break; |
2259 | case RISCVVector::BI__builtin_rvv_vfslide1up_vf_tumu: |
2260 | ID = Intrinsic::riscv_vfslide1up_mask; |
2261 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2262 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2263 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2264 | break; |
2265 | case RISCVVector::BI__builtin_rvv_vfslide1up_vf_tamu: |
2266 | ID = Intrinsic::riscv_vfslide1up_mask; |
2267 | DefaultPolicy = 1; |
2268 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2269 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2270 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2271 | break; |
2272 | case RISCVVector::BI__builtin_rvv_vfsqrt_v_tu: |
2273 | ID = Intrinsic::riscv_vfsqrt; |
2274 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
2275 | break; |
2276 | case RISCVVector::BI__builtin_rvv_vfsqrt_v_ta: |
2277 | ID = Intrinsic::riscv_vfsqrt; |
2278 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2279 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
2280 | break; |
2281 | case RISCVVector::BI__builtin_rvv_vfsqrt_v_tuma: |
2282 | ID = Intrinsic::riscv_vfsqrt_mask; |
2283 | DefaultPolicy = 2; |
2284 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2285 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2286 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
2287 | break; |
2288 | case RISCVVector::BI__builtin_rvv_vfsqrt_v_tama: |
2289 | ID = Intrinsic::riscv_vfsqrt_mask; |
2290 | DefaultPolicy = 3; |
2291 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2292 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2293 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2294 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
2295 | break; |
2296 | case RISCVVector::BI__builtin_rvv_vfsqrt_v_tumu: |
2297 | ID = Intrinsic::riscv_vfsqrt_mask; |
2298 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2299 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2300 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
2301 | break; |
2302 | case RISCVVector::BI__builtin_rvv_vfsqrt_v_tamu: |
2303 | ID = Intrinsic::riscv_vfsqrt_mask; |
2304 | DefaultPolicy = 1; |
2305 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2306 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2307 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
2308 | break; |
2309 | case RISCVVector::BI__builtin_rvv_vfsub_vv_tu: |
2310 | case RISCVVector::BI__builtin_rvv_vfsub_vf_tu: |
2311 | ID = Intrinsic::riscv_vfsub; |
2312 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2313 | break; |
2314 | case RISCVVector::BI__builtin_rvv_vfsub_vv_ta: |
2315 | case RISCVVector::BI__builtin_rvv_vfsub_vf_ta: |
2316 | ID = Intrinsic::riscv_vfsub; |
2317 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2318 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2319 | break; |
2320 | case RISCVVector::BI__builtin_rvv_vfsub_vv_tuma: |
2321 | case RISCVVector::BI__builtin_rvv_vfsub_vf_tuma: |
2322 | ID = Intrinsic::riscv_vfsub_mask; |
2323 | DefaultPolicy = 2; |
2324 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2325 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2326 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2327 | break; |
2328 | case RISCVVector::BI__builtin_rvv_vfsub_vv_tama: |
2329 | case RISCVVector::BI__builtin_rvv_vfsub_vf_tama: |
2330 | ID = Intrinsic::riscv_vfsub_mask; |
2331 | DefaultPolicy = 3; |
2332 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2333 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2334 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2335 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2336 | break; |
2337 | case RISCVVector::BI__builtin_rvv_vfsub_vv_tumu: |
2338 | case RISCVVector::BI__builtin_rvv_vfsub_vf_tumu: |
2339 | ID = Intrinsic::riscv_vfsub_mask; |
2340 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2341 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2342 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2343 | break; |
2344 | case RISCVVector::BI__builtin_rvv_vfsub_vv_tamu: |
2345 | case RISCVVector::BI__builtin_rvv_vfsub_vf_tamu: |
2346 | ID = Intrinsic::riscv_vfsub_mask; |
2347 | DefaultPolicy = 1; |
2348 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2349 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2350 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2351 | break; |
2352 | case RISCVVector::BI__builtin_rvv_vfwadd_vv_tu: |
2353 | case RISCVVector::BI__builtin_rvv_vfwadd_vf_tu: |
2354 | ID = Intrinsic::riscv_vfwadd; |
2355 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2356 | break; |
2357 | case RISCVVector::BI__builtin_rvv_vfwadd_vv_ta: |
2358 | case RISCVVector::BI__builtin_rvv_vfwadd_vf_ta: |
2359 | ID = Intrinsic::riscv_vfwadd; |
2360 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2361 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2362 | break; |
2363 | case RISCVVector::BI__builtin_rvv_vfwadd_vv_tuma: |
2364 | case RISCVVector::BI__builtin_rvv_vfwadd_vf_tuma: |
2365 | ID = Intrinsic::riscv_vfwadd_mask; |
2366 | DefaultPolicy = 2; |
2367 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2368 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2369 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2370 | break; |
2371 | case RISCVVector::BI__builtin_rvv_vfwadd_vv_tama: |
2372 | case RISCVVector::BI__builtin_rvv_vfwadd_vf_tama: |
2373 | ID = Intrinsic::riscv_vfwadd_mask; |
2374 | DefaultPolicy = 3; |
2375 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2376 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2377 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2378 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2379 | break; |
2380 | case RISCVVector::BI__builtin_rvv_vfwadd_vv_tumu: |
2381 | case RISCVVector::BI__builtin_rvv_vfwadd_vf_tumu: |
2382 | ID = Intrinsic::riscv_vfwadd_mask; |
2383 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2384 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2385 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2386 | break; |
2387 | case RISCVVector::BI__builtin_rvv_vfwadd_vv_tamu: |
2388 | case RISCVVector::BI__builtin_rvv_vfwadd_vf_tamu: |
2389 | ID = Intrinsic::riscv_vfwadd_mask; |
2390 | DefaultPolicy = 1; |
2391 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2392 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2393 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2394 | break; |
2395 | case RISCVVector::BI__builtin_rvv_vfwadd_wv_tu: |
2396 | case RISCVVector::BI__builtin_rvv_vfwadd_wf_tu: |
2397 | ID = Intrinsic::riscv_vfwadd_w; |
2398 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2399 | break; |
2400 | case RISCVVector::BI__builtin_rvv_vfwadd_wv_ta: |
2401 | case RISCVVector::BI__builtin_rvv_vfwadd_wf_ta: |
2402 | ID = Intrinsic::riscv_vfwadd_w; |
2403 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2404 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2405 | break; |
2406 | case RISCVVector::BI__builtin_rvv_vfwadd_wv_tuma: |
2407 | case RISCVVector::BI__builtin_rvv_vfwadd_wf_tuma: |
2408 | ID = Intrinsic::riscv_vfwadd_w_mask; |
2409 | DefaultPolicy = 2; |
2410 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2411 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2412 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2413 | break; |
2414 | case RISCVVector::BI__builtin_rvv_vfwadd_wv_tama: |
2415 | case RISCVVector::BI__builtin_rvv_vfwadd_wf_tama: |
2416 | ID = Intrinsic::riscv_vfwadd_w_mask; |
2417 | DefaultPolicy = 3; |
2418 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2419 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2420 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2421 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2422 | break; |
2423 | case RISCVVector::BI__builtin_rvv_vfwadd_wv_tumu: |
2424 | case RISCVVector::BI__builtin_rvv_vfwadd_wf_tumu: |
2425 | ID = Intrinsic::riscv_vfwadd_w_mask; |
2426 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2427 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2428 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2429 | break; |
2430 | case RISCVVector::BI__builtin_rvv_vfwadd_wv_tamu: |
2431 | case RISCVVector::BI__builtin_rvv_vfwadd_wf_tamu: |
2432 | ID = Intrinsic::riscv_vfwadd_w_mask; |
2433 | DefaultPolicy = 1; |
2434 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2435 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2436 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
2437 | break; |
2438 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_f_v_tu: |
2439 | ID = Intrinsic::riscv_vfwcvt_f_f_v; |
2440 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2441 | break; |
2442 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_f_v_ta: |
2443 | ID = Intrinsic::riscv_vfwcvt_f_f_v; |
2444 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2445 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2446 | break; |
2447 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_f_v_tuma: |
2448 | ID = Intrinsic::riscv_vfwcvt_f_f_v_mask; |
2449 | DefaultPolicy = 2; |
2450 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2451 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2452 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2453 | break; |
2454 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_f_v_tama: |
2455 | ID = Intrinsic::riscv_vfwcvt_f_f_v_mask; |
2456 | DefaultPolicy = 3; |
2457 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2458 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2459 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2460 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2461 | break; |
2462 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_f_v_tumu: |
2463 | ID = Intrinsic::riscv_vfwcvt_f_f_v_mask; |
2464 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2465 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2466 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2467 | break; |
2468 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_f_v_tamu: |
2469 | ID = Intrinsic::riscv_vfwcvt_f_f_v_mask; |
2470 | DefaultPolicy = 1; |
2471 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2472 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2473 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2474 | break; |
2475 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_x_v_tu: |
2476 | ID = Intrinsic::riscv_vfwcvt_f_x_v; |
2477 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2478 | break; |
2479 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_x_v_ta: |
2480 | ID = Intrinsic::riscv_vfwcvt_f_x_v; |
2481 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2482 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2483 | break; |
2484 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_x_v_tuma: |
2485 | ID = Intrinsic::riscv_vfwcvt_f_x_v_mask; |
2486 | DefaultPolicy = 2; |
2487 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2488 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2489 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2490 | break; |
2491 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_x_v_tama: |
2492 | ID = Intrinsic::riscv_vfwcvt_f_x_v_mask; |
2493 | DefaultPolicy = 3; |
2494 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2495 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2496 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2497 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2498 | break; |
2499 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_x_v_tumu: |
2500 | ID = Intrinsic::riscv_vfwcvt_f_x_v_mask; |
2501 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2502 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2503 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2504 | break; |
2505 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_x_v_tamu: |
2506 | ID = Intrinsic::riscv_vfwcvt_f_x_v_mask; |
2507 | DefaultPolicy = 1; |
2508 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2509 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2510 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2511 | break; |
2512 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_xu_v_tu: |
2513 | ID = Intrinsic::riscv_vfwcvt_f_xu_v; |
2514 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2515 | break; |
2516 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_xu_v_ta: |
2517 | ID = Intrinsic::riscv_vfwcvt_f_xu_v; |
2518 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2519 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2520 | break; |
2521 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_xu_v_tuma: |
2522 | ID = Intrinsic::riscv_vfwcvt_f_xu_v_mask; |
2523 | DefaultPolicy = 2; |
2524 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2525 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2526 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2527 | break; |
2528 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_xu_v_tama: |
2529 | ID = Intrinsic::riscv_vfwcvt_f_xu_v_mask; |
2530 | DefaultPolicy = 3; |
2531 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2532 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2533 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2534 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2535 | break; |
2536 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_xu_v_tumu: |
2537 | ID = Intrinsic::riscv_vfwcvt_f_xu_v_mask; |
2538 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2539 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2540 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2541 | break; |
2542 | case RISCVVector::BI__builtin_rvv_vfwcvt_f_xu_v_tamu: |
2543 | ID = Intrinsic::riscv_vfwcvt_f_xu_v_mask; |
2544 | DefaultPolicy = 1; |
2545 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2546 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2547 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2548 | break; |
2549 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_x_f_v_tu: |
2550 | ID = Intrinsic::riscv_vfwcvt_rtz_x_f_v; |
2551 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2552 | break; |
2553 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_x_f_v_ta: |
2554 | ID = Intrinsic::riscv_vfwcvt_rtz_x_f_v; |
2555 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2556 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2557 | break; |
2558 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_x_f_v_tuma: |
2559 | ID = Intrinsic::riscv_vfwcvt_rtz_x_f_v_mask; |
2560 | DefaultPolicy = 2; |
2561 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2562 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2563 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2564 | break; |
2565 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_x_f_v_tama: |
2566 | ID = Intrinsic::riscv_vfwcvt_rtz_x_f_v_mask; |
2567 | DefaultPolicy = 3; |
2568 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2569 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2570 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2571 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2572 | break; |
2573 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_x_f_v_tumu: |
2574 | ID = Intrinsic::riscv_vfwcvt_rtz_x_f_v_mask; |
2575 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2576 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2577 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2578 | break; |
2579 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_x_f_v_tamu: |
2580 | ID = Intrinsic::riscv_vfwcvt_rtz_x_f_v_mask; |
2581 | DefaultPolicy = 1; |
2582 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2583 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2584 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2585 | break; |
2586 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_xu_f_v_tu: |
2587 | ID = Intrinsic::riscv_vfwcvt_rtz_xu_f_v; |
2588 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2589 | break; |
2590 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_xu_f_v_ta: |
2591 | ID = Intrinsic::riscv_vfwcvt_rtz_xu_f_v; |
2592 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2593 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2594 | break; |
2595 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_xu_f_v_tuma: |
2596 | ID = Intrinsic::riscv_vfwcvt_rtz_xu_f_v_mask; |
2597 | DefaultPolicy = 2; |
2598 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2599 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2600 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2601 | break; |
2602 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_xu_f_v_tama: |
2603 | ID = Intrinsic::riscv_vfwcvt_rtz_xu_f_v_mask; |
2604 | DefaultPolicy = 3; |
2605 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2606 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2607 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2608 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2609 | break; |
2610 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_xu_f_v_tumu: |
2611 | ID = Intrinsic::riscv_vfwcvt_rtz_xu_f_v_mask; |
2612 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2613 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2614 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2615 | break; |
2616 | case RISCVVector::BI__builtin_rvv_vfwcvt_rtz_xu_f_v_tamu: |
2617 | ID = Intrinsic::riscv_vfwcvt_rtz_xu_f_v_mask; |
2618 | DefaultPolicy = 1; |
2619 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2620 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2621 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2622 | break; |
2623 | case RISCVVector::BI__builtin_rvv_vfwcvt_x_f_v_tu: |
2624 | ID = Intrinsic::riscv_vfwcvt_x_f_v; |
2625 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2626 | break; |
2627 | case RISCVVector::BI__builtin_rvv_vfwcvt_x_f_v_ta: |
2628 | ID = Intrinsic::riscv_vfwcvt_x_f_v; |
2629 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2630 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2631 | break; |
2632 | case RISCVVector::BI__builtin_rvv_vfwcvt_x_f_v_tuma: |
2633 | ID = Intrinsic::riscv_vfwcvt_x_f_v_mask; |
2634 | DefaultPolicy = 2; |
2635 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2636 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2637 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2638 | break; |
2639 | case RISCVVector::BI__builtin_rvv_vfwcvt_x_f_v_tama: |
2640 | ID = Intrinsic::riscv_vfwcvt_x_f_v_mask; |
2641 | DefaultPolicy = 3; |
2642 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2643 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2644 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2645 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2646 | break; |
2647 | case RISCVVector::BI__builtin_rvv_vfwcvt_x_f_v_tumu: |
2648 | ID = Intrinsic::riscv_vfwcvt_x_f_v_mask; |
2649 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2650 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2651 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2652 | break; |
2653 | case RISCVVector::BI__builtin_rvv_vfwcvt_x_f_v_tamu: |
2654 | ID = Intrinsic::riscv_vfwcvt_x_f_v_mask; |
2655 | DefaultPolicy = 1; |
2656 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2657 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2658 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2659 | break; |
2660 | case RISCVVector::BI__builtin_rvv_vfwcvt_xu_f_v_tu: |
2661 | ID = Intrinsic::riscv_vfwcvt_xu_f_v; |
2662 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2663 | break; |
2664 | case RISCVVector::BI__builtin_rvv_vfwcvt_xu_f_v_ta: |
2665 | ID = Intrinsic::riscv_vfwcvt_xu_f_v; |
2666 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2667 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2668 | break; |
2669 | case RISCVVector::BI__builtin_rvv_vfwcvt_xu_f_v_tuma: |
2670 | ID = Intrinsic::riscv_vfwcvt_xu_f_v_mask; |
2671 | DefaultPolicy = 2; |
2672 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2673 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2674 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2675 | break; |
2676 | case RISCVVector::BI__builtin_rvv_vfwcvt_xu_f_v_tama: |
2677 | ID = Intrinsic::riscv_vfwcvt_xu_f_v_mask; |
2678 | DefaultPolicy = 3; |
2679 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2680 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2681 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2682 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2683 | break; |
2684 | case RISCVVector::BI__builtin_rvv_vfwcvt_xu_f_v_tumu: |
2685 | ID = Intrinsic::riscv_vfwcvt_xu_f_v_mask; |
2686 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2687 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2688 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2689 | break; |
2690 | case RISCVVector::BI__builtin_rvv_vfwcvt_xu_f_v_tamu: |
2691 | ID = Intrinsic::riscv_vfwcvt_xu_f_v_mask; |
2692 | DefaultPolicy = 1; |
2693 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2694 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2695 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2696 | break; |
2697 | case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tu: |
2698 | case RISCVVector::BI__builtin_rvv_vfwmacc_vf_tu: |
2699 | ID = Intrinsic::riscv_vfwmacc; |
2700 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2701 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2702 | break; |
2703 | case RISCVVector::BI__builtin_rvv_vfwmacc_vv_ta: |
2704 | case RISCVVector::BI__builtin_rvv_vfwmacc_vf_ta: |
2705 | ID = Intrinsic::riscv_vfwmacc; |
2706 | DefaultPolicy = 1; |
2707 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2708 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2709 | break; |
2710 | case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tuma: |
2711 | case RISCVVector::BI__builtin_rvv_vfwmacc_vf_tuma: |
2712 | ID = Intrinsic::riscv_vfwmacc_mask; |
2713 | DefaultPolicy = 2; |
2714 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2715 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2716 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2717 | break; |
2718 | case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tama: |
2719 | case RISCVVector::BI__builtin_rvv_vfwmacc_vf_tama: |
2720 | ID = Intrinsic::riscv_vfwmacc_mask; |
2721 | DefaultPolicy = 3; |
2722 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2723 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2724 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2725 | break; |
2726 | case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tumu: |
2727 | case RISCVVector::BI__builtin_rvv_vfwmacc_vf_tumu: |
2728 | ID = Intrinsic::riscv_vfwmacc_mask; |
2729 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2730 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2731 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2732 | break; |
2733 | case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tamu: |
2734 | case RISCVVector::BI__builtin_rvv_vfwmacc_vf_tamu: |
2735 | ID = Intrinsic::riscv_vfwmacc_mask; |
2736 | DefaultPolicy = 1; |
2737 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2738 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2739 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2740 | break; |
2741 | case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tu: |
2742 | case RISCVVector::BI__builtin_rvv_vfwmsac_vf_tu: |
2743 | ID = Intrinsic::riscv_vfwmsac; |
2744 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2745 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2746 | break; |
2747 | case RISCVVector::BI__builtin_rvv_vfwmsac_vv_ta: |
2748 | case RISCVVector::BI__builtin_rvv_vfwmsac_vf_ta: |
2749 | ID = Intrinsic::riscv_vfwmsac; |
2750 | DefaultPolicy = 1; |
2751 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2752 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2753 | break; |
2754 | case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tuma: |
2755 | case RISCVVector::BI__builtin_rvv_vfwmsac_vf_tuma: |
2756 | ID = Intrinsic::riscv_vfwmsac_mask; |
2757 | DefaultPolicy = 2; |
2758 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2759 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2760 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2761 | break; |
2762 | case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tama: |
2763 | case RISCVVector::BI__builtin_rvv_vfwmsac_vf_tama: |
2764 | ID = Intrinsic::riscv_vfwmsac_mask; |
2765 | DefaultPolicy = 3; |
2766 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2767 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2768 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2769 | break; |
2770 | case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tumu: |
2771 | case RISCVVector::BI__builtin_rvv_vfwmsac_vf_tumu: |
2772 | ID = Intrinsic::riscv_vfwmsac_mask; |
2773 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2774 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2775 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2776 | break; |
2777 | case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tamu: |
2778 | case RISCVVector::BI__builtin_rvv_vfwmsac_vf_tamu: |
2779 | ID = Intrinsic::riscv_vfwmsac_mask; |
2780 | DefaultPolicy = 1; |
2781 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2782 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2783 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2784 | break; |
2785 | case RISCVVector::BI__builtin_rvv_vfwmul_vv_tu: |
2786 | case RISCVVector::BI__builtin_rvv_vfwmul_vf_tu: |
2787 | ID = Intrinsic::riscv_vfwmul; |
2788 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2789 | break; |
2790 | case RISCVVector::BI__builtin_rvv_vfwmul_vv_ta: |
2791 | case RISCVVector::BI__builtin_rvv_vfwmul_vf_ta: |
2792 | ID = Intrinsic::riscv_vfwmul; |
2793 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2794 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2795 | break; |
2796 | case RISCVVector::BI__builtin_rvv_vfwmul_vv_tuma: |
2797 | case RISCVVector::BI__builtin_rvv_vfwmul_vf_tuma: |
2798 | ID = Intrinsic::riscv_vfwmul_mask; |
2799 | DefaultPolicy = 2; |
2800 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2801 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2802 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2803 | break; |
2804 | case RISCVVector::BI__builtin_rvv_vfwmul_vv_tama: |
2805 | case RISCVVector::BI__builtin_rvv_vfwmul_vf_tama: |
2806 | ID = Intrinsic::riscv_vfwmul_mask; |
2807 | DefaultPolicy = 3; |
2808 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2809 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2810 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2811 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2812 | break; |
2813 | case RISCVVector::BI__builtin_rvv_vfwmul_vv_tumu: |
2814 | case RISCVVector::BI__builtin_rvv_vfwmul_vf_tumu: |
2815 | ID = Intrinsic::riscv_vfwmul_mask; |
2816 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2817 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2818 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2819 | break; |
2820 | case RISCVVector::BI__builtin_rvv_vfwmul_vv_tamu: |
2821 | case RISCVVector::BI__builtin_rvv_vfwmul_vf_tamu: |
2822 | ID = Intrinsic::riscv_vfwmul_mask; |
2823 | DefaultPolicy = 1; |
2824 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2825 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2826 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2827 | break; |
2828 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tu: |
2829 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vf_tu: |
2830 | ID = Intrinsic::riscv_vfwnmacc; |
2831 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2832 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2833 | break; |
2834 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_ta: |
2835 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vf_ta: |
2836 | ID = Intrinsic::riscv_vfwnmacc; |
2837 | DefaultPolicy = 1; |
2838 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2839 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2840 | break; |
2841 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tuma: |
2842 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vf_tuma: |
2843 | ID = Intrinsic::riscv_vfwnmacc_mask; |
2844 | DefaultPolicy = 2; |
2845 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2846 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2847 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2848 | break; |
2849 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tama: |
2850 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vf_tama: |
2851 | ID = Intrinsic::riscv_vfwnmacc_mask; |
2852 | DefaultPolicy = 3; |
2853 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2854 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2855 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2856 | break; |
2857 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tumu: |
2858 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vf_tumu: |
2859 | ID = Intrinsic::riscv_vfwnmacc_mask; |
2860 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2861 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2862 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2863 | break; |
2864 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tamu: |
2865 | case RISCVVector::BI__builtin_rvv_vfwnmacc_vf_tamu: |
2866 | ID = Intrinsic::riscv_vfwnmacc_mask; |
2867 | DefaultPolicy = 1; |
2868 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2869 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2870 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2871 | break; |
2872 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tu: |
2873 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vf_tu: |
2874 | ID = Intrinsic::riscv_vfwnmsac; |
2875 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2876 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2877 | break; |
2878 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_ta: |
2879 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vf_ta: |
2880 | ID = Intrinsic::riscv_vfwnmsac; |
2881 | DefaultPolicy = 1; |
2882 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2883 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2884 | break; |
2885 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tuma: |
2886 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vf_tuma: |
2887 | ID = Intrinsic::riscv_vfwnmsac_mask; |
2888 | DefaultPolicy = 2; |
2889 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2890 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2891 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2892 | break; |
2893 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tama: |
2894 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vf_tama: |
2895 | ID = Intrinsic::riscv_vfwnmsac_mask; |
2896 | DefaultPolicy = 3; |
2897 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2898 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2899 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2900 | break; |
2901 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tumu: |
2902 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vf_tumu: |
2903 | ID = Intrinsic::riscv_vfwnmsac_mask; |
2904 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2905 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2906 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2907 | break; |
2908 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tamu: |
2909 | case RISCVVector::BI__builtin_rvv_vfwnmsac_vf_tamu: |
2910 | ID = Intrinsic::riscv_vfwnmsac_mask; |
2911 | DefaultPolicy = 1; |
2912 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2913 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2914 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2915 | break; |
2916 | case RISCVVector::BI__builtin_rvv_vfwredosum_vs_tu: |
2917 | ID = Intrinsic::riscv_vfwredosum; |
2918 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2919 | break; |
2920 | case RISCVVector::BI__builtin_rvv_vfwredosum_vs_ta: |
2921 | ID = Intrinsic::riscv_vfwredosum; |
2922 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2923 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2924 | break; |
2925 | case RISCVVector::BI__builtin_rvv_vfwredosum_vs_tum: |
2926 | ID = Intrinsic::riscv_vfwredosum_mask; |
2927 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2928 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2929 | break; |
2930 | case RISCVVector::BI__builtin_rvv_vfwredosum_vs_tam: |
2931 | ID = Intrinsic::riscv_vfwredosum_mask; |
2932 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2933 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2934 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2935 | break; |
2936 | case RISCVVector::BI__builtin_rvv_vfwredosum_vs_tumu: |
2937 | ID = Intrinsic::riscv_vfwredosum_mask; |
2938 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2939 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2940 | break; |
2941 | case RISCVVector::BI__builtin_rvv_vfwredusum_vs_tu: |
2942 | ID = Intrinsic::riscv_vfwredusum; |
2943 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2944 | break; |
2945 | case RISCVVector::BI__builtin_rvv_vfwredusum_vs_ta: |
2946 | ID = Intrinsic::riscv_vfwredusum; |
2947 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2948 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2949 | break; |
2950 | case RISCVVector::BI__builtin_rvv_vfwredusum_vs_tum: |
2951 | ID = Intrinsic::riscv_vfwredusum_mask; |
2952 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2953 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2954 | break; |
2955 | case RISCVVector::BI__builtin_rvv_vfwredusum_vs_tam: |
2956 | ID = Intrinsic::riscv_vfwredusum_mask; |
2957 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2958 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2959 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2960 | break; |
2961 | case RISCVVector::BI__builtin_rvv_vfwredusum_vs_tumu: |
2962 | ID = Intrinsic::riscv_vfwredusum_mask; |
2963 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2964 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
2965 | break; |
2966 | case RISCVVector::BI__builtin_rvv_vfwsub_vv_tu: |
2967 | case RISCVVector::BI__builtin_rvv_vfwsub_vf_tu: |
2968 | ID = Intrinsic::riscv_vfwsub; |
2969 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2970 | break; |
2971 | case RISCVVector::BI__builtin_rvv_vfwsub_vv_ta: |
2972 | case RISCVVector::BI__builtin_rvv_vfwsub_vf_ta: |
2973 | ID = Intrinsic::riscv_vfwsub; |
2974 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2975 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2976 | break; |
2977 | case RISCVVector::BI__builtin_rvv_vfwsub_vv_tuma: |
2978 | case RISCVVector::BI__builtin_rvv_vfwsub_vf_tuma: |
2979 | ID = Intrinsic::riscv_vfwsub_mask; |
2980 | DefaultPolicy = 2; |
2981 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2982 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2983 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2984 | break; |
2985 | case RISCVVector::BI__builtin_rvv_vfwsub_vv_tama: |
2986 | case RISCVVector::BI__builtin_rvv_vfwsub_vf_tama: |
2987 | ID = Intrinsic::riscv_vfwsub_mask; |
2988 | DefaultPolicy = 3; |
2989 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2990 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2991 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
2992 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
2993 | break; |
2994 | case RISCVVector::BI__builtin_rvv_vfwsub_vv_tumu: |
2995 | case RISCVVector::BI__builtin_rvv_vfwsub_vf_tumu: |
2996 | ID = Intrinsic::riscv_vfwsub_mask; |
2997 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
2998 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
2999 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
3000 | break; |
3001 | case RISCVVector::BI__builtin_rvv_vfwsub_vv_tamu: |
3002 | case RISCVVector::BI__builtin_rvv_vfwsub_vf_tamu: |
3003 | ID = Intrinsic::riscv_vfwsub_mask; |
3004 | DefaultPolicy = 1; |
3005 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3006 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3007 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
3008 | break; |
3009 | case RISCVVector::BI__builtin_rvv_vfwsub_wv_tu: |
3010 | case RISCVVector::BI__builtin_rvv_vfwsub_wf_tu: |
3011 | ID = Intrinsic::riscv_vfwsub_w; |
3012 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3013 | break; |
3014 | case RISCVVector::BI__builtin_rvv_vfwsub_wv_ta: |
3015 | case RISCVVector::BI__builtin_rvv_vfwsub_wf_ta: |
3016 | ID = Intrinsic::riscv_vfwsub_w; |
3017 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3018 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3019 | break; |
3020 | case RISCVVector::BI__builtin_rvv_vfwsub_wv_tuma: |
3021 | case RISCVVector::BI__builtin_rvv_vfwsub_wf_tuma: |
3022 | ID = Intrinsic::riscv_vfwsub_w_mask; |
3023 | DefaultPolicy = 2; |
3024 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3025 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3026 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3027 | break; |
3028 | case RISCVVector::BI__builtin_rvv_vfwsub_wv_tama: |
3029 | case RISCVVector::BI__builtin_rvv_vfwsub_wf_tama: |
3030 | ID = Intrinsic::riscv_vfwsub_w_mask; |
3031 | DefaultPolicy = 3; |
3032 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3033 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3034 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3035 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3036 | break; |
3037 | case RISCVVector::BI__builtin_rvv_vfwsub_wv_tumu: |
3038 | case RISCVVector::BI__builtin_rvv_vfwsub_wf_tumu: |
3039 | ID = Intrinsic::riscv_vfwsub_w_mask; |
3040 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3041 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3042 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3043 | break; |
3044 | case RISCVVector::BI__builtin_rvv_vfwsub_wv_tamu: |
3045 | case RISCVVector::BI__builtin_rvv_vfwsub_wf_tamu: |
3046 | ID = Intrinsic::riscv_vfwsub_w_mask; |
3047 | DefaultPolicy = 1; |
3048 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3049 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3050 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3051 | break; |
3052 | case RISCVVector::BI__builtin_rvv_vid_v_tu: |
3053 | ID = Intrinsic::riscv_vid; |
3054 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3055 | break; |
3056 | case RISCVVector::BI__builtin_rvv_vid_v_ta: |
3057 | ID = Intrinsic::riscv_vid; |
3058 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3059 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3060 | break; |
3061 | case RISCVVector::BI__builtin_rvv_vid_v_tuma: |
3062 | ID = Intrinsic::riscv_vid_mask; |
3063 | DefaultPolicy = 2; |
3064 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3065 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3066 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3067 | break; |
3068 | case RISCVVector::BI__builtin_rvv_vid_v_tama: |
3069 | ID = Intrinsic::riscv_vid_mask; |
3070 | DefaultPolicy = 3; |
3071 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3072 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3073 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3074 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3075 | break; |
3076 | case RISCVVector::BI__builtin_rvv_vid_v_tumu: |
3077 | ID = Intrinsic::riscv_vid_mask; |
3078 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3079 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3080 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3081 | break; |
3082 | case RISCVVector::BI__builtin_rvv_vid_v_tamu: |
3083 | ID = Intrinsic::riscv_vid_mask; |
3084 | DefaultPolicy = 1; |
3085 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3086 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3087 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3088 | break; |
3089 | case RISCVVector::BI__builtin_rvv_viota_m_tu: |
3090 | ID = Intrinsic::riscv_viota; |
3091 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3092 | break; |
3093 | case RISCVVector::BI__builtin_rvv_viota_m_ta: |
3094 | ID = Intrinsic::riscv_viota; |
3095 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3096 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3097 | break; |
3098 | case RISCVVector::BI__builtin_rvv_viota_m_tuma: |
3099 | ID = Intrinsic::riscv_viota_mask; |
3100 | DefaultPolicy = 2; |
3101 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3102 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3103 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3104 | break; |
3105 | case RISCVVector::BI__builtin_rvv_viota_m_tama: |
3106 | ID = Intrinsic::riscv_viota_mask; |
3107 | DefaultPolicy = 3; |
3108 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3109 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3110 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3111 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3112 | break; |
3113 | case RISCVVector::BI__builtin_rvv_viota_m_tumu: |
3114 | ID = Intrinsic::riscv_viota_mask; |
3115 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3116 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3117 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3118 | break; |
3119 | case RISCVVector::BI__builtin_rvv_viota_m_tamu: |
3120 | ID = Intrinsic::riscv_viota_mask; |
3121 | DefaultPolicy = 1; |
3122 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3123 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3124 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3125 | break; |
3126 | case RISCVVector::BI__builtin_rvv_vle8_v_tu: |
3127 | case RISCVVector::BI__builtin_rvv_vle16_v_tu: |
3128 | case RISCVVector::BI__builtin_rvv_vle32_v_tu: |
3129 | case RISCVVector::BI__builtin_rvv_vle64_v_tu: |
3130 | ID = Intrinsic::riscv_vle; |
3131 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3132 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3133 | break; |
3134 | case RISCVVector::BI__builtin_rvv_vle8_v_ta: |
3135 | case RISCVVector::BI__builtin_rvv_vle16_v_ta: |
3136 | case RISCVVector::BI__builtin_rvv_vle32_v_ta: |
3137 | case RISCVVector::BI__builtin_rvv_vle64_v_ta: |
3138 | ID = Intrinsic::riscv_vle; |
3139 | Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); |
3140 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3141 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3142 | break; |
3143 | case RISCVVector::BI__builtin_rvv_vle8_v_tuma: |
3144 | case RISCVVector::BI__builtin_rvv_vle16_v_tuma: |
3145 | case RISCVVector::BI__builtin_rvv_vle32_v_tuma: |
3146 | case RISCVVector::BI__builtin_rvv_vle64_v_tuma: |
3147 | ID = Intrinsic::riscv_vle_mask; |
3148 | DefaultPolicy = 2; |
3149 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
3150 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3151 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3152 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3153 | break; |
3154 | case RISCVVector::BI__builtin_rvv_vle8_v_tama: |
3155 | case RISCVVector::BI__builtin_rvv_vle16_v_tama: |
3156 | case RISCVVector::BI__builtin_rvv_vle32_v_tama: |
3157 | case RISCVVector::BI__builtin_rvv_vle64_v_tama: |
3158 | ID = Intrinsic::riscv_vle_mask; |
3159 | DefaultPolicy = 3; |
3160 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3161 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3162 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3163 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3164 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3165 | break; |
3166 | case RISCVVector::BI__builtin_rvv_vle8_v_tumu: |
3167 | case RISCVVector::BI__builtin_rvv_vle16_v_tumu: |
3168 | case RISCVVector::BI__builtin_rvv_vle32_v_tumu: |
3169 | case RISCVVector::BI__builtin_rvv_vle64_v_tumu: |
3170 | ID = Intrinsic::riscv_vle_mask; |
3171 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
3172 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3173 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3174 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3175 | break; |
3176 | case RISCVVector::BI__builtin_rvv_vle8_v_tamu: |
3177 | case RISCVVector::BI__builtin_rvv_vle16_v_tamu: |
3178 | case RISCVVector::BI__builtin_rvv_vle32_v_tamu: |
3179 | case RISCVVector::BI__builtin_rvv_vle64_v_tamu: |
3180 | ID = Intrinsic::riscv_vle_mask; |
3181 | DefaultPolicy = 1; |
3182 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
3183 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3184 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3185 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3186 | break; |
3187 | case RISCVVector::BI__builtin_rvv_vle16ff_v_tu: |
3188 | case RISCVVector::BI__builtin_rvv_vle32ff_v_tu: |
3189 | case RISCVVector::BI__builtin_rvv_vle64ff_v_tu: |
3190 | case RISCVVector::BI__builtin_rvv_vle8ff_v_tu: |
3191 | ID = Intrinsic::riscv_vleff; |
3192 | DefaultPolicy = 0; |
3193 | |
3194 | { |
3195 | if (DefaultPolicy == TAIL_AGNOSTIC) |
3196 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
3197 | IntrinsicTypes = {ResultType, Ops[3]->getType()}; |
3198 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3199 | Value *NewVL = Ops[2]; |
3200 | Ops.erase(Ops.begin() + 2); |
3201 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3202 | llvm::Value *LoadValue = Builder.CreateCall(F, Ops, ""); |
3203 | llvm::Value *V = Builder.CreateExtractValue(LoadValue, {0}); |
3204 | // Store new_vl. |
3205 | clang::CharUnits Align = |
3206 | CGM.getNaturalPointeeTypeAlignment(E->getArg(1)->getType()); |
3207 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1}); |
3208 | Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
3209 | return V; |
3210 | } |
3211 | break; |
3212 | case RISCVVector::BI__builtin_rvv_vle16ff_v_ta: |
3213 | case RISCVVector::BI__builtin_rvv_vle32ff_v_ta: |
3214 | case RISCVVector::BI__builtin_rvv_vle64ff_v_ta: |
3215 | case RISCVVector::BI__builtin_rvv_vle8ff_v_ta: |
3216 | ID = Intrinsic::riscv_vleff; |
3217 | DefaultPolicy = 1; |
3218 | |
3219 | { |
3220 | if (DefaultPolicy == TAIL_AGNOSTIC) |
3221 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
3222 | IntrinsicTypes = {ResultType, Ops[3]->getType()}; |
3223 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3224 | Value *NewVL = Ops[2]; |
3225 | Ops.erase(Ops.begin() + 2); |
3226 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3227 | llvm::Value *LoadValue = Builder.CreateCall(F, Ops, ""); |
3228 | llvm::Value *V = Builder.CreateExtractValue(LoadValue, {0}); |
3229 | // Store new_vl. |
3230 | clang::CharUnits Align = |
3231 | CGM.getNaturalPointeeTypeAlignment(E->getArg(1)->getType()); |
3232 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1}); |
3233 | Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
3234 | return V; |
3235 | } |
3236 | break; |
3237 | case RISCVVector::BI__builtin_rvv_vle16ff_v_tuma: |
3238 | case RISCVVector::BI__builtin_rvv_vle32ff_v_tuma: |
3239 | case RISCVVector::BI__builtin_rvv_vle64ff_v_tuma: |
3240 | case RISCVVector::BI__builtin_rvv_vle8ff_v_tuma: |
3241 | ID = Intrinsic::riscv_vleff_mask; |
3242 | DefaultPolicy = 2; |
3243 | |
3244 | { |
3245 | // Move mask to right before vl. |
3246 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3247 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
3248 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
3249 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3250 | IntrinsicTypes = {ResultType, Ops[4]->getType()}; |
3251 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3252 | Value *NewVL = Ops[2]; |
3253 | Ops.erase(Ops.begin() + 2); |
3254 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3255 | llvm::Value *LoadValue = Builder.CreateCall(F, Ops, ""); |
3256 | llvm::Value *V = Builder.CreateExtractValue(LoadValue, {0}); |
3257 | // Store new_vl. |
3258 | clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment( |
3259 | E->getArg(E->getNumArgs()-2)->getType()); |
3260 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1}); |
3261 | Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
3262 | return V; |
3263 | } |
3264 | break; |
3265 | case RISCVVector::BI__builtin_rvv_vle16ff_v_tama: |
3266 | case RISCVVector::BI__builtin_rvv_vle32ff_v_tama: |
3267 | case RISCVVector::BI__builtin_rvv_vle64ff_v_tama: |
3268 | case RISCVVector::BI__builtin_rvv_vle8ff_v_tama: |
3269 | ID = Intrinsic::riscv_vleff_mask; |
3270 | DefaultPolicy = 3; |
3271 | |
3272 | { |
3273 | // Move mask to right before vl. |
3274 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3275 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
3276 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
3277 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3278 | IntrinsicTypes = {ResultType, Ops[4]->getType()}; |
3279 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3280 | Value *NewVL = Ops[2]; |
3281 | Ops.erase(Ops.begin() + 2); |
3282 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3283 | llvm::Value *LoadValue = Builder.CreateCall(F, Ops, ""); |
3284 | llvm::Value *V = Builder.CreateExtractValue(LoadValue, {0}); |
3285 | // Store new_vl. |
3286 | clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment( |
3287 | E->getArg(E->getNumArgs()-2)->getType()); |
3288 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1}); |
3289 | Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
3290 | return V; |
3291 | } |
3292 | break; |
3293 | case RISCVVector::BI__builtin_rvv_vle16ff_v_tumu: |
3294 | case RISCVVector::BI__builtin_rvv_vle32ff_v_tumu: |
3295 | case RISCVVector::BI__builtin_rvv_vle64ff_v_tumu: |
3296 | case RISCVVector::BI__builtin_rvv_vle8ff_v_tumu: |
3297 | ID = Intrinsic::riscv_vleff_mask; |
3298 | DefaultPolicy = 0; |
3299 | |
3300 | { |
3301 | // Move mask to right before vl. |
3302 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3303 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
3304 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
3305 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3306 | IntrinsicTypes = {ResultType, Ops[4]->getType()}; |
3307 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3308 | Value *NewVL = Ops[2]; |
3309 | Ops.erase(Ops.begin() + 2); |
3310 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3311 | llvm::Value *LoadValue = Builder.CreateCall(F, Ops, ""); |
3312 | llvm::Value *V = Builder.CreateExtractValue(LoadValue, {0}); |
3313 | // Store new_vl. |
3314 | clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment( |
3315 | E->getArg(E->getNumArgs()-2)->getType()); |
3316 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1}); |
3317 | Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
3318 | return V; |
3319 | } |
3320 | break; |
3321 | case RISCVVector::BI__builtin_rvv_vle16ff_v_tamu: |
3322 | case RISCVVector::BI__builtin_rvv_vle32ff_v_tamu: |
3323 | case RISCVVector::BI__builtin_rvv_vle64ff_v_tamu: |
3324 | case RISCVVector::BI__builtin_rvv_vle8ff_v_tamu: |
3325 | ID = Intrinsic::riscv_vleff_mask; |
3326 | DefaultPolicy = 1; |
3327 | |
3328 | { |
3329 | // Move mask to right before vl. |
3330 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3331 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
3332 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
3333 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3334 | IntrinsicTypes = {ResultType, Ops[4]->getType()}; |
3335 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3336 | Value *NewVL = Ops[2]; |
3337 | Ops.erase(Ops.begin() + 2); |
3338 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3339 | llvm::Value *LoadValue = Builder.CreateCall(F, Ops, ""); |
3340 | llvm::Value *V = Builder.CreateExtractValue(LoadValue, {0}); |
3341 | // Store new_vl. |
3342 | clang::CharUnits Align = CGM.getNaturalPointeeTypeAlignment( |
3343 | E->getArg(E->getNumArgs()-2)->getType()); |
3344 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1}); |
3345 | Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
3346 | return V; |
3347 | } |
3348 | break; |
3349 | case RISCVVector::BI__builtin_rvv_vlm_v: |
3350 | ID = Intrinsic::riscv_vlm; |
3351 | DefaultPolicy = 1; |
3352 | Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); |
3353 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
3354 | break; |
3355 | case RISCVVector::BI__builtin_rvv_vloxei8_v_tu: |
3356 | case RISCVVector::BI__builtin_rvv_vloxei16_v_tu: |
3357 | case RISCVVector::BI__builtin_rvv_vloxei32_v_tu: |
3358 | case RISCVVector::BI__builtin_rvv_vloxei64_v_tu: |
3359 | ID = Intrinsic::riscv_vloxei; |
3360 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3361 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3362 | break; |
3363 | case RISCVVector::BI__builtin_rvv_vloxei8_v_ta: |
3364 | case RISCVVector::BI__builtin_rvv_vloxei16_v_ta: |
3365 | case RISCVVector::BI__builtin_rvv_vloxei32_v_ta: |
3366 | case RISCVVector::BI__builtin_rvv_vloxei64_v_ta: |
3367 | ID = Intrinsic::riscv_vloxei; |
3368 | Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); |
3369 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3370 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3371 | break; |
3372 | case RISCVVector::BI__builtin_rvv_vloxei8_v_tuma: |
3373 | case RISCVVector::BI__builtin_rvv_vloxei16_v_tuma: |
3374 | case RISCVVector::BI__builtin_rvv_vloxei32_v_tuma: |
3375 | case RISCVVector::BI__builtin_rvv_vloxei64_v_tuma: |
3376 | ID = Intrinsic::riscv_vloxei_mask; |
3377 | DefaultPolicy = 2; |
3378 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
3379 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3380 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3381 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3382 | break; |
3383 | case RISCVVector::BI__builtin_rvv_vloxei8_v_tama: |
3384 | case RISCVVector::BI__builtin_rvv_vloxei16_v_tama: |
3385 | case RISCVVector::BI__builtin_rvv_vloxei32_v_tama: |
3386 | case RISCVVector::BI__builtin_rvv_vloxei64_v_tama: |
3387 | ID = Intrinsic::riscv_vloxei_mask; |
3388 | DefaultPolicy = 3; |
3389 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
3390 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3391 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3392 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
3393 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3394 | break; |
3395 | case RISCVVector::BI__builtin_rvv_vloxei8_v_tumu: |
3396 | case RISCVVector::BI__builtin_rvv_vloxei16_v_tumu: |
3397 | case RISCVVector::BI__builtin_rvv_vloxei32_v_tumu: |
3398 | case RISCVVector::BI__builtin_rvv_vloxei64_v_tumu: |
3399 | ID = Intrinsic::riscv_vloxei_mask; |
3400 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
3401 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3402 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3403 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3404 | break; |
3405 | case RISCVVector::BI__builtin_rvv_vloxei8_v_tamu: |
3406 | case RISCVVector::BI__builtin_rvv_vloxei16_v_tamu: |
3407 | case RISCVVector::BI__builtin_rvv_vloxei32_v_tamu: |
3408 | case RISCVVector::BI__builtin_rvv_vloxei64_v_tamu: |
3409 | ID = Intrinsic::riscv_vloxei_mask; |
3410 | DefaultPolicy = 1; |
3411 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
3412 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
3413 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3414 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
3415 | break; |
3416 | case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tu: |
3417 | case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tu: |
3418 | case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tu: |
3419 | case RISCVVector::BI__builtin_rvv_vloxseg2ei8_v_tu: |
3420 | ID = Intrinsic::riscv_vloxseg2; |
3421 | NF = 2; |
3422 | DefaultPolicy = 0; |
3423 | |
3424 | { |
3425 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
3426 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
3427 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3428 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
3429 | SmallVector<llvm::Value*, 12> Operands; |
3430 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
3431 | for (unsigned I = 0; I < NF; ++I) |
3432 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3433 | Operands.push_back(Ops[NF]); |
3434 | Operands.push_back(Ops[NF + 1]); |
3435 | Operands.push_back(Ops[NF + 2]); |
3436 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
3437 | } else { |
3438 | for (unsigned I = 0; I < NF; ++I) |
3439 | Operands.push_back(Ops[NF + I]); |
3440 | Operands.push_back(Ops[2 * NF]); |
3441 | Operands.push_back(Ops[2 * NF + 1]); |
3442 | Operands.push_back(Ops[2 * NF + 2]); |
3443 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
3444 | } |
3445 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3446 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3447 | clang::CharUnits Align = |
3448 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3449 | llvm::Value *V; |
3450 | for (unsigned I = 0; I < NF; ++I) { |
3451 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3452 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3453 | } |
3454 | return V; |
3455 | } |
3456 | break; |
3457 | case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_ta: |
3458 | case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_ta: |
3459 | case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_ta: |
3460 | case RISCVVector::BI__builtin_rvv_vloxseg2ei8_v_ta: |
3461 | ID = Intrinsic::riscv_vloxseg2; |
3462 | NF = 2; |
3463 | DefaultPolicy = 1; |
3464 | |
3465 | { |
3466 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
3467 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
3468 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3469 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
3470 | SmallVector<llvm::Value*, 12> Operands; |
3471 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
3472 | for (unsigned I = 0; I < NF; ++I) |
3473 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3474 | Operands.push_back(Ops[NF]); |
3475 | Operands.push_back(Ops[NF + 1]); |
3476 | Operands.push_back(Ops[NF + 2]); |
3477 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
3478 | } else { |
3479 | for (unsigned I = 0; I < NF; ++I) |
3480 | Operands.push_back(Ops[NF + I]); |
3481 | Operands.push_back(Ops[2 * NF]); |
3482 | Operands.push_back(Ops[2 * NF + 1]); |
3483 | Operands.push_back(Ops[2 * NF + 2]); |
3484 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
3485 | } |
3486 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3487 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3488 | clang::CharUnits Align = |
3489 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3490 | llvm::Value *V; |
3491 | for (unsigned I = 0; I < NF; ++I) { |
3492 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3493 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3494 | } |
3495 | return V; |
3496 | } |
3497 | break; |
3498 | case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tuma: |
3499 | case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tuma: |
3500 | case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tuma: |
3501 | case RISCVVector::BI__builtin_rvv_vloxseg2ei8_v_tuma: |
3502 | ID = Intrinsic::riscv_vloxseg2_mask; |
3503 | NF = 2; |
3504 | DefaultPolicy = 2; |
3505 | |
3506 | { |
3507 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
3508 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
3509 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3510 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
3511 | SmallVector<llvm::Value*, 12> Operands; |
3512 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
3513 | for (unsigned I = 0; I < NF; ++I) |
3514 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3515 | Operands.push_back(Ops[NF + 1]); |
3516 | Operands.push_back(Ops[NF + 2]); |
3517 | Operands.push_back(Ops[NF]); |
3518 | Operands.push_back(Ops[NF + 3]); |
3519 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
3520 | } else { |
3521 | for (unsigned I = 0; I < NF; ++I) |
3522 | Operands.push_back(Ops[NF + I + 1]); |
3523 | Operands.push_back(Ops[2 * NF + 1]); |
3524 | Operands.push_back(Ops[2 * NF + 2]); |
3525 | Operands.push_back(Ops[NF]); |
3526 | Operands.push_back(Ops[2 * NF + 3]); |
3527 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
3528 | } |
3529 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3530 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 3530, __extension__ __PRETTY_FUNCTION__)); |
3531 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3532 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3533 | clang::CharUnits Align = |
3534 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3535 | llvm::Value *V; |
3536 | for (unsigned I = 0; I < NF; ++I) { |
3537 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3538 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3539 | } |
3540 | return V; |
3541 | } |
3542 | break; |
3543 | case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tama: |
3544 | case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tama: |
3545 | case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tama: |
3546 | case RISCVVector::BI__builtin_rvv_vloxseg2ei8_v_tama: |
3547 | ID = Intrinsic::riscv_vloxseg2_mask; |
3548 | NF = 2; |
3549 | DefaultPolicy = 3; |
3550 | |
3551 | { |
3552 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
3553 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
3554 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3555 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
3556 | SmallVector<llvm::Value*, 12> Operands; |
3557 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
3558 | for (unsigned I = 0; I < NF; ++I) |
3559 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3560 | Operands.push_back(Ops[NF + 1]); |
3561 | Operands.push_back(Ops[NF + 2]); |
3562 | Operands.push_back(Ops[NF]); |
3563 | Operands.push_back(Ops[NF + 3]); |
3564 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
3565 | } else { |
3566 | for (unsigned I = 0; I < NF; ++I) |
3567 | Operands.push_back(Ops[NF + I + 1]); |
3568 | Operands.push_back(Ops[2 * NF + 1]); |
3569 | Operands.push_back(Ops[2 * NF + 2]); |
3570 | Operands.push_back(Ops[NF]); |
3571 | Operands.push_back(Ops[2 * NF + 3]); |
3572 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
3573 | } |
3574 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3575 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 3575, __extension__ __PRETTY_FUNCTION__)); |
3576 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3577 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3578 | clang::CharUnits Align = |
3579 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3580 | llvm::Value *V; |
3581 | for (unsigned I = 0; I < NF; ++I) { |
3582 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3583 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3584 | } |
3585 | return V; |
3586 | } |
3587 | break; |
3588 | case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tumu: |
3589 | case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tumu: |
3590 | case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tumu: |
3591 | case RISCVVector::BI__builtin_rvv_vloxseg2ei8_v_tumu: |
3592 | ID = Intrinsic::riscv_vloxseg2_mask; |
3593 | NF = 2; |
3594 | DefaultPolicy = 0; |
3595 | |
3596 | { |
3597 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
3598 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
3599 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3600 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
3601 | SmallVector<llvm::Value*, 12> Operands; |
3602 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
3603 | for (unsigned I = 0; I < NF; ++I) |
3604 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3605 | Operands.push_back(Ops[NF + 1]); |
3606 | Operands.push_back(Ops[NF + 2]); |
3607 | Operands.push_back(Ops[NF]); |
3608 | Operands.push_back(Ops[NF + 3]); |
3609 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
3610 | } else { |
3611 | for (unsigned I = 0; I < NF; ++I) |
3612 | Operands.push_back(Ops[NF + I + 1]); |
3613 | Operands.push_back(Ops[2 * NF + 1]); |
3614 | Operands.push_back(Ops[2 * NF + 2]); |
3615 | Operands.push_back(Ops[NF]); |
3616 | Operands.push_back(Ops[2 * NF + 3]); |
3617 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
3618 | } |
3619 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3620 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 3620, __extension__ __PRETTY_FUNCTION__)); |
3621 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3622 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3623 | clang::CharUnits Align = |
3624 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3625 | llvm::Value *V; |
3626 | for (unsigned I = 0; I < NF; ++I) { |
3627 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3628 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3629 | } |
3630 | return V; |
3631 | } |
3632 | break; |
3633 | case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tamu: |
3634 | case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tamu: |
3635 | case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tamu: |
3636 | case RISCVVector::BI__builtin_rvv_vloxseg2ei8_v_tamu: |
3637 | ID = Intrinsic::riscv_vloxseg2_mask; |
3638 | NF = 2; |
3639 | DefaultPolicy = 1; |
3640 | |
3641 | { |
3642 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
3643 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
3644 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3645 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
3646 | SmallVector<llvm::Value*, 12> Operands; |
3647 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
3648 | for (unsigned I = 0; I < NF; ++I) |
3649 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3650 | Operands.push_back(Ops[NF + 1]); |
3651 | Operands.push_back(Ops[NF + 2]); |
3652 | Operands.push_back(Ops[NF]); |
3653 | Operands.push_back(Ops[NF + 3]); |
3654 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
3655 | } else { |
3656 | for (unsigned I = 0; I < NF; ++I) |
3657 | Operands.push_back(Ops[NF + I + 1]); |
3658 | Operands.push_back(Ops[2 * NF + 1]); |
3659 | Operands.push_back(Ops[2 * NF + 2]); |
3660 | Operands.push_back(Ops[NF]); |
3661 | Operands.push_back(Ops[2 * NF + 3]); |
3662 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
3663 | } |
3664 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3665 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 3665, __extension__ __PRETTY_FUNCTION__)); |
3666 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3667 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3668 | clang::CharUnits Align = |
3669 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3670 | llvm::Value *V; |
3671 | for (unsigned I = 0; I < NF; ++I) { |
3672 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3673 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3674 | } |
3675 | return V; |
3676 | } |
3677 | break; |
3678 | case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tu: |
3679 | case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tu: |
3680 | case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tu: |
3681 | case RISCVVector::BI__builtin_rvv_vloxseg3ei64_v_tu: |
3682 | ID = Intrinsic::riscv_vloxseg3; |
3683 | NF = 3; |
3684 | DefaultPolicy = 0; |
3685 | |
3686 | { |
3687 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
3688 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
3689 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3690 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
3691 | SmallVector<llvm::Value*, 12> Operands; |
3692 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
3693 | for (unsigned I = 0; I < NF; ++I) |
3694 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3695 | Operands.push_back(Ops[NF]); |
3696 | Operands.push_back(Ops[NF + 1]); |
3697 | Operands.push_back(Ops[NF + 2]); |
3698 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
3699 | } else { |
3700 | for (unsigned I = 0; I < NF; ++I) |
3701 | Operands.push_back(Ops[NF + I]); |
3702 | Operands.push_back(Ops[2 * NF]); |
3703 | Operands.push_back(Ops[2 * NF + 1]); |
3704 | Operands.push_back(Ops[2 * NF + 2]); |
3705 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
3706 | } |
3707 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3708 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3709 | clang::CharUnits Align = |
3710 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3711 | llvm::Value *V; |
3712 | for (unsigned I = 0; I < NF; ++I) { |
3713 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3714 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3715 | } |
3716 | return V; |
3717 | } |
3718 | break; |
3719 | case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_ta: |
3720 | case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_ta: |
3721 | case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_ta: |
3722 | case RISCVVector::BI__builtin_rvv_vloxseg3ei64_v_ta: |
3723 | ID = Intrinsic::riscv_vloxseg3; |
3724 | NF = 3; |
3725 | DefaultPolicy = 1; |
3726 | |
3727 | { |
3728 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
3729 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
3730 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3731 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
3732 | SmallVector<llvm::Value*, 12> Operands; |
3733 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
3734 | for (unsigned I = 0; I < NF; ++I) |
3735 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3736 | Operands.push_back(Ops[NF]); |
3737 | Operands.push_back(Ops[NF + 1]); |
3738 | Operands.push_back(Ops[NF + 2]); |
3739 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
3740 | } else { |
3741 | for (unsigned I = 0; I < NF; ++I) |
3742 | Operands.push_back(Ops[NF + I]); |
3743 | Operands.push_back(Ops[2 * NF]); |
3744 | Operands.push_back(Ops[2 * NF + 1]); |
3745 | Operands.push_back(Ops[2 * NF + 2]); |
3746 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
3747 | } |
3748 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3749 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3750 | clang::CharUnits Align = |
3751 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3752 | llvm::Value *V; |
3753 | for (unsigned I = 0; I < NF; ++I) { |
3754 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3755 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3756 | } |
3757 | return V; |
3758 | } |
3759 | break; |
3760 | case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tuma: |
3761 | case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tuma: |
3762 | case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tuma: |
3763 | case RISCVVector::BI__builtin_rvv_vloxseg3ei64_v_tuma: |
3764 | ID = Intrinsic::riscv_vloxseg3_mask; |
3765 | NF = 3; |
3766 | DefaultPolicy = 2; |
3767 | |
3768 | { |
3769 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
3770 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
3771 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3772 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
3773 | SmallVector<llvm::Value*, 12> Operands; |
3774 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
3775 | for (unsigned I = 0; I < NF; ++I) |
3776 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3777 | Operands.push_back(Ops[NF + 1]); |
3778 | Operands.push_back(Ops[NF + 2]); |
3779 | Operands.push_back(Ops[NF]); |
3780 | Operands.push_back(Ops[NF + 3]); |
3781 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
3782 | } else { |
3783 | for (unsigned I = 0; I < NF; ++I) |
3784 | Operands.push_back(Ops[NF + I + 1]); |
3785 | Operands.push_back(Ops[2 * NF + 1]); |
3786 | Operands.push_back(Ops[2 * NF + 2]); |
3787 | Operands.push_back(Ops[NF]); |
3788 | Operands.push_back(Ops[2 * NF + 3]); |
3789 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
3790 | } |
3791 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3792 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 3792, __extension__ __PRETTY_FUNCTION__)); |
3793 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3794 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3795 | clang::CharUnits Align = |
3796 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3797 | llvm::Value *V; |
3798 | for (unsigned I = 0; I < NF; ++I) { |
3799 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3800 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3801 | } |
3802 | return V; |
3803 | } |
3804 | break; |
3805 | case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tama: |
3806 | case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tama: |
3807 | case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tama: |
3808 | case RISCVVector::BI__builtin_rvv_vloxseg3ei64_v_tama: |
3809 | ID = Intrinsic::riscv_vloxseg3_mask; |
3810 | NF = 3; |
3811 | DefaultPolicy = 3; |
3812 | |
3813 | { |
3814 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
3815 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
3816 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3817 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
3818 | SmallVector<llvm::Value*, 12> Operands; |
3819 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
3820 | for (unsigned I = 0; I < NF; ++I) |
3821 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3822 | Operands.push_back(Ops[NF + 1]); |
3823 | Operands.push_back(Ops[NF + 2]); |
3824 | Operands.push_back(Ops[NF]); |
3825 | Operands.push_back(Ops[NF + 3]); |
3826 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
3827 | } else { |
3828 | for (unsigned I = 0; I < NF; ++I) |
3829 | Operands.push_back(Ops[NF + I + 1]); |
3830 | Operands.push_back(Ops[2 * NF + 1]); |
3831 | Operands.push_back(Ops[2 * NF + 2]); |
3832 | Operands.push_back(Ops[NF]); |
3833 | Operands.push_back(Ops[2 * NF + 3]); |
3834 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
3835 | } |
3836 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3837 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 3837, __extension__ __PRETTY_FUNCTION__)); |
3838 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3839 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3840 | clang::CharUnits Align = |
3841 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3842 | llvm::Value *V; |
3843 | for (unsigned I = 0; I < NF; ++I) { |
3844 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3845 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3846 | } |
3847 | return V; |
3848 | } |
3849 | break; |
3850 | case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tumu: |
3851 | case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tumu: |
3852 | case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tumu: |
3853 | case RISCVVector::BI__builtin_rvv_vloxseg3ei64_v_tumu: |
3854 | ID = Intrinsic::riscv_vloxseg3_mask; |
3855 | NF = 3; |
3856 | DefaultPolicy = 0; |
3857 | |
3858 | { |
3859 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
3860 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
3861 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3862 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
3863 | SmallVector<llvm::Value*, 12> Operands; |
3864 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
3865 | for (unsigned I = 0; I < NF; ++I) |
3866 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3867 | Operands.push_back(Ops[NF + 1]); |
3868 | Operands.push_back(Ops[NF + 2]); |
3869 | Operands.push_back(Ops[NF]); |
3870 | Operands.push_back(Ops[NF + 3]); |
3871 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
3872 | } else { |
3873 | for (unsigned I = 0; I < NF; ++I) |
3874 | Operands.push_back(Ops[NF + I + 1]); |
3875 | Operands.push_back(Ops[2 * NF + 1]); |
3876 | Operands.push_back(Ops[2 * NF + 2]); |
3877 | Operands.push_back(Ops[NF]); |
3878 | Operands.push_back(Ops[2 * NF + 3]); |
3879 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
3880 | } |
3881 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3882 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 3882, __extension__ __PRETTY_FUNCTION__)); |
3883 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3884 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3885 | clang::CharUnits Align = |
3886 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3887 | llvm::Value *V; |
3888 | for (unsigned I = 0; I < NF; ++I) { |
3889 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3890 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3891 | } |
3892 | return V; |
3893 | } |
3894 | break; |
3895 | case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tamu: |
3896 | case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tamu: |
3897 | case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tamu: |
3898 | case RISCVVector::BI__builtin_rvv_vloxseg3ei64_v_tamu: |
3899 | ID = Intrinsic::riscv_vloxseg3_mask; |
3900 | NF = 3; |
3901 | DefaultPolicy = 1; |
3902 | |
3903 | { |
3904 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
3905 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
3906 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3907 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
3908 | SmallVector<llvm::Value*, 12> Operands; |
3909 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
3910 | for (unsigned I = 0; I < NF; ++I) |
3911 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3912 | Operands.push_back(Ops[NF + 1]); |
3913 | Operands.push_back(Ops[NF + 2]); |
3914 | Operands.push_back(Ops[NF]); |
3915 | Operands.push_back(Ops[NF + 3]); |
3916 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
3917 | } else { |
3918 | for (unsigned I = 0; I < NF; ++I) |
3919 | Operands.push_back(Ops[NF + I + 1]); |
3920 | Operands.push_back(Ops[2 * NF + 1]); |
3921 | Operands.push_back(Ops[2 * NF + 2]); |
3922 | Operands.push_back(Ops[NF]); |
3923 | Operands.push_back(Ops[2 * NF + 3]); |
3924 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
3925 | } |
3926 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
3927 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 3927, __extension__ __PRETTY_FUNCTION__)); |
3928 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3929 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3930 | clang::CharUnits Align = |
3931 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3932 | llvm::Value *V; |
3933 | for (unsigned I = 0; I < NF; ++I) { |
3934 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3935 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3936 | } |
3937 | return V; |
3938 | } |
3939 | break; |
3940 | case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tu: |
3941 | case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tu: |
3942 | case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tu: |
3943 | case RISCVVector::BI__builtin_rvv_vloxseg4ei64_v_tu: |
3944 | ID = Intrinsic::riscv_vloxseg4; |
3945 | NF = 4; |
3946 | DefaultPolicy = 0; |
3947 | |
3948 | { |
3949 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
3950 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
3951 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3952 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
3953 | SmallVector<llvm::Value*, 12> Operands; |
3954 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
3955 | for (unsigned I = 0; I < NF; ++I) |
3956 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3957 | Operands.push_back(Ops[NF]); |
3958 | Operands.push_back(Ops[NF + 1]); |
3959 | Operands.push_back(Ops[NF + 2]); |
3960 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
3961 | } else { |
3962 | for (unsigned I = 0; I < NF; ++I) |
3963 | Operands.push_back(Ops[NF + I]); |
3964 | Operands.push_back(Ops[2 * NF]); |
3965 | Operands.push_back(Ops[2 * NF + 1]); |
3966 | Operands.push_back(Ops[2 * NF + 2]); |
3967 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
3968 | } |
3969 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
3970 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
3971 | clang::CharUnits Align = |
3972 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
3973 | llvm::Value *V; |
3974 | for (unsigned I = 0; I < NF; ++I) { |
3975 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
3976 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
3977 | } |
3978 | return V; |
3979 | } |
3980 | break; |
3981 | case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_ta: |
3982 | case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_ta: |
3983 | case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_ta: |
3984 | case RISCVVector::BI__builtin_rvv_vloxseg4ei64_v_ta: |
3985 | ID = Intrinsic::riscv_vloxseg4; |
3986 | NF = 4; |
3987 | DefaultPolicy = 1; |
3988 | |
3989 | { |
3990 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
3991 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
3992 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
3993 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
3994 | SmallVector<llvm::Value*, 12> Operands; |
3995 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
3996 | for (unsigned I = 0; I < NF; ++I) |
3997 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
3998 | Operands.push_back(Ops[NF]); |
3999 | Operands.push_back(Ops[NF + 1]); |
4000 | Operands.push_back(Ops[NF + 2]); |
4001 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
4002 | } else { |
4003 | for (unsigned I = 0; I < NF; ++I) |
4004 | Operands.push_back(Ops[NF + I]); |
4005 | Operands.push_back(Ops[2 * NF]); |
4006 | Operands.push_back(Ops[2 * NF + 1]); |
4007 | Operands.push_back(Ops[2 * NF + 2]); |
4008 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
4009 | } |
4010 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4011 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4012 | clang::CharUnits Align = |
4013 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4014 | llvm::Value *V; |
4015 | for (unsigned I = 0; I < NF; ++I) { |
4016 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4017 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4018 | } |
4019 | return V; |
4020 | } |
4021 | break; |
4022 | case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tuma: |
4023 | case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tuma: |
4024 | case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tuma: |
4025 | case RISCVVector::BI__builtin_rvv_vloxseg4ei64_v_tuma: |
4026 | ID = Intrinsic::riscv_vloxseg4_mask; |
4027 | NF = 4; |
4028 | DefaultPolicy = 2; |
4029 | |
4030 | { |
4031 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4032 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4033 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4034 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4035 | SmallVector<llvm::Value*, 12> Operands; |
4036 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4037 | for (unsigned I = 0; I < NF; ++I) |
4038 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4039 | Operands.push_back(Ops[NF + 1]); |
4040 | Operands.push_back(Ops[NF + 2]); |
4041 | Operands.push_back(Ops[NF]); |
4042 | Operands.push_back(Ops[NF + 3]); |
4043 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4044 | } else { |
4045 | for (unsigned I = 0; I < NF; ++I) |
4046 | Operands.push_back(Ops[NF + I + 1]); |
4047 | Operands.push_back(Ops[2 * NF + 1]); |
4048 | Operands.push_back(Ops[2 * NF + 2]); |
4049 | Operands.push_back(Ops[NF]); |
4050 | Operands.push_back(Ops[2 * NF + 3]); |
4051 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4052 | } |
4053 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4054 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4054, __extension__ __PRETTY_FUNCTION__)); |
4055 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4056 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4057 | clang::CharUnits Align = |
4058 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4059 | llvm::Value *V; |
4060 | for (unsigned I = 0; I < NF; ++I) { |
4061 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4062 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4063 | } |
4064 | return V; |
4065 | } |
4066 | break; |
4067 | case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tama: |
4068 | case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tama: |
4069 | case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tama: |
4070 | case RISCVVector::BI__builtin_rvv_vloxseg4ei64_v_tama: |
4071 | ID = Intrinsic::riscv_vloxseg4_mask; |
4072 | NF = 4; |
4073 | DefaultPolicy = 3; |
4074 | |
4075 | { |
4076 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4077 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4078 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4079 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4080 | SmallVector<llvm::Value*, 12> Operands; |
4081 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4082 | for (unsigned I = 0; I < NF; ++I) |
4083 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4084 | Operands.push_back(Ops[NF + 1]); |
4085 | Operands.push_back(Ops[NF + 2]); |
4086 | Operands.push_back(Ops[NF]); |
4087 | Operands.push_back(Ops[NF + 3]); |
4088 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4089 | } else { |
4090 | for (unsigned I = 0; I < NF; ++I) |
4091 | Operands.push_back(Ops[NF + I + 1]); |
4092 | Operands.push_back(Ops[2 * NF + 1]); |
4093 | Operands.push_back(Ops[2 * NF + 2]); |
4094 | Operands.push_back(Ops[NF]); |
4095 | Operands.push_back(Ops[2 * NF + 3]); |
4096 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4097 | } |
4098 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4099 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4099, __extension__ __PRETTY_FUNCTION__)); |
4100 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4101 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4102 | clang::CharUnits Align = |
4103 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4104 | llvm::Value *V; |
4105 | for (unsigned I = 0; I < NF; ++I) { |
4106 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4107 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4108 | } |
4109 | return V; |
4110 | } |
4111 | break; |
4112 | case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tumu: |
4113 | case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tumu: |
4114 | case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tumu: |
4115 | case RISCVVector::BI__builtin_rvv_vloxseg4ei64_v_tumu: |
4116 | ID = Intrinsic::riscv_vloxseg4_mask; |
4117 | NF = 4; |
4118 | DefaultPolicy = 0; |
4119 | |
4120 | { |
4121 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4122 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4123 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4124 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4125 | SmallVector<llvm::Value*, 12> Operands; |
4126 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4127 | for (unsigned I = 0; I < NF; ++I) |
4128 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4129 | Operands.push_back(Ops[NF + 1]); |
4130 | Operands.push_back(Ops[NF + 2]); |
4131 | Operands.push_back(Ops[NF]); |
4132 | Operands.push_back(Ops[NF + 3]); |
4133 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4134 | } else { |
4135 | for (unsigned I = 0; I < NF; ++I) |
4136 | Operands.push_back(Ops[NF + I + 1]); |
4137 | Operands.push_back(Ops[2 * NF + 1]); |
4138 | Operands.push_back(Ops[2 * NF + 2]); |
4139 | Operands.push_back(Ops[NF]); |
4140 | Operands.push_back(Ops[2 * NF + 3]); |
4141 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4142 | } |
4143 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4144 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4144, __extension__ __PRETTY_FUNCTION__)); |
4145 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4146 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4147 | clang::CharUnits Align = |
4148 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4149 | llvm::Value *V; |
4150 | for (unsigned I = 0; I < NF; ++I) { |
4151 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4152 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4153 | } |
4154 | return V; |
4155 | } |
4156 | break; |
4157 | case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tamu: |
4158 | case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tamu: |
4159 | case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tamu: |
4160 | case RISCVVector::BI__builtin_rvv_vloxseg4ei64_v_tamu: |
4161 | ID = Intrinsic::riscv_vloxseg4_mask; |
4162 | NF = 4; |
4163 | DefaultPolicy = 1; |
4164 | |
4165 | { |
4166 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4167 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4168 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4169 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4170 | SmallVector<llvm::Value*, 12> Operands; |
4171 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4172 | for (unsigned I = 0; I < NF; ++I) |
4173 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4174 | Operands.push_back(Ops[NF + 1]); |
4175 | Operands.push_back(Ops[NF + 2]); |
4176 | Operands.push_back(Ops[NF]); |
4177 | Operands.push_back(Ops[NF + 3]); |
4178 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4179 | } else { |
4180 | for (unsigned I = 0; I < NF; ++I) |
4181 | Operands.push_back(Ops[NF + I + 1]); |
4182 | Operands.push_back(Ops[2 * NF + 1]); |
4183 | Operands.push_back(Ops[2 * NF + 2]); |
4184 | Operands.push_back(Ops[NF]); |
4185 | Operands.push_back(Ops[2 * NF + 3]); |
4186 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4187 | } |
4188 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4189 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4189, __extension__ __PRETTY_FUNCTION__)); |
4190 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4191 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4192 | clang::CharUnits Align = |
4193 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4194 | llvm::Value *V; |
4195 | for (unsigned I = 0; I < NF; ++I) { |
4196 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4197 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4198 | } |
4199 | return V; |
4200 | } |
4201 | break; |
4202 | case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tu: |
4203 | case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tu: |
4204 | case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tu: |
4205 | case RISCVVector::BI__builtin_rvv_vloxseg5ei64_v_tu: |
4206 | ID = Intrinsic::riscv_vloxseg5; |
4207 | NF = 5; |
4208 | DefaultPolicy = 0; |
4209 | |
4210 | { |
4211 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
4212 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
4213 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4214 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
4215 | SmallVector<llvm::Value*, 12> Operands; |
4216 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
4217 | for (unsigned I = 0; I < NF; ++I) |
4218 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4219 | Operands.push_back(Ops[NF]); |
4220 | Operands.push_back(Ops[NF + 1]); |
4221 | Operands.push_back(Ops[NF + 2]); |
4222 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
4223 | } else { |
4224 | for (unsigned I = 0; I < NF; ++I) |
4225 | Operands.push_back(Ops[NF + I]); |
4226 | Operands.push_back(Ops[2 * NF]); |
4227 | Operands.push_back(Ops[2 * NF + 1]); |
4228 | Operands.push_back(Ops[2 * NF + 2]); |
4229 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
4230 | } |
4231 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4232 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4233 | clang::CharUnits Align = |
4234 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4235 | llvm::Value *V; |
4236 | for (unsigned I = 0; I < NF; ++I) { |
4237 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4238 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4239 | } |
4240 | return V; |
4241 | } |
4242 | break; |
4243 | case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_ta: |
4244 | case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_ta: |
4245 | case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_ta: |
4246 | case RISCVVector::BI__builtin_rvv_vloxseg5ei64_v_ta: |
4247 | ID = Intrinsic::riscv_vloxseg5; |
4248 | NF = 5; |
4249 | DefaultPolicy = 1; |
4250 | |
4251 | { |
4252 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
4253 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
4254 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4255 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
4256 | SmallVector<llvm::Value*, 12> Operands; |
4257 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
4258 | for (unsigned I = 0; I < NF; ++I) |
4259 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4260 | Operands.push_back(Ops[NF]); |
4261 | Operands.push_back(Ops[NF + 1]); |
4262 | Operands.push_back(Ops[NF + 2]); |
4263 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
4264 | } else { |
4265 | for (unsigned I = 0; I < NF; ++I) |
4266 | Operands.push_back(Ops[NF + I]); |
4267 | Operands.push_back(Ops[2 * NF]); |
4268 | Operands.push_back(Ops[2 * NF + 1]); |
4269 | Operands.push_back(Ops[2 * NF + 2]); |
4270 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
4271 | } |
4272 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4273 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4274 | clang::CharUnits Align = |
4275 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4276 | llvm::Value *V; |
4277 | for (unsigned I = 0; I < NF; ++I) { |
4278 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4279 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4280 | } |
4281 | return V; |
4282 | } |
4283 | break; |
4284 | case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tuma: |
4285 | case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tuma: |
4286 | case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tuma: |
4287 | case RISCVVector::BI__builtin_rvv_vloxseg5ei64_v_tuma: |
4288 | ID = Intrinsic::riscv_vloxseg5_mask; |
4289 | NF = 5; |
4290 | DefaultPolicy = 2; |
4291 | |
4292 | { |
4293 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4294 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4295 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4296 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4297 | SmallVector<llvm::Value*, 12> Operands; |
4298 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4299 | for (unsigned I = 0; I < NF; ++I) |
4300 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4301 | Operands.push_back(Ops[NF + 1]); |
4302 | Operands.push_back(Ops[NF + 2]); |
4303 | Operands.push_back(Ops[NF]); |
4304 | Operands.push_back(Ops[NF + 3]); |
4305 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4306 | } else { |
4307 | for (unsigned I = 0; I < NF; ++I) |
4308 | Operands.push_back(Ops[NF + I + 1]); |
4309 | Operands.push_back(Ops[2 * NF + 1]); |
4310 | Operands.push_back(Ops[2 * NF + 2]); |
4311 | Operands.push_back(Ops[NF]); |
4312 | Operands.push_back(Ops[2 * NF + 3]); |
4313 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4314 | } |
4315 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4316 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4316, __extension__ __PRETTY_FUNCTION__)); |
4317 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4318 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4319 | clang::CharUnits Align = |
4320 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4321 | llvm::Value *V; |
4322 | for (unsigned I = 0; I < NF; ++I) { |
4323 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4324 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4325 | } |
4326 | return V; |
4327 | } |
4328 | break; |
4329 | case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tama: |
4330 | case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tama: |
4331 | case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tama: |
4332 | case RISCVVector::BI__builtin_rvv_vloxseg5ei64_v_tama: |
4333 | ID = Intrinsic::riscv_vloxseg5_mask; |
4334 | NF = 5; |
4335 | DefaultPolicy = 3; |
4336 | |
4337 | { |
4338 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4339 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4340 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4341 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4342 | SmallVector<llvm::Value*, 12> Operands; |
4343 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4344 | for (unsigned I = 0; I < NF; ++I) |
4345 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4346 | Operands.push_back(Ops[NF + 1]); |
4347 | Operands.push_back(Ops[NF + 2]); |
4348 | Operands.push_back(Ops[NF]); |
4349 | Operands.push_back(Ops[NF + 3]); |
4350 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4351 | } else { |
4352 | for (unsigned I = 0; I < NF; ++I) |
4353 | Operands.push_back(Ops[NF + I + 1]); |
4354 | Operands.push_back(Ops[2 * NF + 1]); |
4355 | Operands.push_back(Ops[2 * NF + 2]); |
4356 | Operands.push_back(Ops[NF]); |
4357 | Operands.push_back(Ops[2 * NF + 3]); |
4358 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4359 | } |
4360 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4361 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4361, __extension__ __PRETTY_FUNCTION__)); |
4362 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4363 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4364 | clang::CharUnits Align = |
4365 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4366 | llvm::Value *V; |
4367 | for (unsigned I = 0; I < NF; ++I) { |
4368 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4369 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4370 | } |
4371 | return V; |
4372 | } |
4373 | break; |
4374 | case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tumu: |
4375 | case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tumu: |
4376 | case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tumu: |
4377 | case RISCVVector::BI__builtin_rvv_vloxseg5ei64_v_tumu: |
4378 | ID = Intrinsic::riscv_vloxseg5_mask; |
4379 | NF = 5; |
4380 | DefaultPolicy = 0; |
4381 | |
4382 | { |
4383 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4384 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4385 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4386 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4387 | SmallVector<llvm::Value*, 12> Operands; |
4388 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4389 | for (unsigned I = 0; I < NF; ++I) |
4390 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4391 | Operands.push_back(Ops[NF + 1]); |
4392 | Operands.push_back(Ops[NF + 2]); |
4393 | Operands.push_back(Ops[NF]); |
4394 | Operands.push_back(Ops[NF + 3]); |
4395 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4396 | } else { |
4397 | for (unsigned I = 0; I < NF; ++I) |
4398 | Operands.push_back(Ops[NF + I + 1]); |
4399 | Operands.push_back(Ops[2 * NF + 1]); |
4400 | Operands.push_back(Ops[2 * NF + 2]); |
4401 | Operands.push_back(Ops[NF]); |
4402 | Operands.push_back(Ops[2 * NF + 3]); |
4403 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4404 | } |
4405 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4406 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4406, __extension__ __PRETTY_FUNCTION__)); |
4407 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4408 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4409 | clang::CharUnits Align = |
4410 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4411 | llvm::Value *V; |
4412 | for (unsigned I = 0; I < NF; ++I) { |
4413 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4414 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4415 | } |
4416 | return V; |
4417 | } |
4418 | break; |
4419 | case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tamu: |
4420 | case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tamu: |
4421 | case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tamu: |
4422 | case RISCVVector::BI__builtin_rvv_vloxseg5ei64_v_tamu: |
4423 | ID = Intrinsic::riscv_vloxseg5_mask; |
4424 | NF = 5; |
4425 | DefaultPolicy = 1; |
4426 | |
4427 | { |
4428 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4429 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4430 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4431 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4432 | SmallVector<llvm::Value*, 12> Operands; |
4433 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4434 | for (unsigned I = 0; I < NF; ++I) |
4435 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4436 | Operands.push_back(Ops[NF + 1]); |
4437 | Operands.push_back(Ops[NF + 2]); |
4438 | Operands.push_back(Ops[NF]); |
4439 | Operands.push_back(Ops[NF + 3]); |
4440 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4441 | } else { |
4442 | for (unsigned I = 0; I < NF; ++I) |
4443 | Operands.push_back(Ops[NF + I + 1]); |
4444 | Operands.push_back(Ops[2 * NF + 1]); |
4445 | Operands.push_back(Ops[2 * NF + 2]); |
4446 | Operands.push_back(Ops[NF]); |
4447 | Operands.push_back(Ops[2 * NF + 3]); |
4448 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4449 | } |
4450 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4451 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4451, __extension__ __PRETTY_FUNCTION__)); |
4452 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4453 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4454 | clang::CharUnits Align = |
4455 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4456 | llvm::Value *V; |
4457 | for (unsigned I = 0; I < NF; ++I) { |
4458 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4459 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4460 | } |
4461 | return V; |
4462 | } |
4463 | break; |
4464 | case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tu: |
4465 | case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tu: |
4466 | case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tu: |
4467 | case RISCVVector::BI__builtin_rvv_vloxseg6ei64_v_tu: |
4468 | ID = Intrinsic::riscv_vloxseg6; |
4469 | NF = 6; |
4470 | DefaultPolicy = 0; |
4471 | |
4472 | { |
4473 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
4474 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
4475 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4476 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
4477 | SmallVector<llvm::Value*, 12> Operands; |
4478 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
4479 | for (unsigned I = 0; I < NF; ++I) |
4480 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4481 | Operands.push_back(Ops[NF]); |
4482 | Operands.push_back(Ops[NF + 1]); |
4483 | Operands.push_back(Ops[NF + 2]); |
4484 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
4485 | } else { |
4486 | for (unsigned I = 0; I < NF; ++I) |
4487 | Operands.push_back(Ops[NF + I]); |
4488 | Operands.push_back(Ops[2 * NF]); |
4489 | Operands.push_back(Ops[2 * NF + 1]); |
4490 | Operands.push_back(Ops[2 * NF + 2]); |
4491 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
4492 | } |
4493 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4494 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4495 | clang::CharUnits Align = |
4496 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4497 | llvm::Value *V; |
4498 | for (unsigned I = 0; I < NF; ++I) { |
4499 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4500 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4501 | } |
4502 | return V; |
4503 | } |
4504 | break; |
4505 | case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_ta: |
4506 | case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_ta: |
4507 | case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_ta: |
4508 | case RISCVVector::BI__builtin_rvv_vloxseg6ei64_v_ta: |
4509 | ID = Intrinsic::riscv_vloxseg6; |
4510 | NF = 6; |
4511 | DefaultPolicy = 1; |
4512 | |
4513 | { |
4514 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
4515 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
4516 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4517 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
4518 | SmallVector<llvm::Value*, 12> Operands; |
4519 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
4520 | for (unsigned I = 0; I < NF; ++I) |
4521 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4522 | Operands.push_back(Ops[NF]); |
4523 | Operands.push_back(Ops[NF + 1]); |
4524 | Operands.push_back(Ops[NF + 2]); |
4525 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
4526 | } else { |
4527 | for (unsigned I = 0; I < NF; ++I) |
4528 | Operands.push_back(Ops[NF + I]); |
4529 | Operands.push_back(Ops[2 * NF]); |
4530 | Operands.push_back(Ops[2 * NF + 1]); |
4531 | Operands.push_back(Ops[2 * NF + 2]); |
4532 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
4533 | } |
4534 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4535 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4536 | clang::CharUnits Align = |
4537 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4538 | llvm::Value *V; |
4539 | for (unsigned I = 0; I < NF; ++I) { |
4540 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4541 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4542 | } |
4543 | return V; |
4544 | } |
4545 | break; |
4546 | case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tuma: |
4547 | case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tuma: |
4548 | case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tuma: |
4549 | case RISCVVector::BI__builtin_rvv_vloxseg6ei64_v_tuma: |
4550 | ID = Intrinsic::riscv_vloxseg6_mask; |
4551 | NF = 6; |
4552 | DefaultPolicy = 2; |
4553 | |
4554 | { |
4555 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4556 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4557 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4558 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4559 | SmallVector<llvm::Value*, 12> Operands; |
4560 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4561 | for (unsigned I = 0; I < NF; ++I) |
4562 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4563 | Operands.push_back(Ops[NF + 1]); |
4564 | Operands.push_back(Ops[NF + 2]); |
4565 | Operands.push_back(Ops[NF]); |
4566 | Operands.push_back(Ops[NF + 3]); |
4567 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4568 | } else { |
4569 | for (unsigned I = 0; I < NF; ++I) |
4570 | Operands.push_back(Ops[NF + I + 1]); |
4571 | Operands.push_back(Ops[2 * NF + 1]); |
4572 | Operands.push_back(Ops[2 * NF + 2]); |
4573 | Operands.push_back(Ops[NF]); |
4574 | Operands.push_back(Ops[2 * NF + 3]); |
4575 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4576 | } |
4577 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4578 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4578, __extension__ __PRETTY_FUNCTION__)); |
4579 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4580 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4581 | clang::CharUnits Align = |
4582 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4583 | llvm::Value *V; |
4584 | for (unsigned I = 0; I < NF; ++I) { |
4585 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4586 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4587 | } |
4588 | return V; |
4589 | } |
4590 | break; |
4591 | case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tama: |
4592 | case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tama: |
4593 | case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tama: |
4594 | case RISCVVector::BI__builtin_rvv_vloxseg6ei64_v_tama: |
4595 | ID = Intrinsic::riscv_vloxseg6_mask; |
4596 | NF = 6; |
4597 | DefaultPolicy = 3; |
4598 | |
4599 | { |
4600 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4601 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4602 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4603 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4604 | SmallVector<llvm::Value*, 12> Operands; |
4605 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4606 | for (unsigned I = 0; I < NF; ++I) |
4607 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4608 | Operands.push_back(Ops[NF + 1]); |
4609 | Operands.push_back(Ops[NF + 2]); |
4610 | Operands.push_back(Ops[NF]); |
4611 | Operands.push_back(Ops[NF + 3]); |
4612 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4613 | } else { |
4614 | for (unsigned I = 0; I < NF; ++I) |
4615 | Operands.push_back(Ops[NF + I + 1]); |
4616 | Operands.push_back(Ops[2 * NF + 1]); |
4617 | Operands.push_back(Ops[2 * NF + 2]); |
4618 | Operands.push_back(Ops[NF]); |
4619 | Operands.push_back(Ops[2 * NF + 3]); |
4620 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4621 | } |
4622 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4623 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4623, __extension__ __PRETTY_FUNCTION__)); |
4624 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4625 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4626 | clang::CharUnits Align = |
4627 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4628 | llvm::Value *V; |
4629 | for (unsigned I = 0; I < NF; ++I) { |
4630 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4631 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4632 | } |
4633 | return V; |
4634 | } |
4635 | break; |
4636 | case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tumu: |
4637 | case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tumu: |
4638 | case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tumu: |
4639 | case RISCVVector::BI__builtin_rvv_vloxseg6ei64_v_tumu: |
4640 | ID = Intrinsic::riscv_vloxseg6_mask; |
4641 | NF = 6; |
4642 | DefaultPolicy = 0; |
4643 | |
4644 | { |
4645 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4646 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4647 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4648 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4649 | SmallVector<llvm::Value*, 12> Operands; |
4650 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4651 | for (unsigned I = 0; I < NF; ++I) |
4652 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4653 | Operands.push_back(Ops[NF + 1]); |
4654 | Operands.push_back(Ops[NF + 2]); |
4655 | Operands.push_back(Ops[NF]); |
4656 | Operands.push_back(Ops[NF + 3]); |
4657 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4658 | } else { |
4659 | for (unsigned I = 0; I < NF; ++I) |
4660 | Operands.push_back(Ops[NF + I + 1]); |
4661 | Operands.push_back(Ops[2 * NF + 1]); |
4662 | Operands.push_back(Ops[2 * NF + 2]); |
4663 | Operands.push_back(Ops[NF]); |
4664 | Operands.push_back(Ops[2 * NF + 3]); |
4665 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4666 | } |
4667 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4668 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4668, __extension__ __PRETTY_FUNCTION__)); |
4669 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4670 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4671 | clang::CharUnits Align = |
4672 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4673 | llvm::Value *V; |
4674 | for (unsigned I = 0; I < NF; ++I) { |
4675 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4676 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4677 | } |
4678 | return V; |
4679 | } |
4680 | break; |
4681 | case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tamu: |
4682 | case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tamu: |
4683 | case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tamu: |
4684 | case RISCVVector::BI__builtin_rvv_vloxseg6ei64_v_tamu: |
4685 | ID = Intrinsic::riscv_vloxseg6_mask; |
4686 | NF = 6; |
4687 | DefaultPolicy = 1; |
4688 | |
4689 | { |
4690 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4691 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4692 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4693 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4694 | SmallVector<llvm::Value*, 12> Operands; |
4695 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4696 | for (unsigned I = 0; I < NF; ++I) |
4697 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4698 | Operands.push_back(Ops[NF + 1]); |
4699 | Operands.push_back(Ops[NF + 2]); |
4700 | Operands.push_back(Ops[NF]); |
4701 | Operands.push_back(Ops[NF + 3]); |
4702 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4703 | } else { |
4704 | for (unsigned I = 0; I < NF; ++I) |
4705 | Operands.push_back(Ops[NF + I + 1]); |
4706 | Operands.push_back(Ops[2 * NF + 1]); |
4707 | Operands.push_back(Ops[2 * NF + 2]); |
4708 | Operands.push_back(Ops[NF]); |
4709 | Operands.push_back(Ops[2 * NF + 3]); |
4710 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4711 | } |
4712 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4713 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4713, __extension__ __PRETTY_FUNCTION__)); |
4714 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4715 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4716 | clang::CharUnits Align = |
4717 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4718 | llvm::Value *V; |
4719 | for (unsigned I = 0; I < NF; ++I) { |
4720 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4721 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4722 | } |
4723 | return V; |
4724 | } |
4725 | break; |
4726 | case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tu: |
4727 | case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tu: |
4728 | case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tu: |
4729 | case RISCVVector::BI__builtin_rvv_vloxseg7ei64_v_tu: |
4730 | ID = Intrinsic::riscv_vloxseg7; |
4731 | NF = 7; |
4732 | DefaultPolicy = 0; |
4733 | |
4734 | { |
4735 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
4736 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
4737 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4738 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
4739 | SmallVector<llvm::Value*, 12> Operands; |
4740 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
4741 | for (unsigned I = 0; I < NF; ++I) |
4742 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4743 | Operands.push_back(Ops[NF]); |
4744 | Operands.push_back(Ops[NF + 1]); |
4745 | Operands.push_back(Ops[NF + 2]); |
4746 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
4747 | } else { |
4748 | for (unsigned I = 0; I < NF; ++I) |
4749 | Operands.push_back(Ops[NF + I]); |
4750 | Operands.push_back(Ops[2 * NF]); |
4751 | Operands.push_back(Ops[2 * NF + 1]); |
4752 | Operands.push_back(Ops[2 * NF + 2]); |
4753 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
4754 | } |
4755 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4756 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4757 | clang::CharUnits Align = |
4758 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4759 | llvm::Value *V; |
4760 | for (unsigned I = 0; I < NF; ++I) { |
4761 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4762 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4763 | } |
4764 | return V; |
4765 | } |
4766 | break; |
4767 | case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_ta: |
4768 | case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_ta: |
4769 | case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_ta: |
4770 | case RISCVVector::BI__builtin_rvv_vloxseg7ei64_v_ta: |
4771 | ID = Intrinsic::riscv_vloxseg7; |
4772 | NF = 7; |
4773 | DefaultPolicy = 1; |
4774 | |
4775 | { |
4776 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
4777 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
4778 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4779 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
4780 | SmallVector<llvm::Value*, 12> Operands; |
4781 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
4782 | for (unsigned I = 0; I < NF; ++I) |
4783 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4784 | Operands.push_back(Ops[NF]); |
4785 | Operands.push_back(Ops[NF + 1]); |
4786 | Operands.push_back(Ops[NF + 2]); |
4787 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
4788 | } else { |
4789 | for (unsigned I = 0; I < NF; ++I) |
4790 | Operands.push_back(Ops[NF + I]); |
4791 | Operands.push_back(Ops[2 * NF]); |
4792 | Operands.push_back(Ops[2 * NF + 1]); |
4793 | Operands.push_back(Ops[2 * NF + 2]); |
4794 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
4795 | } |
4796 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4797 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4798 | clang::CharUnits Align = |
4799 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4800 | llvm::Value *V; |
4801 | for (unsigned I = 0; I < NF; ++I) { |
4802 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4803 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4804 | } |
4805 | return V; |
4806 | } |
4807 | break; |
4808 | case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tuma: |
4809 | case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tuma: |
4810 | case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tuma: |
4811 | case RISCVVector::BI__builtin_rvv_vloxseg7ei64_v_tuma: |
4812 | ID = Intrinsic::riscv_vloxseg7_mask; |
4813 | NF = 7; |
4814 | DefaultPolicy = 2; |
4815 | |
4816 | { |
4817 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4818 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4819 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4820 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4821 | SmallVector<llvm::Value*, 12> Operands; |
4822 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4823 | for (unsigned I = 0; I < NF; ++I) |
4824 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4825 | Operands.push_back(Ops[NF + 1]); |
4826 | Operands.push_back(Ops[NF + 2]); |
4827 | Operands.push_back(Ops[NF]); |
4828 | Operands.push_back(Ops[NF + 3]); |
4829 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4830 | } else { |
4831 | for (unsigned I = 0; I < NF; ++I) |
4832 | Operands.push_back(Ops[NF + I + 1]); |
4833 | Operands.push_back(Ops[2 * NF + 1]); |
4834 | Operands.push_back(Ops[2 * NF + 2]); |
4835 | Operands.push_back(Ops[NF]); |
4836 | Operands.push_back(Ops[2 * NF + 3]); |
4837 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4838 | } |
4839 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4840 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4840, __extension__ __PRETTY_FUNCTION__)); |
4841 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4842 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4843 | clang::CharUnits Align = |
4844 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4845 | llvm::Value *V; |
4846 | for (unsigned I = 0; I < NF; ++I) { |
4847 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4848 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4849 | } |
4850 | return V; |
4851 | } |
4852 | break; |
4853 | case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tama: |
4854 | case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tama: |
4855 | case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tama: |
4856 | case RISCVVector::BI__builtin_rvv_vloxseg7ei64_v_tama: |
4857 | ID = Intrinsic::riscv_vloxseg7_mask; |
4858 | NF = 7; |
4859 | DefaultPolicy = 3; |
4860 | |
4861 | { |
4862 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4863 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4864 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4865 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4866 | SmallVector<llvm::Value*, 12> Operands; |
4867 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4868 | for (unsigned I = 0; I < NF; ++I) |
4869 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4870 | Operands.push_back(Ops[NF + 1]); |
4871 | Operands.push_back(Ops[NF + 2]); |
4872 | Operands.push_back(Ops[NF]); |
4873 | Operands.push_back(Ops[NF + 3]); |
4874 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4875 | } else { |
4876 | for (unsigned I = 0; I < NF; ++I) |
4877 | Operands.push_back(Ops[NF + I + 1]); |
4878 | Operands.push_back(Ops[2 * NF + 1]); |
4879 | Operands.push_back(Ops[2 * NF + 2]); |
4880 | Operands.push_back(Ops[NF]); |
4881 | Operands.push_back(Ops[2 * NF + 3]); |
4882 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4883 | } |
4884 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4885 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4885, __extension__ __PRETTY_FUNCTION__)); |
4886 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4887 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4888 | clang::CharUnits Align = |
4889 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4890 | llvm::Value *V; |
4891 | for (unsigned I = 0; I < NF; ++I) { |
4892 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4893 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4894 | } |
4895 | return V; |
4896 | } |
4897 | break; |
4898 | case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tumu: |
4899 | case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tumu: |
4900 | case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tumu: |
4901 | case RISCVVector::BI__builtin_rvv_vloxseg7ei64_v_tumu: |
4902 | ID = Intrinsic::riscv_vloxseg7_mask; |
4903 | NF = 7; |
4904 | DefaultPolicy = 0; |
4905 | |
4906 | { |
4907 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4908 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4909 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4910 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4911 | SmallVector<llvm::Value*, 12> Operands; |
4912 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4913 | for (unsigned I = 0; I < NF; ++I) |
4914 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4915 | Operands.push_back(Ops[NF + 1]); |
4916 | Operands.push_back(Ops[NF + 2]); |
4917 | Operands.push_back(Ops[NF]); |
4918 | Operands.push_back(Ops[NF + 3]); |
4919 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4920 | } else { |
4921 | for (unsigned I = 0; I < NF; ++I) |
4922 | Operands.push_back(Ops[NF + I + 1]); |
4923 | Operands.push_back(Ops[2 * NF + 1]); |
4924 | Operands.push_back(Ops[2 * NF + 2]); |
4925 | Operands.push_back(Ops[NF]); |
4926 | Operands.push_back(Ops[2 * NF + 3]); |
4927 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4928 | } |
4929 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4930 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4930, __extension__ __PRETTY_FUNCTION__)); |
4931 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4932 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4933 | clang::CharUnits Align = |
4934 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4935 | llvm::Value *V; |
4936 | for (unsigned I = 0; I < NF; ++I) { |
4937 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4938 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4939 | } |
4940 | return V; |
4941 | } |
4942 | break; |
4943 | case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tamu: |
4944 | case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tamu: |
4945 | case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tamu: |
4946 | case RISCVVector::BI__builtin_rvv_vloxseg7ei64_v_tamu: |
4947 | ID = Intrinsic::riscv_vloxseg7_mask; |
4948 | NF = 7; |
4949 | DefaultPolicy = 1; |
4950 | |
4951 | { |
4952 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
4953 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
4954 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
4955 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
4956 | SmallVector<llvm::Value*, 12> Operands; |
4957 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
4958 | for (unsigned I = 0; I < NF; ++I) |
4959 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
4960 | Operands.push_back(Ops[NF + 1]); |
4961 | Operands.push_back(Ops[NF + 2]); |
4962 | Operands.push_back(Ops[NF]); |
4963 | Operands.push_back(Ops[NF + 3]); |
4964 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
4965 | } else { |
4966 | for (unsigned I = 0; I < NF; ++I) |
4967 | Operands.push_back(Ops[NF + I + 1]); |
4968 | Operands.push_back(Ops[2 * NF + 1]); |
4969 | Operands.push_back(Ops[2 * NF + 2]); |
4970 | Operands.push_back(Ops[NF]); |
4971 | Operands.push_back(Ops[2 * NF + 3]); |
4972 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
4973 | } |
4974 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
4975 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 4975, __extension__ __PRETTY_FUNCTION__)); |
4976 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
4977 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
4978 | clang::CharUnits Align = |
4979 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
4980 | llvm::Value *V; |
4981 | for (unsigned I = 0; I < NF; ++I) { |
4982 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
4983 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
4984 | } |
4985 | return V; |
4986 | } |
4987 | break; |
4988 | case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tu: |
4989 | case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tu: |
4990 | case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tu: |
4991 | case RISCVVector::BI__builtin_rvv_vloxseg8ei64_v_tu: |
4992 | ID = Intrinsic::riscv_vloxseg8; |
4993 | NF = 8; |
4994 | DefaultPolicy = 0; |
4995 | |
4996 | { |
4997 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
4998 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
4999 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5000 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
5001 | SmallVector<llvm::Value*, 12> Operands; |
5002 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
5003 | for (unsigned I = 0; I < NF; ++I) |
5004 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5005 | Operands.push_back(Ops[NF]); |
5006 | Operands.push_back(Ops[NF + 1]); |
5007 | Operands.push_back(Ops[NF + 2]); |
5008 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
5009 | } else { |
5010 | for (unsigned I = 0; I < NF; ++I) |
5011 | Operands.push_back(Ops[NF + I]); |
5012 | Operands.push_back(Ops[2 * NF]); |
5013 | Operands.push_back(Ops[2 * NF + 1]); |
5014 | Operands.push_back(Ops[2 * NF + 2]); |
5015 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
5016 | } |
5017 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5018 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5019 | clang::CharUnits Align = |
5020 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5021 | llvm::Value *V; |
5022 | for (unsigned I = 0; I < NF; ++I) { |
5023 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5024 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5025 | } |
5026 | return V; |
5027 | } |
5028 | break; |
5029 | case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_ta: |
5030 | case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_ta: |
5031 | case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_ta: |
5032 | case RISCVVector::BI__builtin_rvv_vloxseg8ei64_v_ta: |
5033 | ID = Intrinsic::riscv_vloxseg8; |
5034 | NF = 8; |
5035 | DefaultPolicy = 1; |
5036 | |
5037 | { |
5038 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
5039 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
5040 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5041 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
5042 | SmallVector<llvm::Value*, 12> Operands; |
5043 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
5044 | for (unsigned I = 0; I < NF; ++I) |
5045 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5046 | Operands.push_back(Ops[NF]); |
5047 | Operands.push_back(Ops[NF + 1]); |
5048 | Operands.push_back(Ops[NF + 2]); |
5049 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
5050 | } else { |
5051 | for (unsigned I = 0; I < NF; ++I) |
5052 | Operands.push_back(Ops[NF + I]); |
5053 | Operands.push_back(Ops[2 * NF]); |
5054 | Operands.push_back(Ops[2 * NF + 1]); |
5055 | Operands.push_back(Ops[2 * NF + 2]); |
5056 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
5057 | } |
5058 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5059 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5060 | clang::CharUnits Align = |
5061 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5062 | llvm::Value *V; |
5063 | for (unsigned I = 0; I < NF; ++I) { |
5064 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5065 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5066 | } |
5067 | return V; |
5068 | } |
5069 | break; |
5070 | case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tuma: |
5071 | case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tuma: |
5072 | case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tuma: |
5073 | case RISCVVector::BI__builtin_rvv_vloxseg8ei64_v_tuma: |
5074 | ID = Intrinsic::riscv_vloxseg8_mask; |
5075 | NF = 8; |
5076 | DefaultPolicy = 2; |
5077 | |
5078 | { |
5079 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
5080 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
5081 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5082 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
5083 | SmallVector<llvm::Value*, 12> Operands; |
5084 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5085 | for (unsigned I = 0; I < NF; ++I) |
5086 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5087 | Operands.push_back(Ops[NF + 1]); |
5088 | Operands.push_back(Ops[NF + 2]); |
5089 | Operands.push_back(Ops[NF]); |
5090 | Operands.push_back(Ops[NF + 3]); |
5091 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
5092 | } else { |
5093 | for (unsigned I = 0; I < NF; ++I) |
5094 | Operands.push_back(Ops[NF + I + 1]); |
5095 | Operands.push_back(Ops[2 * NF + 1]); |
5096 | Operands.push_back(Ops[2 * NF + 2]); |
5097 | Operands.push_back(Ops[NF]); |
5098 | Operands.push_back(Ops[2 * NF + 3]); |
5099 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
5100 | } |
5101 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5102 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5102, __extension__ __PRETTY_FUNCTION__)); |
5103 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5104 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5105 | clang::CharUnits Align = |
5106 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5107 | llvm::Value *V; |
5108 | for (unsigned I = 0; I < NF; ++I) { |
5109 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5110 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5111 | } |
5112 | return V; |
5113 | } |
5114 | break; |
5115 | case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tama: |
5116 | case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tama: |
5117 | case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tama: |
5118 | case RISCVVector::BI__builtin_rvv_vloxseg8ei64_v_tama: |
5119 | ID = Intrinsic::riscv_vloxseg8_mask; |
5120 | NF = 8; |
5121 | DefaultPolicy = 3; |
5122 | |
5123 | { |
5124 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
5125 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
5126 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5127 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
5128 | SmallVector<llvm::Value*, 12> Operands; |
5129 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5130 | for (unsigned I = 0; I < NF; ++I) |
5131 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5132 | Operands.push_back(Ops[NF + 1]); |
5133 | Operands.push_back(Ops[NF + 2]); |
5134 | Operands.push_back(Ops[NF]); |
5135 | Operands.push_back(Ops[NF + 3]); |
5136 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
5137 | } else { |
5138 | for (unsigned I = 0; I < NF; ++I) |
5139 | Operands.push_back(Ops[NF + I + 1]); |
5140 | Operands.push_back(Ops[2 * NF + 1]); |
5141 | Operands.push_back(Ops[2 * NF + 2]); |
5142 | Operands.push_back(Ops[NF]); |
5143 | Operands.push_back(Ops[2 * NF + 3]); |
5144 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
5145 | } |
5146 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5147 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5147, __extension__ __PRETTY_FUNCTION__)); |
5148 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5149 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5150 | clang::CharUnits Align = |
5151 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5152 | llvm::Value *V; |
5153 | for (unsigned I = 0; I < NF; ++I) { |
5154 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5155 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5156 | } |
5157 | return V; |
5158 | } |
5159 | break; |
5160 | case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tumu: |
5161 | case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tumu: |
5162 | case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tumu: |
5163 | case RISCVVector::BI__builtin_rvv_vloxseg8ei64_v_tumu: |
5164 | ID = Intrinsic::riscv_vloxseg8_mask; |
5165 | NF = 8; |
5166 | DefaultPolicy = 0; |
5167 | |
5168 | { |
5169 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
5170 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
5171 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5172 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
5173 | SmallVector<llvm::Value*, 12> Operands; |
5174 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5175 | for (unsigned I = 0; I < NF; ++I) |
5176 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5177 | Operands.push_back(Ops[NF + 1]); |
5178 | Operands.push_back(Ops[NF + 2]); |
5179 | Operands.push_back(Ops[NF]); |
5180 | Operands.push_back(Ops[NF + 3]); |
5181 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
5182 | } else { |
5183 | for (unsigned I = 0; I < NF; ++I) |
5184 | Operands.push_back(Ops[NF + I + 1]); |
5185 | Operands.push_back(Ops[2 * NF + 1]); |
5186 | Operands.push_back(Ops[2 * NF + 2]); |
5187 | Operands.push_back(Ops[NF]); |
5188 | Operands.push_back(Ops[2 * NF + 3]); |
5189 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
5190 | } |
5191 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5192 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5192, __extension__ __PRETTY_FUNCTION__)); |
5193 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5194 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5195 | clang::CharUnits Align = |
5196 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5197 | llvm::Value *V; |
5198 | for (unsigned I = 0; I < NF; ++I) { |
5199 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5200 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5201 | } |
5202 | return V; |
5203 | } |
5204 | break; |
5205 | case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tamu: |
5206 | case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tamu: |
5207 | case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tamu: |
5208 | case RISCVVector::BI__builtin_rvv_vloxseg8ei64_v_tamu: |
5209 | ID = Intrinsic::riscv_vloxseg8_mask; |
5210 | NF = 8; |
5211 | DefaultPolicy = 1; |
5212 | |
5213 | { |
5214 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
5215 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
5216 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5217 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
5218 | SmallVector<llvm::Value*, 12> Operands; |
5219 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5220 | for (unsigned I = 0; I < NF; ++I) |
5221 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5222 | Operands.push_back(Ops[NF + 1]); |
5223 | Operands.push_back(Ops[NF + 2]); |
5224 | Operands.push_back(Ops[NF]); |
5225 | Operands.push_back(Ops[NF + 3]); |
5226 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
5227 | } else { |
5228 | for (unsigned I = 0; I < NF; ++I) |
5229 | Operands.push_back(Ops[NF + I + 1]); |
5230 | Operands.push_back(Ops[2 * NF + 1]); |
5231 | Operands.push_back(Ops[2 * NF + 2]); |
5232 | Operands.push_back(Ops[NF]); |
5233 | Operands.push_back(Ops[2 * NF + 3]); |
5234 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
5235 | } |
5236 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5237 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5237, __extension__ __PRETTY_FUNCTION__)); |
5238 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5239 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5240 | clang::CharUnits Align = |
5241 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5242 | llvm::Value *V; |
5243 | for (unsigned I = 0; I < NF; ++I) { |
5244 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5245 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5246 | } |
5247 | return V; |
5248 | } |
5249 | break; |
5250 | case RISCVVector::BI__builtin_rvv_vlse32_v_tu: |
5251 | case RISCVVector::BI__builtin_rvv_vlse64_v_tu: |
5252 | case RISCVVector::BI__builtin_rvv_vlse8_v_tu: |
5253 | case RISCVVector::BI__builtin_rvv_vlse16_v_tu: |
5254 | ID = Intrinsic::riscv_vlse; |
5255 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
5256 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5257 | break; |
5258 | case RISCVVector::BI__builtin_rvv_vlse32_v_ta: |
5259 | case RISCVVector::BI__builtin_rvv_vlse64_v_ta: |
5260 | case RISCVVector::BI__builtin_rvv_vlse8_v_ta: |
5261 | case RISCVVector::BI__builtin_rvv_vlse16_v_ta: |
5262 | ID = Intrinsic::riscv_vlse; |
5263 | Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); |
5264 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
5265 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5266 | break; |
5267 | case RISCVVector::BI__builtin_rvv_vlse32_v_tuma: |
5268 | case RISCVVector::BI__builtin_rvv_vlse64_v_tuma: |
5269 | case RISCVVector::BI__builtin_rvv_vlse8_v_tuma: |
5270 | case RISCVVector::BI__builtin_rvv_vlse16_v_tuma: |
5271 | ID = Intrinsic::riscv_vlse_mask; |
5272 | DefaultPolicy = 2; |
5273 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
5274 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
5275 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5276 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5277 | break; |
5278 | case RISCVVector::BI__builtin_rvv_vlse32_v_tama: |
5279 | case RISCVVector::BI__builtin_rvv_vlse64_v_tama: |
5280 | case RISCVVector::BI__builtin_rvv_vlse8_v_tama: |
5281 | case RISCVVector::BI__builtin_rvv_vlse16_v_tama: |
5282 | ID = Intrinsic::riscv_vlse_mask; |
5283 | DefaultPolicy = 3; |
5284 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
5285 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
5286 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5287 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
5288 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5289 | break; |
5290 | case RISCVVector::BI__builtin_rvv_vlse32_v_tumu: |
5291 | case RISCVVector::BI__builtin_rvv_vlse64_v_tumu: |
5292 | case RISCVVector::BI__builtin_rvv_vlse8_v_tumu: |
5293 | case RISCVVector::BI__builtin_rvv_vlse16_v_tumu: |
5294 | ID = Intrinsic::riscv_vlse_mask; |
5295 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
5296 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
5297 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5298 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5299 | break; |
5300 | case RISCVVector::BI__builtin_rvv_vlse32_v_tamu: |
5301 | case RISCVVector::BI__builtin_rvv_vlse64_v_tamu: |
5302 | case RISCVVector::BI__builtin_rvv_vlse8_v_tamu: |
5303 | case RISCVVector::BI__builtin_rvv_vlse16_v_tamu: |
5304 | ID = Intrinsic::riscv_vlse_mask; |
5305 | DefaultPolicy = 1; |
5306 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
5307 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
5308 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5309 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5310 | break; |
5311 | case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tu: |
5312 | case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tu: |
5313 | case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tu: |
5314 | case RISCVVector::BI__builtin_rvv_vlseg2e64_v_tu: |
5315 | ID = Intrinsic::riscv_vlseg2; |
5316 | NF = 2; |
5317 | DefaultPolicy = 0; |
5318 | |
5319 | { |
5320 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5321 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
5322 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
5323 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5324 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
5325 | SmallVector<llvm::Value*, 10> Operands; |
5326 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
5327 | for (unsigned I = 0; I < NF; ++I) |
5328 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5329 | Operands.push_back(Ops[NF]); |
5330 | Operands.push_back(Ops[NF + 1]); |
5331 | } else { |
5332 | for (unsigned I = 0; I < NF; ++I) |
5333 | Operands.push_back(Ops[NF + I]); |
5334 | Operands.push_back(Ops[2 * NF]); |
5335 | Operands.push_back(Ops[2 * NF + 1]); |
5336 | } |
5337 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5338 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5339 | clang::CharUnits Align = |
5340 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5341 | llvm::Value *V; |
5342 | for (unsigned I = 0; I < NF; ++I) { |
5343 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5344 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5345 | } |
5346 | return V; |
5347 | } |
5348 | break; |
5349 | case RISCVVector::BI__builtin_rvv_vlseg2e8_v_ta: |
5350 | case RISCVVector::BI__builtin_rvv_vlseg2e16_v_ta: |
5351 | case RISCVVector::BI__builtin_rvv_vlseg2e32_v_ta: |
5352 | case RISCVVector::BI__builtin_rvv_vlseg2e64_v_ta: |
5353 | ID = Intrinsic::riscv_vlseg2; |
5354 | NF = 2; |
5355 | DefaultPolicy = 1; |
5356 | |
5357 | { |
5358 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5359 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
5360 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
5361 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5362 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
5363 | SmallVector<llvm::Value*, 10> Operands; |
5364 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
5365 | for (unsigned I = 0; I < NF; ++I) |
5366 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5367 | Operands.push_back(Ops[NF]); |
5368 | Operands.push_back(Ops[NF + 1]); |
5369 | } else { |
5370 | for (unsigned I = 0; I < NF; ++I) |
5371 | Operands.push_back(Ops[NF + I]); |
5372 | Operands.push_back(Ops[2 * NF]); |
5373 | Operands.push_back(Ops[2 * NF + 1]); |
5374 | } |
5375 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5376 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5377 | clang::CharUnits Align = |
5378 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5379 | llvm::Value *V; |
5380 | for (unsigned I = 0; I < NF; ++I) { |
5381 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5382 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5383 | } |
5384 | return V; |
5385 | } |
5386 | break; |
5387 | case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tuma: |
5388 | case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tuma: |
5389 | case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tuma: |
5390 | case RISCVVector::BI__builtin_rvv_vlseg2e64_v_tuma: |
5391 | ID = Intrinsic::riscv_vlseg2_mask; |
5392 | NF = 2; |
5393 | DefaultPolicy = 2; |
5394 | |
5395 | { |
5396 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
5397 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
5398 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5399 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5400 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5401 | SmallVector<llvm::Value*, 12> Operands; |
5402 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5403 | for (unsigned I = 0; I < NF; ++I) |
5404 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5405 | Operands.push_back(Ops[NF + 1]); |
5406 | Operands.push_back(Ops[NF]); |
5407 | Operands.push_back(Ops[NF + 2]); |
5408 | } else { |
5409 | for (unsigned I = 0; I < NF; ++I) |
5410 | Operands.push_back(Ops[NF + I + 1]); |
5411 | Operands.push_back(Ops[2 * NF + 1]); |
5412 | Operands.push_back(Ops[NF]); |
5413 | Operands.push_back(Ops[2 * NF + 2]); |
5414 | } |
5415 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5416 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5416, __extension__ __PRETTY_FUNCTION__)); |
5417 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5418 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5419 | clang::CharUnits Align = |
5420 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5421 | llvm::Value *V; |
5422 | for (unsigned I = 0; I < NF; ++I) { |
5423 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5424 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5425 | } |
5426 | return V; |
5427 | } |
5428 | break; |
5429 | case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tama: |
5430 | case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tama: |
5431 | case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tama: |
5432 | case RISCVVector::BI__builtin_rvv_vlseg2e64_v_tama: |
5433 | ID = Intrinsic::riscv_vlseg2_mask; |
5434 | NF = 2; |
5435 | DefaultPolicy = 3; |
5436 | |
5437 | { |
5438 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
5439 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
5440 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5441 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5442 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5443 | SmallVector<llvm::Value*, 12> Operands; |
5444 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5445 | for (unsigned I = 0; I < NF; ++I) |
5446 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5447 | Operands.push_back(Ops[NF + 1]); |
5448 | Operands.push_back(Ops[NF]); |
5449 | Operands.push_back(Ops[NF + 2]); |
5450 | } else { |
5451 | for (unsigned I = 0; I < NF; ++I) |
5452 | Operands.push_back(Ops[NF + I + 1]); |
5453 | Operands.push_back(Ops[2 * NF + 1]); |
5454 | Operands.push_back(Ops[NF]); |
5455 | Operands.push_back(Ops[2 * NF + 2]); |
5456 | } |
5457 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5458 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5458, __extension__ __PRETTY_FUNCTION__)); |
5459 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5460 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5461 | clang::CharUnits Align = |
5462 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5463 | llvm::Value *V; |
5464 | for (unsigned I = 0; I < NF; ++I) { |
5465 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5466 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5467 | } |
5468 | return V; |
5469 | } |
5470 | break; |
5471 | case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tumu: |
5472 | case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tumu: |
5473 | case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tumu: |
5474 | case RISCVVector::BI__builtin_rvv_vlseg2e64_v_tumu: |
5475 | ID = Intrinsic::riscv_vlseg2_mask; |
5476 | NF = 2; |
5477 | DefaultPolicy = 0; |
5478 | |
5479 | { |
5480 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
5481 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
5482 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5483 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5484 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5485 | SmallVector<llvm::Value*, 12> Operands; |
5486 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5487 | for (unsigned I = 0; I < NF; ++I) |
5488 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5489 | Operands.push_back(Ops[NF + 1]); |
5490 | Operands.push_back(Ops[NF]); |
5491 | Operands.push_back(Ops[NF + 2]); |
5492 | } else { |
5493 | for (unsigned I = 0; I < NF; ++I) |
5494 | Operands.push_back(Ops[NF + I + 1]); |
5495 | Operands.push_back(Ops[2 * NF + 1]); |
5496 | Operands.push_back(Ops[NF]); |
5497 | Operands.push_back(Ops[2 * NF + 2]); |
5498 | } |
5499 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5500 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5500, __extension__ __PRETTY_FUNCTION__)); |
5501 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5502 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5503 | clang::CharUnits Align = |
5504 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5505 | llvm::Value *V; |
5506 | for (unsigned I = 0; I < NF; ++I) { |
5507 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5508 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5509 | } |
5510 | return V; |
5511 | } |
5512 | break; |
5513 | case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tamu: |
5514 | case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tamu: |
5515 | case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tamu: |
5516 | case RISCVVector::BI__builtin_rvv_vlseg2e64_v_tamu: |
5517 | ID = Intrinsic::riscv_vlseg2_mask; |
5518 | NF = 2; |
5519 | DefaultPolicy = 1; |
5520 | |
5521 | { |
5522 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
5523 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
5524 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5525 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5526 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5527 | SmallVector<llvm::Value*, 12> Operands; |
5528 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5529 | for (unsigned I = 0; I < NF; ++I) |
5530 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5531 | Operands.push_back(Ops[NF + 1]); |
5532 | Operands.push_back(Ops[NF]); |
5533 | Operands.push_back(Ops[NF + 2]); |
5534 | } else { |
5535 | for (unsigned I = 0; I < NF; ++I) |
5536 | Operands.push_back(Ops[NF + I + 1]); |
5537 | Operands.push_back(Ops[2 * NF + 1]); |
5538 | Operands.push_back(Ops[NF]); |
5539 | Operands.push_back(Ops[2 * NF + 2]); |
5540 | } |
5541 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5542 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5542, __extension__ __PRETTY_FUNCTION__)); |
5543 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5544 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5545 | clang::CharUnits Align = |
5546 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5547 | llvm::Value *V; |
5548 | for (unsigned I = 0; I < NF; ++I) { |
5549 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5550 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5551 | } |
5552 | return V; |
5553 | } |
5554 | break; |
5555 | case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tu: |
5556 | case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tu: |
5557 | case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tu: |
5558 | case RISCVVector::BI__builtin_rvv_vlseg2e8ff_v_tu: |
5559 | ID = Intrinsic::riscv_vlseg2ff; |
5560 | NF = 2; |
5561 | DefaultPolicy = 0; |
5562 | |
5563 | { |
5564 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
5565 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
5566 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5567 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5568 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
5569 | SmallVector<llvm::Value*, 12> Operands; |
5570 | Value *NewVL; |
5571 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
5572 | for (unsigned I = 0; I < NF; ++I) |
5573 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5574 | Operands.push_back(Ops[NF]); |
5575 | Operands.push_back(Ops[NF + 2]); |
5576 | NewVL = Ops[NF + 1]; |
5577 | } else { |
5578 | for (unsigned I = 0; I < NF; ++I) |
5579 | Operands.push_back(Ops[NF + I]); |
5580 | Operands.push_back(Ops[2 * NF]); |
5581 | Operands.push_back(Ops[2 * NF + 2]); |
5582 | NewVL = Ops[2 * NF + 1]; |
5583 | } |
5584 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5585 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5586 | clang::CharUnits Align = |
5587 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5588 | for (unsigned I = 0; I < NF; ++I) { |
5589 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5590 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5591 | } |
5592 | // Store new_vl. |
5593 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
5594 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
5595 | } |
5596 | break; |
5597 | case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_ta: |
5598 | case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_ta: |
5599 | case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_ta: |
5600 | case RISCVVector::BI__builtin_rvv_vlseg2e8ff_v_ta: |
5601 | ID = Intrinsic::riscv_vlseg2ff; |
5602 | NF = 2; |
5603 | DefaultPolicy = 1; |
5604 | |
5605 | { |
5606 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
5607 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
5608 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5609 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5610 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
5611 | SmallVector<llvm::Value*, 12> Operands; |
5612 | Value *NewVL; |
5613 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
5614 | for (unsigned I = 0; I < NF; ++I) |
5615 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5616 | Operands.push_back(Ops[NF]); |
5617 | Operands.push_back(Ops[NF + 2]); |
5618 | NewVL = Ops[NF + 1]; |
5619 | } else { |
5620 | for (unsigned I = 0; I < NF; ++I) |
5621 | Operands.push_back(Ops[NF + I]); |
5622 | Operands.push_back(Ops[2 * NF]); |
5623 | Operands.push_back(Ops[2 * NF + 2]); |
5624 | NewVL = Ops[2 * NF + 1]; |
5625 | } |
5626 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5627 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5628 | clang::CharUnits Align = |
5629 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5630 | for (unsigned I = 0; I < NF; ++I) { |
5631 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5632 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5633 | } |
5634 | // Store new_vl. |
5635 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
5636 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
5637 | } |
5638 | break; |
5639 | case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tuma: |
5640 | case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tuma: |
5641 | case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tuma: |
5642 | case RISCVVector::BI__builtin_rvv_vlseg2e8ff_v_tuma: |
5643 | ID = Intrinsic::riscv_vlseg2ff_mask; |
5644 | NF = 2; |
5645 | DefaultPolicy = 2; |
5646 | |
5647 | { |
5648 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
5649 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
5650 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5651 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5652 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5653 | SmallVector<llvm::Value*, 12> Operands; |
5654 | Value *NewVL; |
5655 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5656 | for (unsigned I = 0; I < NF; ++I) |
5657 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5658 | Operands.push_back(Ops[NF + 1]); |
5659 | Operands.push_back(Ops[NF]); |
5660 | Operands.push_back(Ops[NF + 3]); |
5661 | NewVL = Ops[NF + 2]; |
5662 | } else { |
5663 | for (unsigned I = 0; I < NF; ++I) |
5664 | Operands.push_back(Ops[NF + I + 1]); |
5665 | Operands.push_back(Ops[2 * NF + 1]); |
5666 | Operands.push_back(Ops[NF]); |
5667 | Operands.push_back(Ops[2 * NF + 3]); |
5668 | NewVL = Ops[2 * NF + 2]; |
5669 | } |
5670 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5671 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5671, __extension__ __PRETTY_FUNCTION__)); |
5672 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5673 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5674 | clang::CharUnits Align = |
5675 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5676 | for (unsigned I = 0; I < NF; ++I) { |
5677 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5678 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5679 | } |
5680 | // Store new_vl. |
5681 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
5682 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
5683 | } |
5684 | break; |
5685 | case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tama: |
5686 | case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tama: |
5687 | case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tama: |
5688 | case RISCVVector::BI__builtin_rvv_vlseg2e8ff_v_tama: |
5689 | ID = Intrinsic::riscv_vlseg2ff_mask; |
5690 | NF = 2; |
5691 | DefaultPolicy = 3; |
5692 | |
5693 | { |
5694 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
5695 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
5696 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5697 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5698 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5699 | SmallVector<llvm::Value*, 12> Operands; |
5700 | Value *NewVL; |
5701 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5702 | for (unsigned I = 0; I < NF; ++I) |
5703 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5704 | Operands.push_back(Ops[NF + 1]); |
5705 | Operands.push_back(Ops[NF]); |
5706 | Operands.push_back(Ops[NF + 3]); |
5707 | NewVL = Ops[NF + 2]; |
5708 | } else { |
5709 | for (unsigned I = 0; I < NF; ++I) |
5710 | Operands.push_back(Ops[NF + I + 1]); |
5711 | Operands.push_back(Ops[2 * NF + 1]); |
5712 | Operands.push_back(Ops[NF]); |
5713 | Operands.push_back(Ops[2 * NF + 3]); |
5714 | NewVL = Ops[2 * NF + 2]; |
5715 | } |
5716 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5717 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5717, __extension__ __PRETTY_FUNCTION__)); |
5718 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5719 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5720 | clang::CharUnits Align = |
5721 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5722 | for (unsigned I = 0; I < NF; ++I) { |
5723 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5724 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5725 | } |
5726 | // Store new_vl. |
5727 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
5728 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
5729 | } |
5730 | break; |
5731 | case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tumu: |
5732 | case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tumu: |
5733 | case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tumu: |
5734 | case RISCVVector::BI__builtin_rvv_vlseg2e8ff_v_tumu: |
5735 | ID = Intrinsic::riscv_vlseg2ff_mask; |
5736 | NF = 2; |
5737 | DefaultPolicy = 0; |
5738 | |
5739 | { |
5740 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
5741 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
5742 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5743 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5744 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5745 | SmallVector<llvm::Value*, 12> Operands; |
5746 | Value *NewVL; |
5747 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5748 | for (unsigned I = 0; I < NF; ++I) |
5749 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5750 | Operands.push_back(Ops[NF + 1]); |
5751 | Operands.push_back(Ops[NF]); |
5752 | Operands.push_back(Ops[NF + 3]); |
5753 | NewVL = Ops[NF + 2]; |
5754 | } else { |
5755 | for (unsigned I = 0; I < NF; ++I) |
5756 | Operands.push_back(Ops[NF + I + 1]); |
5757 | Operands.push_back(Ops[2 * NF + 1]); |
5758 | Operands.push_back(Ops[NF]); |
5759 | Operands.push_back(Ops[2 * NF + 3]); |
5760 | NewVL = Ops[2 * NF + 2]; |
5761 | } |
5762 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5763 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5763, __extension__ __PRETTY_FUNCTION__)); |
5764 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5765 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5766 | clang::CharUnits Align = |
5767 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5768 | for (unsigned I = 0; I < NF; ++I) { |
5769 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5770 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5771 | } |
5772 | // Store new_vl. |
5773 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
5774 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
5775 | } |
5776 | break; |
5777 | case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tamu: |
5778 | case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tamu: |
5779 | case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tamu: |
5780 | case RISCVVector::BI__builtin_rvv_vlseg2e8ff_v_tamu: |
5781 | ID = Intrinsic::riscv_vlseg2ff_mask; |
5782 | NF = 2; |
5783 | DefaultPolicy = 1; |
5784 | |
5785 | { |
5786 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
5787 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
5788 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5789 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5790 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5791 | SmallVector<llvm::Value*, 12> Operands; |
5792 | Value *NewVL; |
5793 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5794 | for (unsigned I = 0; I < NF; ++I) |
5795 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5796 | Operands.push_back(Ops[NF + 1]); |
5797 | Operands.push_back(Ops[NF]); |
5798 | Operands.push_back(Ops[NF + 3]); |
5799 | NewVL = Ops[NF + 2]; |
5800 | } else { |
5801 | for (unsigned I = 0; I < NF; ++I) |
5802 | Operands.push_back(Ops[NF + I + 1]); |
5803 | Operands.push_back(Ops[2 * NF + 1]); |
5804 | Operands.push_back(Ops[NF]); |
5805 | Operands.push_back(Ops[2 * NF + 3]); |
5806 | NewVL = Ops[2 * NF + 2]; |
5807 | } |
5808 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5809 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5809, __extension__ __PRETTY_FUNCTION__)); |
5810 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5811 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5812 | clang::CharUnits Align = |
5813 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5814 | for (unsigned I = 0; I < NF; ++I) { |
5815 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5816 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5817 | } |
5818 | // Store new_vl. |
5819 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
5820 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
5821 | } |
5822 | break; |
5823 | case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tu: |
5824 | case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tu: |
5825 | case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tu: |
5826 | case RISCVVector::BI__builtin_rvv_vlseg3e64_v_tu: |
5827 | ID = Intrinsic::riscv_vlseg3; |
5828 | NF = 3; |
5829 | DefaultPolicy = 0; |
5830 | |
5831 | { |
5832 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5833 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
5834 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
5835 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5836 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
5837 | SmallVector<llvm::Value*, 10> Operands; |
5838 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
5839 | for (unsigned I = 0; I < NF; ++I) |
5840 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5841 | Operands.push_back(Ops[NF]); |
5842 | Operands.push_back(Ops[NF + 1]); |
5843 | } else { |
5844 | for (unsigned I = 0; I < NF; ++I) |
5845 | Operands.push_back(Ops[NF + I]); |
5846 | Operands.push_back(Ops[2 * NF]); |
5847 | Operands.push_back(Ops[2 * NF + 1]); |
5848 | } |
5849 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5850 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5851 | clang::CharUnits Align = |
5852 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5853 | llvm::Value *V; |
5854 | for (unsigned I = 0; I < NF; ++I) { |
5855 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5856 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5857 | } |
5858 | return V; |
5859 | } |
5860 | break; |
5861 | case RISCVVector::BI__builtin_rvv_vlseg3e8_v_ta: |
5862 | case RISCVVector::BI__builtin_rvv_vlseg3e16_v_ta: |
5863 | case RISCVVector::BI__builtin_rvv_vlseg3e32_v_ta: |
5864 | case RISCVVector::BI__builtin_rvv_vlseg3e64_v_ta: |
5865 | ID = Intrinsic::riscv_vlseg3; |
5866 | NF = 3; |
5867 | DefaultPolicy = 1; |
5868 | |
5869 | { |
5870 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5871 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
5872 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
5873 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5874 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
5875 | SmallVector<llvm::Value*, 10> Operands; |
5876 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
5877 | for (unsigned I = 0; I < NF; ++I) |
5878 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5879 | Operands.push_back(Ops[NF]); |
5880 | Operands.push_back(Ops[NF + 1]); |
5881 | } else { |
5882 | for (unsigned I = 0; I < NF; ++I) |
5883 | Operands.push_back(Ops[NF + I]); |
5884 | Operands.push_back(Ops[2 * NF]); |
5885 | Operands.push_back(Ops[2 * NF + 1]); |
5886 | } |
5887 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5888 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5889 | clang::CharUnits Align = |
5890 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5891 | llvm::Value *V; |
5892 | for (unsigned I = 0; I < NF; ++I) { |
5893 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5894 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5895 | } |
5896 | return V; |
5897 | } |
5898 | break; |
5899 | case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tuma: |
5900 | case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tuma: |
5901 | case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tuma: |
5902 | case RISCVVector::BI__builtin_rvv_vlseg3e64_v_tuma: |
5903 | ID = Intrinsic::riscv_vlseg3_mask; |
5904 | NF = 3; |
5905 | DefaultPolicy = 2; |
5906 | |
5907 | { |
5908 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
5909 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
5910 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5911 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5912 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5913 | SmallVector<llvm::Value*, 12> Operands; |
5914 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5915 | for (unsigned I = 0; I < NF; ++I) |
5916 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5917 | Operands.push_back(Ops[NF + 1]); |
5918 | Operands.push_back(Ops[NF]); |
5919 | Operands.push_back(Ops[NF + 2]); |
5920 | } else { |
5921 | for (unsigned I = 0; I < NF; ++I) |
5922 | Operands.push_back(Ops[NF + I + 1]); |
5923 | Operands.push_back(Ops[2 * NF + 1]); |
5924 | Operands.push_back(Ops[NF]); |
5925 | Operands.push_back(Ops[2 * NF + 2]); |
5926 | } |
5927 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5928 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5928, __extension__ __PRETTY_FUNCTION__)); |
5929 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5930 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5931 | clang::CharUnits Align = |
5932 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5933 | llvm::Value *V; |
5934 | for (unsigned I = 0; I < NF; ++I) { |
5935 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5936 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5937 | } |
5938 | return V; |
5939 | } |
5940 | break; |
5941 | case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tama: |
5942 | case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tama: |
5943 | case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tama: |
5944 | case RISCVVector::BI__builtin_rvv_vlseg3e64_v_tama: |
5945 | ID = Intrinsic::riscv_vlseg3_mask; |
5946 | NF = 3; |
5947 | DefaultPolicy = 3; |
5948 | |
5949 | { |
5950 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
5951 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
5952 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5953 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5954 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5955 | SmallVector<llvm::Value*, 12> Operands; |
5956 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5957 | for (unsigned I = 0; I < NF; ++I) |
5958 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
5959 | Operands.push_back(Ops[NF + 1]); |
5960 | Operands.push_back(Ops[NF]); |
5961 | Operands.push_back(Ops[NF + 2]); |
5962 | } else { |
5963 | for (unsigned I = 0; I < NF; ++I) |
5964 | Operands.push_back(Ops[NF + I + 1]); |
5965 | Operands.push_back(Ops[2 * NF + 1]); |
5966 | Operands.push_back(Ops[NF]); |
5967 | Operands.push_back(Ops[2 * NF + 2]); |
5968 | } |
5969 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
5970 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 5970, __extension__ __PRETTY_FUNCTION__)); |
5971 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
5972 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
5973 | clang::CharUnits Align = |
5974 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
5975 | llvm::Value *V; |
5976 | for (unsigned I = 0; I < NF; ++I) { |
5977 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
5978 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
5979 | } |
5980 | return V; |
5981 | } |
5982 | break; |
5983 | case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tumu: |
5984 | case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tumu: |
5985 | case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tumu: |
5986 | case RISCVVector::BI__builtin_rvv_vlseg3e64_v_tumu: |
5987 | ID = Intrinsic::riscv_vlseg3_mask; |
5988 | NF = 3; |
5989 | DefaultPolicy = 0; |
5990 | |
5991 | { |
5992 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
5993 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
5994 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
5995 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
5996 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
5997 | SmallVector<llvm::Value*, 12> Operands; |
5998 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
5999 | for (unsigned I = 0; I < NF; ++I) |
6000 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6001 | Operands.push_back(Ops[NF + 1]); |
6002 | Operands.push_back(Ops[NF]); |
6003 | Operands.push_back(Ops[NF + 2]); |
6004 | } else { |
6005 | for (unsigned I = 0; I < NF; ++I) |
6006 | Operands.push_back(Ops[NF + I + 1]); |
6007 | Operands.push_back(Ops[2 * NF + 1]); |
6008 | Operands.push_back(Ops[NF]); |
6009 | Operands.push_back(Ops[2 * NF + 2]); |
6010 | } |
6011 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6012 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6012, __extension__ __PRETTY_FUNCTION__)); |
6013 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6014 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6015 | clang::CharUnits Align = |
6016 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6017 | llvm::Value *V; |
6018 | for (unsigned I = 0; I < NF; ++I) { |
6019 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6020 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6021 | } |
6022 | return V; |
6023 | } |
6024 | break; |
6025 | case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tamu: |
6026 | case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tamu: |
6027 | case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tamu: |
6028 | case RISCVVector::BI__builtin_rvv_vlseg3e64_v_tamu: |
6029 | ID = Intrinsic::riscv_vlseg3_mask; |
6030 | NF = 3; |
6031 | DefaultPolicy = 1; |
6032 | |
6033 | { |
6034 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
6035 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
6036 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6037 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6038 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6039 | SmallVector<llvm::Value*, 12> Operands; |
6040 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6041 | for (unsigned I = 0; I < NF; ++I) |
6042 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6043 | Operands.push_back(Ops[NF + 1]); |
6044 | Operands.push_back(Ops[NF]); |
6045 | Operands.push_back(Ops[NF + 2]); |
6046 | } else { |
6047 | for (unsigned I = 0; I < NF; ++I) |
6048 | Operands.push_back(Ops[NF + I + 1]); |
6049 | Operands.push_back(Ops[2 * NF + 1]); |
6050 | Operands.push_back(Ops[NF]); |
6051 | Operands.push_back(Ops[2 * NF + 2]); |
6052 | } |
6053 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6054 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6054, __extension__ __PRETTY_FUNCTION__)); |
6055 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6056 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6057 | clang::CharUnits Align = |
6058 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6059 | llvm::Value *V; |
6060 | for (unsigned I = 0; I < NF; ++I) { |
6061 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6062 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6063 | } |
6064 | return V; |
6065 | } |
6066 | break; |
6067 | case RISCVVector::BI__builtin_rvv_vlseg3e8ff_v_tu: |
6068 | case RISCVVector::BI__builtin_rvv_vlseg3e16ff_v_tu: |
6069 | case RISCVVector::BI__builtin_rvv_vlseg3e32ff_v_tu: |
6070 | case RISCVVector::BI__builtin_rvv_vlseg3e64ff_v_tu: |
6071 | ID = Intrinsic::riscv_vlseg3ff; |
6072 | NF = 3; |
6073 | DefaultPolicy = 0; |
6074 | |
6075 | { |
6076 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
6077 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
6078 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6079 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6080 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
6081 | SmallVector<llvm::Value*, 12> Operands; |
6082 | Value *NewVL; |
6083 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
6084 | for (unsigned I = 0; I < NF; ++I) |
6085 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6086 | Operands.push_back(Ops[NF]); |
6087 | Operands.push_back(Ops[NF + 2]); |
6088 | NewVL = Ops[NF + 1]; |
6089 | } else { |
6090 | for (unsigned I = 0; I < NF; ++I) |
6091 | Operands.push_back(Ops[NF + I]); |
6092 | Operands.push_back(Ops[2 * NF]); |
6093 | Operands.push_back(Ops[2 * NF + 2]); |
6094 | NewVL = Ops[2 * NF + 1]; |
6095 | } |
6096 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6097 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6098 | clang::CharUnits Align = |
6099 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6100 | for (unsigned I = 0; I < NF; ++I) { |
6101 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6102 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6103 | } |
6104 | // Store new_vl. |
6105 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6106 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6107 | } |
6108 | break; |
6109 | case RISCVVector::BI__builtin_rvv_vlseg3e8ff_v_ta: |
6110 | case RISCVVector::BI__builtin_rvv_vlseg3e16ff_v_ta: |
6111 | case RISCVVector::BI__builtin_rvv_vlseg3e32ff_v_ta: |
6112 | case RISCVVector::BI__builtin_rvv_vlseg3e64ff_v_ta: |
6113 | ID = Intrinsic::riscv_vlseg3ff; |
6114 | NF = 3; |
6115 | DefaultPolicy = 1; |
6116 | |
6117 | { |
6118 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
6119 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
6120 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6121 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6122 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
6123 | SmallVector<llvm::Value*, 12> Operands; |
6124 | Value *NewVL; |
6125 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
6126 | for (unsigned I = 0; I < NF; ++I) |
6127 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6128 | Operands.push_back(Ops[NF]); |
6129 | Operands.push_back(Ops[NF + 2]); |
6130 | NewVL = Ops[NF + 1]; |
6131 | } else { |
6132 | for (unsigned I = 0; I < NF; ++I) |
6133 | Operands.push_back(Ops[NF + I]); |
6134 | Operands.push_back(Ops[2 * NF]); |
6135 | Operands.push_back(Ops[2 * NF + 2]); |
6136 | NewVL = Ops[2 * NF + 1]; |
6137 | } |
6138 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6139 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6140 | clang::CharUnits Align = |
6141 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6142 | for (unsigned I = 0; I < NF; ++I) { |
6143 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6144 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6145 | } |
6146 | // Store new_vl. |
6147 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6148 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6149 | } |
6150 | break; |
6151 | case RISCVVector::BI__builtin_rvv_vlseg3e8ff_v_tuma: |
6152 | case RISCVVector::BI__builtin_rvv_vlseg3e16ff_v_tuma: |
6153 | case RISCVVector::BI__builtin_rvv_vlseg3e32ff_v_tuma: |
6154 | case RISCVVector::BI__builtin_rvv_vlseg3e64ff_v_tuma: |
6155 | ID = Intrinsic::riscv_vlseg3ff_mask; |
6156 | NF = 3; |
6157 | DefaultPolicy = 2; |
6158 | |
6159 | { |
6160 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
6161 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
6162 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6163 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6164 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6165 | SmallVector<llvm::Value*, 12> Operands; |
6166 | Value *NewVL; |
6167 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6168 | for (unsigned I = 0; I < NF; ++I) |
6169 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6170 | Operands.push_back(Ops[NF + 1]); |
6171 | Operands.push_back(Ops[NF]); |
6172 | Operands.push_back(Ops[NF + 3]); |
6173 | NewVL = Ops[NF + 2]; |
6174 | } else { |
6175 | for (unsigned I = 0; I < NF; ++I) |
6176 | Operands.push_back(Ops[NF + I + 1]); |
6177 | Operands.push_back(Ops[2 * NF + 1]); |
6178 | Operands.push_back(Ops[NF]); |
6179 | Operands.push_back(Ops[2 * NF + 3]); |
6180 | NewVL = Ops[2 * NF + 2]; |
6181 | } |
6182 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6183 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6183, __extension__ __PRETTY_FUNCTION__)); |
6184 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6185 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6186 | clang::CharUnits Align = |
6187 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6188 | for (unsigned I = 0; I < NF; ++I) { |
6189 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6190 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6191 | } |
6192 | // Store new_vl. |
6193 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6194 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6195 | } |
6196 | break; |
6197 | case RISCVVector::BI__builtin_rvv_vlseg3e8ff_v_tama: |
6198 | case RISCVVector::BI__builtin_rvv_vlseg3e16ff_v_tama: |
6199 | case RISCVVector::BI__builtin_rvv_vlseg3e32ff_v_tama: |
6200 | case RISCVVector::BI__builtin_rvv_vlseg3e64ff_v_tama: |
6201 | ID = Intrinsic::riscv_vlseg3ff_mask; |
6202 | NF = 3; |
6203 | DefaultPolicy = 3; |
6204 | |
6205 | { |
6206 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
6207 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
6208 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6209 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6210 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6211 | SmallVector<llvm::Value*, 12> Operands; |
6212 | Value *NewVL; |
6213 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6214 | for (unsigned I = 0; I < NF; ++I) |
6215 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6216 | Operands.push_back(Ops[NF + 1]); |
6217 | Operands.push_back(Ops[NF]); |
6218 | Operands.push_back(Ops[NF + 3]); |
6219 | NewVL = Ops[NF + 2]; |
6220 | } else { |
6221 | for (unsigned I = 0; I < NF; ++I) |
6222 | Operands.push_back(Ops[NF + I + 1]); |
6223 | Operands.push_back(Ops[2 * NF + 1]); |
6224 | Operands.push_back(Ops[NF]); |
6225 | Operands.push_back(Ops[2 * NF + 3]); |
6226 | NewVL = Ops[2 * NF + 2]; |
6227 | } |
6228 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6229 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6229, __extension__ __PRETTY_FUNCTION__)); |
6230 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6231 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6232 | clang::CharUnits Align = |
6233 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6234 | for (unsigned I = 0; I < NF; ++I) { |
6235 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6236 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6237 | } |
6238 | // Store new_vl. |
6239 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6240 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6241 | } |
6242 | break; |
6243 | case RISCVVector::BI__builtin_rvv_vlseg3e8ff_v_tumu: |
6244 | case RISCVVector::BI__builtin_rvv_vlseg3e16ff_v_tumu: |
6245 | case RISCVVector::BI__builtin_rvv_vlseg3e32ff_v_tumu: |
6246 | case RISCVVector::BI__builtin_rvv_vlseg3e64ff_v_tumu: |
6247 | ID = Intrinsic::riscv_vlseg3ff_mask; |
6248 | NF = 3; |
6249 | DefaultPolicy = 0; |
6250 | |
6251 | { |
6252 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
6253 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
6254 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6255 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6256 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6257 | SmallVector<llvm::Value*, 12> Operands; |
6258 | Value *NewVL; |
6259 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6260 | for (unsigned I = 0; I < NF; ++I) |
6261 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6262 | Operands.push_back(Ops[NF + 1]); |
6263 | Operands.push_back(Ops[NF]); |
6264 | Operands.push_back(Ops[NF + 3]); |
6265 | NewVL = Ops[NF + 2]; |
6266 | } else { |
6267 | for (unsigned I = 0; I < NF; ++I) |
6268 | Operands.push_back(Ops[NF + I + 1]); |
6269 | Operands.push_back(Ops[2 * NF + 1]); |
6270 | Operands.push_back(Ops[NF]); |
6271 | Operands.push_back(Ops[2 * NF + 3]); |
6272 | NewVL = Ops[2 * NF + 2]; |
6273 | } |
6274 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6275 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6275, __extension__ __PRETTY_FUNCTION__)); |
6276 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6277 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6278 | clang::CharUnits Align = |
6279 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6280 | for (unsigned I = 0; I < NF; ++I) { |
6281 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6282 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6283 | } |
6284 | // Store new_vl. |
6285 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6286 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6287 | } |
6288 | break; |
6289 | case RISCVVector::BI__builtin_rvv_vlseg3e8ff_v_tamu: |
6290 | case RISCVVector::BI__builtin_rvv_vlseg3e16ff_v_tamu: |
6291 | case RISCVVector::BI__builtin_rvv_vlseg3e32ff_v_tamu: |
6292 | case RISCVVector::BI__builtin_rvv_vlseg3e64ff_v_tamu: |
6293 | ID = Intrinsic::riscv_vlseg3ff_mask; |
6294 | NF = 3; |
6295 | DefaultPolicy = 1; |
6296 | |
6297 | { |
6298 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
6299 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
6300 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6301 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6302 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6303 | SmallVector<llvm::Value*, 12> Operands; |
6304 | Value *NewVL; |
6305 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6306 | for (unsigned I = 0; I < NF; ++I) |
6307 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6308 | Operands.push_back(Ops[NF + 1]); |
6309 | Operands.push_back(Ops[NF]); |
6310 | Operands.push_back(Ops[NF + 3]); |
6311 | NewVL = Ops[NF + 2]; |
6312 | } else { |
6313 | for (unsigned I = 0; I < NF; ++I) |
6314 | Operands.push_back(Ops[NF + I + 1]); |
6315 | Operands.push_back(Ops[2 * NF + 1]); |
6316 | Operands.push_back(Ops[NF]); |
6317 | Operands.push_back(Ops[2 * NF + 3]); |
6318 | NewVL = Ops[2 * NF + 2]; |
6319 | } |
6320 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6321 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6321, __extension__ __PRETTY_FUNCTION__)); |
6322 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6323 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6324 | clang::CharUnits Align = |
6325 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6326 | for (unsigned I = 0; I < NF; ++I) { |
6327 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6328 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6329 | } |
6330 | // Store new_vl. |
6331 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6332 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6333 | } |
6334 | break; |
6335 | case RISCVVector::BI__builtin_rvv_vlseg4e8_v_tu: |
6336 | case RISCVVector::BI__builtin_rvv_vlseg4e16_v_tu: |
6337 | case RISCVVector::BI__builtin_rvv_vlseg4e32_v_tu: |
6338 | case RISCVVector::BI__builtin_rvv_vlseg4e64_v_tu: |
6339 | ID = Intrinsic::riscv_vlseg4; |
6340 | NF = 4; |
6341 | DefaultPolicy = 0; |
6342 | |
6343 | { |
6344 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6345 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
6346 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
6347 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6348 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
6349 | SmallVector<llvm::Value*, 10> Operands; |
6350 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
6351 | for (unsigned I = 0; I < NF; ++I) |
6352 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6353 | Operands.push_back(Ops[NF]); |
6354 | Operands.push_back(Ops[NF + 1]); |
6355 | } else { |
6356 | for (unsigned I = 0; I < NF; ++I) |
6357 | Operands.push_back(Ops[NF + I]); |
6358 | Operands.push_back(Ops[2 * NF]); |
6359 | Operands.push_back(Ops[2 * NF + 1]); |
6360 | } |
6361 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6362 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6363 | clang::CharUnits Align = |
6364 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6365 | llvm::Value *V; |
6366 | for (unsigned I = 0; I < NF; ++I) { |
6367 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6368 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6369 | } |
6370 | return V; |
6371 | } |
6372 | break; |
6373 | case RISCVVector::BI__builtin_rvv_vlseg4e8_v_ta: |
6374 | case RISCVVector::BI__builtin_rvv_vlseg4e16_v_ta: |
6375 | case RISCVVector::BI__builtin_rvv_vlseg4e32_v_ta: |
6376 | case RISCVVector::BI__builtin_rvv_vlseg4e64_v_ta: |
6377 | ID = Intrinsic::riscv_vlseg4; |
6378 | NF = 4; |
6379 | DefaultPolicy = 1; |
6380 | |
6381 | { |
6382 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6383 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
6384 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
6385 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6386 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
6387 | SmallVector<llvm::Value*, 10> Operands; |
6388 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
6389 | for (unsigned I = 0; I < NF; ++I) |
6390 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6391 | Operands.push_back(Ops[NF]); |
6392 | Operands.push_back(Ops[NF + 1]); |
6393 | } else { |
6394 | for (unsigned I = 0; I < NF; ++I) |
6395 | Operands.push_back(Ops[NF + I]); |
6396 | Operands.push_back(Ops[2 * NF]); |
6397 | Operands.push_back(Ops[2 * NF + 1]); |
6398 | } |
6399 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6400 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6401 | clang::CharUnits Align = |
6402 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6403 | llvm::Value *V; |
6404 | for (unsigned I = 0; I < NF; ++I) { |
6405 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6406 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6407 | } |
6408 | return V; |
6409 | } |
6410 | break; |
6411 | case RISCVVector::BI__builtin_rvv_vlseg4e8_v_tuma: |
6412 | case RISCVVector::BI__builtin_rvv_vlseg4e16_v_tuma: |
6413 | case RISCVVector::BI__builtin_rvv_vlseg4e32_v_tuma: |
6414 | case RISCVVector::BI__builtin_rvv_vlseg4e64_v_tuma: |
6415 | ID = Intrinsic::riscv_vlseg4_mask; |
6416 | NF = 4; |
6417 | DefaultPolicy = 2; |
6418 | |
6419 | { |
6420 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
6421 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
6422 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6423 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6424 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6425 | SmallVector<llvm::Value*, 12> Operands; |
6426 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6427 | for (unsigned I = 0; I < NF; ++I) |
6428 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6429 | Operands.push_back(Ops[NF + 1]); |
6430 | Operands.push_back(Ops[NF]); |
6431 | Operands.push_back(Ops[NF + 2]); |
6432 | } else { |
6433 | for (unsigned I = 0; I < NF; ++I) |
6434 | Operands.push_back(Ops[NF + I + 1]); |
6435 | Operands.push_back(Ops[2 * NF + 1]); |
6436 | Operands.push_back(Ops[NF]); |
6437 | Operands.push_back(Ops[2 * NF + 2]); |
6438 | } |
6439 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6440 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6440, __extension__ __PRETTY_FUNCTION__)); |
6441 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6442 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6443 | clang::CharUnits Align = |
6444 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6445 | llvm::Value *V; |
6446 | for (unsigned I = 0; I < NF; ++I) { |
6447 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6448 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6449 | } |
6450 | return V; |
6451 | } |
6452 | break; |
6453 | case RISCVVector::BI__builtin_rvv_vlseg4e8_v_tama: |
6454 | case RISCVVector::BI__builtin_rvv_vlseg4e16_v_tama: |
6455 | case RISCVVector::BI__builtin_rvv_vlseg4e32_v_tama: |
6456 | case RISCVVector::BI__builtin_rvv_vlseg4e64_v_tama: |
6457 | ID = Intrinsic::riscv_vlseg4_mask; |
6458 | NF = 4; |
6459 | DefaultPolicy = 3; |
6460 | |
6461 | { |
6462 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
6463 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
6464 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6465 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6466 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6467 | SmallVector<llvm::Value*, 12> Operands; |
6468 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6469 | for (unsigned I = 0; I < NF; ++I) |
6470 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6471 | Operands.push_back(Ops[NF + 1]); |
6472 | Operands.push_back(Ops[NF]); |
6473 | Operands.push_back(Ops[NF + 2]); |
6474 | } else { |
6475 | for (unsigned I = 0; I < NF; ++I) |
6476 | Operands.push_back(Ops[NF + I + 1]); |
6477 | Operands.push_back(Ops[2 * NF + 1]); |
6478 | Operands.push_back(Ops[NF]); |
6479 | Operands.push_back(Ops[2 * NF + 2]); |
6480 | } |
6481 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6482 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6482, __extension__ __PRETTY_FUNCTION__)); |
6483 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6484 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6485 | clang::CharUnits Align = |
6486 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6487 | llvm::Value *V; |
6488 | for (unsigned I = 0; I < NF; ++I) { |
6489 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6490 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6491 | } |
6492 | return V; |
6493 | } |
6494 | break; |
6495 | case RISCVVector::BI__builtin_rvv_vlseg4e8_v_tumu: |
6496 | case RISCVVector::BI__builtin_rvv_vlseg4e16_v_tumu: |
6497 | case RISCVVector::BI__builtin_rvv_vlseg4e32_v_tumu: |
6498 | case RISCVVector::BI__builtin_rvv_vlseg4e64_v_tumu: |
6499 | ID = Intrinsic::riscv_vlseg4_mask; |
6500 | NF = 4; |
6501 | DefaultPolicy = 0; |
6502 | |
6503 | { |
6504 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
6505 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
6506 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6507 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6508 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6509 | SmallVector<llvm::Value*, 12> Operands; |
6510 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6511 | for (unsigned I = 0; I < NF; ++I) |
6512 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6513 | Operands.push_back(Ops[NF + 1]); |
6514 | Operands.push_back(Ops[NF]); |
6515 | Operands.push_back(Ops[NF + 2]); |
6516 | } else { |
6517 | for (unsigned I = 0; I < NF; ++I) |
6518 | Operands.push_back(Ops[NF + I + 1]); |
6519 | Operands.push_back(Ops[2 * NF + 1]); |
6520 | Operands.push_back(Ops[NF]); |
6521 | Operands.push_back(Ops[2 * NF + 2]); |
6522 | } |
6523 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6524 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6524, __extension__ __PRETTY_FUNCTION__)); |
6525 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6526 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6527 | clang::CharUnits Align = |
6528 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6529 | llvm::Value *V; |
6530 | for (unsigned I = 0; I < NF; ++I) { |
6531 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6532 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6533 | } |
6534 | return V; |
6535 | } |
6536 | break; |
6537 | case RISCVVector::BI__builtin_rvv_vlseg4e8_v_tamu: |
6538 | case RISCVVector::BI__builtin_rvv_vlseg4e16_v_tamu: |
6539 | case RISCVVector::BI__builtin_rvv_vlseg4e32_v_tamu: |
6540 | case RISCVVector::BI__builtin_rvv_vlseg4e64_v_tamu: |
6541 | ID = Intrinsic::riscv_vlseg4_mask; |
6542 | NF = 4; |
6543 | DefaultPolicy = 1; |
6544 | |
6545 | { |
6546 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
6547 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
6548 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6549 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6550 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6551 | SmallVector<llvm::Value*, 12> Operands; |
6552 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6553 | for (unsigned I = 0; I < NF; ++I) |
6554 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6555 | Operands.push_back(Ops[NF + 1]); |
6556 | Operands.push_back(Ops[NF]); |
6557 | Operands.push_back(Ops[NF + 2]); |
6558 | } else { |
6559 | for (unsigned I = 0; I < NF; ++I) |
6560 | Operands.push_back(Ops[NF + I + 1]); |
6561 | Operands.push_back(Ops[2 * NF + 1]); |
6562 | Operands.push_back(Ops[NF]); |
6563 | Operands.push_back(Ops[2 * NF + 2]); |
6564 | } |
6565 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6566 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6566, __extension__ __PRETTY_FUNCTION__)); |
6567 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6568 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6569 | clang::CharUnits Align = |
6570 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6571 | llvm::Value *V; |
6572 | for (unsigned I = 0; I < NF; ++I) { |
6573 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6574 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6575 | } |
6576 | return V; |
6577 | } |
6578 | break; |
6579 | case RISCVVector::BI__builtin_rvv_vlseg4e8ff_v_tu: |
6580 | case RISCVVector::BI__builtin_rvv_vlseg4e16ff_v_tu: |
6581 | case RISCVVector::BI__builtin_rvv_vlseg4e32ff_v_tu: |
6582 | case RISCVVector::BI__builtin_rvv_vlseg4e64ff_v_tu: |
6583 | ID = Intrinsic::riscv_vlseg4ff; |
6584 | NF = 4; |
6585 | DefaultPolicy = 0; |
6586 | |
6587 | { |
6588 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
6589 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
6590 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6591 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6592 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
6593 | SmallVector<llvm::Value*, 12> Operands; |
6594 | Value *NewVL; |
6595 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
6596 | for (unsigned I = 0; I < NF; ++I) |
6597 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6598 | Operands.push_back(Ops[NF]); |
6599 | Operands.push_back(Ops[NF + 2]); |
6600 | NewVL = Ops[NF + 1]; |
6601 | } else { |
6602 | for (unsigned I = 0; I < NF; ++I) |
6603 | Operands.push_back(Ops[NF + I]); |
6604 | Operands.push_back(Ops[2 * NF]); |
6605 | Operands.push_back(Ops[2 * NF + 2]); |
6606 | NewVL = Ops[2 * NF + 1]; |
6607 | } |
6608 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6609 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6610 | clang::CharUnits Align = |
6611 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6612 | for (unsigned I = 0; I < NF; ++I) { |
6613 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6614 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6615 | } |
6616 | // Store new_vl. |
6617 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6618 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6619 | } |
6620 | break; |
6621 | case RISCVVector::BI__builtin_rvv_vlseg4e8ff_v_ta: |
6622 | case RISCVVector::BI__builtin_rvv_vlseg4e16ff_v_ta: |
6623 | case RISCVVector::BI__builtin_rvv_vlseg4e32ff_v_ta: |
6624 | case RISCVVector::BI__builtin_rvv_vlseg4e64ff_v_ta: |
6625 | ID = Intrinsic::riscv_vlseg4ff; |
6626 | NF = 4; |
6627 | DefaultPolicy = 1; |
6628 | |
6629 | { |
6630 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
6631 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
6632 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6633 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6634 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
6635 | SmallVector<llvm::Value*, 12> Operands; |
6636 | Value *NewVL; |
6637 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
6638 | for (unsigned I = 0; I < NF; ++I) |
6639 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6640 | Operands.push_back(Ops[NF]); |
6641 | Operands.push_back(Ops[NF + 2]); |
6642 | NewVL = Ops[NF + 1]; |
6643 | } else { |
6644 | for (unsigned I = 0; I < NF; ++I) |
6645 | Operands.push_back(Ops[NF + I]); |
6646 | Operands.push_back(Ops[2 * NF]); |
6647 | Operands.push_back(Ops[2 * NF + 2]); |
6648 | NewVL = Ops[2 * NF + 1]; |
6649 | } |
6650 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6651 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6652 | clang::CharUnits Align = |
6653 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6654 | for (unsigned I = 0; I < NF; ++I) { |
6655 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6656 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6657 | } |
6658 | // Store new_vl. |
6659 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6660 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6661 | } |
6662 | break; |
6663 | case RISCVVector::BI__builtin_rvv_vlseg4e8ff_v_tuma: |
6664 | case RISCVVector::BI__builtin_rvv_vlseg4e16ff_v_tuma: |
6665 | case RISCVVector::BI__builtin_rvv_vlseg4e32ff_v_tuma: |
6666 | case RISCVVector::BI__builtin_rvv_vlseg4e64ff_v_tuma: |
6667 | ID = Intrinsic::riscv_vlseg4ff_mask; |
6668 | NF = 4; |
6669 | DefaultPolicy = 2; |
6670 | |
6671 | { |
6672 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
6673 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
6674 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6675 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6676 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6677 | SmallVector<llvm::Value*, 12> Operands; |
6678 | Value *NewVL; |
6679 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6680 | for (unsigned I = 0; I < NF; ++I) |
6681 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6682 | Operands.push_back(Ops[NF + 1]); |
6683 | Operands.push_back(Ops[NF]); |
6684 | Operands.push_back(Ops[NF + 3]); |
6685 | NewVL = Ops[NF + 2]; |
6686 | } else { |
6687 | for (unsigned I = 0; I < NF; ++I) |
6688 | Operands.push_back(Ops[NF + I + 1]); |
6689 | Operands.push_back(Ops[2 * NF + 1]); |
6690 | Operands.push_back(Ops[NF]); |
6691 | Operands.push_back(Ops[2 * NF + 3]); |
6692 | NewVL = Ops[2 * NF + 2]; |
6693 | } |
6694 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6695 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6695, __extension__ __PRETTY_FUNCTION__)); |
6696 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6697 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6698 | clang::CharUnits Align = |
6699 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6700 | for (unsigned I = 0; I < NF; ++I) { |
6701 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6702 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6703 | } |
6704 | // Store new_vl. |
6705 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6706 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6707 | } |
6708 | break; |
6709 | case RISCVVector::BI__builtin_rvv_vlseg4e8ff_v_tama: |
6710 | case RISCVVector::BI__builtin_rvv_vlseg4e16ff_v_tama: |
6711 | case RISCVVector::BI__builtin_rvv_vlseg4e32ff_v_tama: |
6712 | case RISCVVector::BI__builtin_rvv_vlseg4e64ff_v_tama: |
6713 | ID = Intrinsic::riscv_vlseg4ff_mask; |
6714 | NF = 4; |
6715 | DefaultPolicy = 3; |
6716 | |
6717 | { |
6718 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
6719 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
6720 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6721 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6722 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6723 | SmallVector<llvm::Value*, 12> Operands; |
6724 | Value *NewVL; |
6725 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6726 | for (unsigned I = 0; I < NF; ++I) |
6727 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6728 | Operands.push_back(Ops[NF + 1]); |
6729 | Operands.push_back(Ops[NF]); |
6730 | Operands.push_back(Ops[NF + 3]); |
6731 | NewVL = Ops[NF + 2]; |
6732 | } else { |
6733 | for (unsigned I = 0; I < NF; ++I) |
6734 | Operands.push_back(Ops[NF + I + 1]); |
6735 | Operands.push_back(Ops[2 * NF + 1]); |
6736 | Operands.push_back(Ops[NF]); |
6737 | Operands.push_back(Ops[2 * NF + 3]); |
6738 | NewVL = Ops[2 * NF + 2]; |
6739 | } |
6740 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6741 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6741, __extension__ __PRETTY_FUNCTION__)); |
6742 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6743 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6744 | clang::CharUnits Align = |
6745 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6746 | for (unsigned I = 0; I < NF; ++I) { |
6747 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6748 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6749 | } |
6750 | // Store new_vl. |
6751 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6752 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6753 | } |
6754 | break; |
6755 | case RISCVVector::BI__builtin_rvv_vlseg4e8ff_v_tumu: |
6756 | case RISCVVector::BI__builtin_rvv_vlseg4e16ff_v_tumu: |
6757 | case RISCVVector::BI__builtin_rvv_vlseg4e32ff_v_tumu: |
6758 | case RISCVVector::BI__builtin_rvv_vlseg4e64ff_v_tumu: |
6759 | ID = Intrinsic::riscv_vlseg4ff_mask; |
6760 | NF = 4; |
6761 | DefaultPolicy = 0; |
6762 | |
6763 | { |
6764 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
6765 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
6766 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6767 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6768 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6769 | SmallVector<llvm::Value*, 12> Operands; |
6770 | Value *NewVL; |
6771 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6772 | for (unsigned I = 0; I < NF; ++I) |
6773 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6774 | Operands.push_back(Ops[NF + 1]); |
6775 | Operands.push_back(Ops[NF]); |
6776 | Operands.push_back(Ops[NF + 3]); |
6777 | NewVL = Ops[NF + 2]; |
6778 | } else { |
6779 | for (unsigned I = 0; I < NF; ++I) |
6780 | Operands.push_back(Ops[NF + I + 1]); |
6781 | Operands.push_back(Ops[2 * NF + 1]); |
6782 | Operands.push_back(Ops[NF]); |
6783 | Operands.push_back(Ops[2 * NF + 3]); |
6784 | NewVL = Ops[2 * NF + 2]; |
6785 | } |
6786 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6787 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6787, __extension__ __PRETTY_FUNCTION__)); |
6788 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6789 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6790 | clang::CharUnits Align = |
6791 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6792 | for (unsigned I = 0; I < NF; ++I) { |
6793 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6794 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6795 | } |
6796 | // Store new_vl. |
6797 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6798 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6799 | } |
6800 | break; |
6801 | case RISCVVector::BI__builtin_rvv_vlseg4e8ff_v_tamu: |
6802 | case RISCVVector::BI__builtin_rvv_vlseg4e16ff_v_tamu: |
6803 | case RISCVVector::BI__builtin_rvv_vlseg4e32ff_v_tamu: |
6804 | case RISCVVector::BI__builtin_rvv_vlseg4e64ff_v_tamu: |
6805 | ID = Intrinsic::riscv_vlseg4ff_mask; |
6806 | NF = 4; |
6807 | DefaultPolicy = 1; |
6808 | |
6809 | { |
6810 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
6811 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
6812 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6813 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6814 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6815 | SmallVector<llvm::Value*, 12> Operands; |
6816 | Value *NewVL; |
6817 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6818 | for (unsigned I = 0; I < NF; ++I) |
6819 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6820 | Operands.push_back(Ops[NF + 1]); |
6821 | Operands.push_back(Ops[NF]); |
6822 | Operands.push_back(Ops[NF + 3]); |
6823 | NewVL = Ops[NF + 2]; |
6824 | } else { |
6825 | for (unsigned I = 0; I < NF; ++I) |
6826 | Operands.push_back(Ops[NF + I + 1]); |
6827 | Operands.push_back(Ops[2 * NF + 1]); |
6828 | Operands.push_back(Ops[NF]); |
6829 | Operands.push_back(Ops[2 * NF + 3]); |
6830 | NewVL = Ops[2 * NF + 2]; |
6831 | } |
6832 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6833 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6833, __extension__ __PRETTY_FUNCTION__)); |
6834 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6835 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6836 | clang::CharUnits Align = |
6837 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6838 | for (unsigned I = 0; I < NF; ++I) { |
6839 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6840 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6841 | } |
6842 | // Store new_vl. |
6843 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
6844 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
6845 | } |
6846 | break; |
6847 | case RISCVVector::BI__builtin_rvv_vlseg5e8_v_tu: |
6848 | case RISCVVector::BI__builtin_rvv_vlseg5e16_v_tu: |
6849 | case RISCVVector::BI__builtin_rvv_vlseg5e32_v_tu: |
6850 | case RISCVVector::BI__builtin_rvv_vlseg5e64_v_tu: |
6851 | ID = Intrinsic::riscv_vlseg5; |
6852 | NF = 5; |
6853 | DefaultPolicy = 0; |
6854 | |
6855 | { |
6856 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6857 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
6858 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
6859 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6860 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
6861 | SmallVector<llvm::Value*, 10> Operands; |
6862 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
6863 | for (unsigned I = 0; I < NF; ++I) |
6864 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6865 | Operands.push_back(Ops[NF]); |
6866 | Operands.push_back(Ops[NF + 1]); |
6867 | } else { |
6868 | for (unsigned I = 0; I < NF; ++I) |
6869 | Operands.push_back(Ops[NF + I]); |
6870 | Operands.push_back(Ops[2 * NF]); |
6871 | Operands.push_back(Ops[2 * NF + 1]); |
6872 | } |
6873 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6874 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6875 | clang::CharUnits Align = |
6876 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6877 | llvm::Value *V; |
6878 | for (unsigned I = 0; I < NF; ++I) { |
6879 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6880 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6881 | } |
6882 | return V; |
6883 | } |
6884 | break; |
6885 | case RISCVVector::BI__builtin_rvv_vlseg5e8_v_ta: |
6886 | case RISCVVector::BI__builtin_rvv_vlseg5e16_v_ta: |
6887 | case RISCVVector::BI__builtin_rvv_vlseg5e32_v_ta: |
6888 | case RISCVVector::BI__builtin_rvv_vlseg5e64_v_ta: |
6889 | ID = Intrinsic::riscv_vlseg5; |
6890 | NF = 5; |
6891 | DefaultPolicy = 1; |
6892 | |
6893 | { |
6894 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6895 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
6896 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
6897 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6898 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
6899 | SmallVector<llvm::Value*, 10> Operands; |
6900 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
6901 | for (unsigned I = 0; I < NF; ++I) |
6902 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6903 | Operands.push_back(Ops[NF]); |
6904 | Operands.push_back(Ops[NF + 1]); |
6905 | } else { |
6906 | for (unsigned I = 0; I < NF; ++I) |
6907 | Operands.push_back(Ops[NF + I]); |
6908 | Operands.push_back(Ops[2 * NF]); |
6909 | Operands.push_back(Ops[2 * NF + 1]); |
6910 | } |
6911 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6912 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6913 | clang::CharUnits Align = |
6914 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6915 | llvm::Value *V; |
6916 | for (unsigned I = 0; I < NF; ++I) { |
6917 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6918 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6919 | } |
6920 | return V; |
6921 | } |
6922 | break; |
6923 | case RISCVVector::BI__builtin_rvv_vlseg5e8_v_tuma: |
6924 | case RISCVVector::BI__builtin_rvv_vlseg5e16_v_tuma: |
6925 | case RISCVVector::BI__builtin_rvv_vlseg5e32_v_tuma: |
6926 | case RISCVVector::BI__builtin_rvv_vlseg5e64_v_tuma: |
6927 | ID = Intrinsic::riscv_vlseg5_mask; |
6928 | NF = 5; |
6929 | DefaultPolicy = 2; |
6930 | |
6931 | { |
6932 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
6933 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
6934 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6935 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6936 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6937 | SmallVector<llvm::Value*, 12> Operands; |
6938 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6939 | for (unsigned I = 0; I < NF; ++I) |
6940 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6941 | Operands.push_back(Ops[NF + 1]); |
6942 | Operands.push_back(Ops[NF]); |
6943 | Operands.push_back(Ops[NF + 2]); |
6944 | } else { |
6945 | for (unsigned I = 0; I < NF; ++I) |
6946 | Operands.push_back(Ops[NF + I + 1]); |
6947 | Operands.push_back(Ops[2 * NF + 1]); |
6948 | Operands.push_back(Ops[NF]); |
6949 | Operands.push_back(Ops[2 * NF + 2]); |
6950 | } |
6951 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6952 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6952, __extension__ __PRETTY_FUNCTION__)); |
6953 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6954 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6955 | clang::CharUnits Align = |
6956 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6957 | llvm::Value *V; |
6958 | for (unsigned I = 0; I < NF; ++I) { |
6959 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
6960 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
6961 | } |
6962 | return V; |
6963 | } |
6964 | break; |
6965 | case RISCVVector::BI__builtin_rvv_vlseg5e8_v_tama: |
6966 | case RISCVVector::BI__builtin_rvv_vlseg5e16_v_tama: |
6967 | case RISCVVector::BI__builtin_rvv_vlseg5e32_v_tama: |
6968 | case RISCVVector::BI__builtin_rvv_vlseg5e64_v_tama: |
6969 | ID = Intrinsic::riscv_vlseg5_mask; |
6970 | NF = 5; |
6971 | DefaultPolicy = 3; |
6972 | |
6973 | { |
6974 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
6975 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
6976 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
6977 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
6978 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
6979 | SmallVector<llvm::Value*, 12> Operands; |
6980 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
6981 | for (unsigned I = 0; I < NF; ++I) |
6982 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
6983 | Operands.push_back(Ops[NF + 1]); |
6984 | Operands.push_back(Ops[NF]); |
6985 | Operands.push_back(Ops[NF + 2]); |
6986 | } else { |
6987 | for (unsigned I = 0; I < NF; ++I) |
6988 | Operands.push_back(Ops[NF + I + 1]); |
6989 | Operands.push_back(Ops[2 * NF + 1]); |
6990 | Operands.push_back(Ops[NF]); |
6991 | Operands.push_back(Ops[2 * NF + 2]); |
6992 | } |
6993 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
6994 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 6994, __extension__ __PRETTY_FUNCTION__)); |
6995 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
6996 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
6997 | clang::CharUnits Align = |
6998 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
6999 | llvm::Value *V; |
7000 | for (unsigned I = 0; I < NF; ++I) { |
7001 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7002 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7003 | } |
7004 | return V; |
7005 | } |
7006 | break; |
7007 | case RISCVVector::BI__builtin_rvv_vlseg5e8_v_tumu: |
7008 | case RISCVVector::BI__builtin_rvv_vlseg5e16_v_tumu: |
7009 | case RISCVVector::BI__builtin_rvv_vlseg5e32_v_tumu: |
7010 | case RISCVVector::BI__builtin_rvv_vlseg5e64_v_tumu: |
7011 | ID = Intrinsic::riscv_vlseg5_mask; |
7012 | NF = 5; |
7013 | DefaultPolicy = 0; |
7014 | |
7015 | { |
7016 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
7017 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
7018 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7019 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7020 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7021 | SmallVector<llvm::Value*, 12> Operands; |
7022 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7023 | for (unsigned I = 0; I < NF; ++I) |
7024 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7025 | Operands.push_back(Ops[NF + 1]); |
7026 | Operands.push_back(Ops[NF]); |
7027 | Operands.push_back(Ops[NF + 2]); |
7028 | } else { |
7029 | for (unsigned I = 0; I < NF; ++I) |
7030 | Operands.push_back(Ops[NF + I + 1]); |
7031 | Operands.push_back(Ops[2 * NF + 1]); |
7032 | Operands.push_back(Ops[NF]); |
7033 | Operands.push_back(Ops[2 * NF + 2]); |
7034 | } |
7035 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7036 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7036, __extension__ __PRETTY_FUNCTION__)); |
7037 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7038 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7039 | clang::CharUnits Align = |
7040 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7041 | llvm::Value *V; |
7042 | for (unsigned I = 0; I < NF; ++I) { |
7043 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7044 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7045 | } |
7046 | return V; |
7047 | } |
7048 | break; |
7049 | case RISCVVector::BI__builtin_rvv_vlseg5e8_v_tamu: |
7050 | case RISCVVector::BI__builtin_rvv_vlseg5e16_v_tamu: |
7051 | case RISCVVector::BI__builtin_rvv_vlseg5e32_v_tamu: |
7052 | case RISCVVector::BI__builtin_rvv_vlseg5e64_v_tamu: |
7053 | ID = Intrinsic::riscv_vlseg5_mask; |
7054 | NF = 5; |
7055 | DefaultPolicy = 1; |
7056 | |
7057 | { |
7058 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
7059 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
7060 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7061 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7062 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7063 | SmallVector<llvm::Value*, 12> Operands; |
7064 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7065 | for (unsigned I = 0; I < NF; ++I) |
7066 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7067 | Operands.push_back(Ops[NF + 1]); |
7068 | Operands.push_back(Ops[NF]); |
7069 | Operands.push_back(Ops[NF + 2]); |
7070 | } else { |
7071 | for (unsigned I = 0; I < NF; ++I) |
7072 | Operands.push_back(Ops[NF + I + 1]); |
7073 | Operands.push_back(Ops[2 * NF + 1]); |
7074 | Operands.push_back(Ops[NF]); |
7075 | Operands.push_back(Ops[2 * NF + 2]); |
7076 | } |
7077 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7078 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7078, __extension__ __PRETTY_FUNCTION__)); |
7079 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7080 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7081 | clang::CharUnits Align = |
7082 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7083 | llvm::Value *V; |
7084 | for (unsigned I = 0; I < NF; ++I) { |
7085 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7086 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7087 | } |
7088 | return V; |
7089 | } |
7090 | break; |
7091 | case RISCVVector::BI__builtin_rvv_vlseg5e8ff_v_tu: |
7092 | case RISCVVector::BI__builtin_rvv_vlseg5e16ff_v_tu: |
7093 | case RISCVVector::BI__builtin_rvv_vlseg5e32ff_v_tu: |
7094 | case RISCVVector::BI__builtin_rvv_vlseg5e64ff_v_tu: |
7095 | ID = Intrinsic::riscv_vlseg5ff; |
7096 | NF = 5; |
7097 | DefaultPolicy = 0; |
7098 | |
7099 | { |
7100 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
7101 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
7102 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7103 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7104 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
7105 | SmallVector<llvm::Value*, 12> Operands; |
7106 | Value *NewVL; |
7107 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
7108 | for (unsigned I = 0; I < NF; ++I) |
7109 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7110 | Operands.push_back(Ops[NF]); |
7111 | Operands.push_back(Ops[NF + 2]); |
7112 | NewVL = Ops[NF + 1]; |
7113 | } else { |
7114 | for (unsigned I = 0; I < NF; ++I) |
7115 | Operands.push_back(Ops[NF + I]); |
7116 | Operands.push_back(Ops[2 * NF]); |
7117 | Operands.push_back(Ops[2 * NF + 2]); |
7118 | NewVL = Ops[2 * NF + 1]; |
7119 | } |
7120 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7121 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7122 | clang::CharUnits Align = |
7123 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7124 | for (unsigned I = 0; I < NF; ++I) { |
7125 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7126 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7127 | } |
7128 | // Store new_vl. |
7129 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7130 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7131 | } |
7132 | break; |
7133 | case RISCVVector::BI__builtin_rvv_vlseg5e8ff_v_ta: |
7134 | case RISCVVector::BI__builtin_rvv_vlseg5e16ff_v_ta: |
7135 | case RISCVVector::BI__builtin_rvv_vlseg5e32ff_v_ta: |
7136 | case RISCVVector::BI__builtin_rvv_vlseg5e64ff_v_ta: |
7137 | ID = Intrinsic::riscv_vlseg5ff; |
7138 | NF = 5; |
7139 | DefaultPolicy = 1; |
7140 | |
7141 | { |
7142 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
7143 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
7144 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7145 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7146 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
7147 | SmallVector<llvm::Value*, 12> Operands; |
7148 | Value *NewVL; |
7149 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
7150 | for (unsigned I = 0; I < NF; ++I) |
7151 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7152 | Operands.push_back(Ops[NF]); |
7153 | Operands.push_back(Ops[NF + 2]); |
7154 | NewVL = Ops[NF + 1]; |
7155 | } else { |
7156 | for (unsigned I = 0; I < NF; ++I) |
7157 | Operands.push_back(Ops[NF + I]); |
7158 | Operands.push_back(Ops[2 * NF]); |
7159 | Operands.push_back(Ops[2 * NF + 2]); |
7160 | NewVL = Ops[2 * NF + 1]; |
7161 | } |
7162 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7163 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7164 | clang::CharUnits Align = |
7165 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7166 | for (unsigned I = 0; I < NF; ++I) { |
7167 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7168 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7169 | } |
7170 | // Store new_vl. |
7171 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7172 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7173 | } |
7174 | break; |
7175 | case RISCVVector::BI__builtin_rvv_vlseg5e8ff_v_tuma: |
7176 | case RISCVVector::BI__builtin_rvv_vlseg5e16ff_v_tuma: |
7177 | case RISCVVector::BI__builtin_rvv_vlseg5e32ff_v_tuma: |
7178 | case RISCVVector::BI__builtin_rvv_vlseg5e64ff_v_tuma: |
7179 | ID = Intrinsic::riscv_vlseg5ff_mask; |
7180 | NF = 5; |
7181 | DefaultPolicy = 2; |
7182 | |
7183 | { |
7184 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
7185 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
7186 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7187 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7188 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7189 | SmallVector<llvm::Value*, 12> Operands; |
7190 | Value *NewVL; |
7191 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7192 | for (unsigned I = 0; I < NF; ++I) |
7193 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7194 | Operands.push_back(Ops[NF + 1]); |
7195 | Operands.push_back(Ops[NF]); |
7196 | Operands.push_back(Ops[NF + 3]); |
7197 | NewVL = Ops[NF + 2]; |
7198 | } else { |
7199 | for (unsigned I = 0; I < NF; ++I) |
7200 | Operands.push_back(Ops[NF + I + 1]); |
7201 | Operands.push_back(Ops[2 * NF + 1]); |
7202 | Operands.push_back(Ops[NF]); |
7203 | Operands.push_back(Ops[2 * NF + 3]); |
7204 | NewVL = Ops[2 * NF + 2]; |
7205 | } |
7206 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7207 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7207, __extension__ __PRETTY_FUNCTION__)); |
7208 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7209 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7210 | clang::CharUnits Align = |
7211 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7212 | for (unsigned I = 0; I < NF; ++I) { |
7213 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7214 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7215 | } |
7216 | // Store new_vl. |
7217 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7218 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7219 | } |
7220 | break; |
7221 | case RISCVVector::BI__builtin_rvv_vlseg5e8ff_v_tama: |
7222 | case RISCVVector::BI__builtin_rvv_vlseg5e16ff_v_tama: |
7223 | case RISCVVector::BI__builtin_rvv_vlseg5e32ff_v_tama: |
7224 | case RISCVVector::BI__builtin_rvv_vlseg5e64ff_v_tama: |
7225 | ID = Intrinsic::riscv_vlseg5ff_mask; |
7226 | NF = 5; |
7227 | DefaultPolicy = 3; |
7228 | |
7229 | { |
7230 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
7231 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
7232 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7233 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7234 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7235 | SmallVector<llvm::Value*, 12> Operands; |
7236 | Value *NewVL; |
7237 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7238 | for (unsigned I = 0; I < NF; ++I) |
7239 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7240 | Operands.push_back(Ops[NF + 1]); |
7241 | Operands.push_back(Ops[NF]); |
7242 | Operands.push_back(Ops[NF + 3]); |
7243 | NewVL = Ops[NF + 2]; |
7244 | } else { |
7245 | for (unsigned I = 0; I < NF; ++I) |
7246 | Operands.push_back(Ops[NF + I + 1]); |
7247 | Operands.push_back(Ops[2 * NF + 1]); |
7248 | Operands.push_back(Ops[NF]); |
7249 | Operands.push_back(Ops[2 * NF + 3]); |
7250 | NewVL = Ops[2 * NF + 2]; |
7251 | } |
7252 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7253 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7253, __extension__ __PRETTY_FUNCTION__)); |
7254 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7255 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7256 | clang::CharUnits Align = |
7257 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7258 | for (unsigned I = 0; I < NF; ++I) { |
7259 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7260 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7261 | } |
7262 | // Store new_vl. |
7263 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7264 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7265 | } |
7266 | break; |
7267 | case RISCVVector::BI__builtin_rvv_vlseg5e8ff_v_tumu: |
7268 | case RISCVVector::BI__builtin_rvv_vlseg5e16ff_v_tumu: |
7269 | case RISCVVector::BI__builtin_rvv_vlseg5e32ff_v_tumu: |
7270 | case RISCVVector::BI__builtin_rvv_vlseg5e64ff_v_tumu: |
7271 | ID = Intrinsic::riscv_vlseg5ff_mask; |
7272 | NF = 5; |
7273 | DefaultPolicy = 0; |
7274 | |
7275 | { |
7276 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
7277 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
7278 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7279 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7280 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7281 | SmallVector<llvm::Value*, 12> Operands; |
7282 | Value *NewVL; |
7283 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7284 | for (unsigned I = 0; I < NF; ++I) |
7285 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7286 | Operands.push_back(Ops[NF + 1]); |
7287 | Operands.push_back(Ops[NF]); |
7288 | Operands.push_back(Ops[NF + 3]); |
7289 | NewVL = Ops[NF + 2]; |
7290 | } else { |
7291 | for (unsigned I = 0; I < NF; ++I) |
7292 | Operands.push_back(Ops[NF + I + 1]); |
7293 | Operands.push_back(Ops[2 * NF + 1]); |
7294 | Operands.push_back(Ops[NF]); |
7295 | Operands.push_back(Ops[2 * NF + 3]); |
7296 | NewVL = Ops[2 * NF + 2]; |
7297 | } |
7298 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7299 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7299, __extension__ __PRETTY_FUNCTION__)); |
7300 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7301 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7302 | clang::CharUnits Align = |
7303 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7304 | for (unsigned I = 0; I < NF; ++I) { |
7305 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7306 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7307 | } |
7308 | // Store new_vl. |
7309 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7310 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7311 | } |
7312 | break; |
7313 | case RISCVVector::BI__builtin_rvv_vlseg5e8ff_v_tamu: |
7314 | case RISCVVector::BI__builtin_rvv_vlseg5e16ff_v_tamu: |
7315 | case RISCVVector::BI__builtin_rvv_vlseg5e32ff_v_tamu: |
7316 | case RISCVVector::BI__builtin_rvv_vlseg5e64ff_v_tamu: |
7317 | ID = Intrinsic::riscv_vlseg5ff_mask; |
7318 | NF = 5; |
7319 | DefaultPolicy = 1; |
7320 | |
7321 | { |
7322 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
7323 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
7324 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7325 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7326 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7327 | SmallVector<llvm::Value*, 12> Operands; |
7328 | Value *NewVL; |
7329 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7330 | for (unsigned I = 0; I < NF; ++I) |
7331 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7332 | Operands.push_back(Ops[NF + 1]); |
7333 | Operands.push_back(Ops[NF]); |
7334 | Operands.push_back(Ops[NF + 3]); |
7335 | NewVL = Ops[NF + 2]; |
7336 | } else { |
7337 | for (unsigned I = 0; I < NF; ++I) |
7338 | Operands.push_back(Ops[NF + I + 1]); |
7339 | Operands.push_back(Ops[2 * NF + 1]); |
7340 | Operands.push_back(Ops[NF]); |
7341 | Operands.push_back(Ops[2 * NF + 3]); |
7342 | NewVL = Ops[2 * NF + 2]; |
7343 | } |
7344 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7345 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7345, __extension__ __PRETTY_FUNCTION__)); |
7346 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7347 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7348 | clang::CharUnits Align = |
7349 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7350 | for (unsigned I = 0; I < NF; ++I) { |
7351 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7352 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7353 | } |
7354 | // Store new_vl. |
7355 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7356 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7357 | } |
7358 | break; |
7359 | case RISCVVector::BI__builtin_rvv_vlseg6e8_v_tu: |
7360 | case RISCVVector::BI__builtin_rvv_vlseg6e16_v_tu: |
7361 | case RISCVVector::BI__builtin_rvv_vlseg6e32_v_tu: |
7362 | case RISCVVector::BI__builtin_rvv_vlseg6e64_v_tu: |
7363 | ID = Intrinsic::riscv_vlseg6; |
7364 | NF = 6; |
7365 | DefaultPolicy = 0; |
7366 | |
7367 | { |
7368 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7369 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
7370 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
7371 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7372 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
7373 | SmallVector<llvm::Value*, 10> Operands; |
7374 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
7375 | for (unsigned I = 0; I < NF; ++I) |
7376 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7377 | Operands.push_back(Ops[NF]); |
7378 | Operands.push_back(Ops[NF + 1]); |
7379 | } else { |
7380 | for (unsigned I = 0; I < NF; ++I) |
7381 | Operands.push_back(Ops[NF + I]); |
7382 | Operands.push_back(Ops[2 * NF]); |
7383 | Operands.push_back(Ops[2 * NF + 1]); |
7384 | } |
7385 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7386 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7387 | clang::CharUnits Align = |
7388 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7389 | llvm::Value *V; |
7390 | for (unsigned I = 0; I < NF; ++I) { |
7391 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7392 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7393 | } |
7394 | return V; |
7395 | } |
7396 | break; |
7397 | case RISCVVector::BI__builtin_rvv_vlseg6e8_v_ta: |
7398 | case RISCVVector::BI__builtin_rvv_vlseg6e16_v_ta: |
7399 | case RISCVVector::BI__builtin_rvv_vlseg6e32_v_ta: |
7400 | case RISCVVector::BI__builtin_rvv_vlseg6e64_v_ta: |
7401 | ID = Intrinsic::riscv_vlseg6; |
7402 | NF = 6; |
7403 | DefaultPolicy = 1; |
7404 | |
7405 | { |
7406 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7407 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
7408 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
7409 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7410 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
7411 | SmallVector<llvm::Value*, 10> Operands; |
7412 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
7413 | for (unsigned I = 0; I < NF; ++I) |
7414 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7415 | Operands.push_back(Ops[NF]); |
7416 | Operands.push_back(Ops[NF + 1]); |
7417 | } else { |
7418 | for (unsigned I = 0; I < NF; ++I) |
7419 | Operands.push_back(Ops[NF + I]); |
7420 | Operands.push_back(Ops[2 * NF]); |
7421 | Operands.push_back(Ops[2 * NF + 1]); |
7422 | } |
7423 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7424 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7425 | clang::CharUnits Align = |
7426 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7427 | llvm::Value *V; |
7428 | for (unsigned I = 0; I < NF; ++I) { |
7429 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7430 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7431 | } |
7432 | return V; |
7433 | } |
7434 | break; |
7435 | case RISCVVector::BI__builtin_rvv_vlseg6e8_v_tuma: |
7436 | case RISCVVector::BI__builtin_rvv_vlseg6e16_v_tuma: |
7437 | case RISCVVector::BI__builtin_rvv_vlseg6e32_v_tuma: |
7438 | case RISCVVector::BI__builtin_rvv_vlseg6e64_v_tuma: |
7439 | ID = Intrinsic::riscv_vlseg6_mask; |
7440 | NF = 6; |
7441 | DefaultPolicy = 2; |
7442 | |
7443 | { |
7444 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
7445 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
7446 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7447 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7448 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7449 | SmallVector<llvm::Value*, 12> Operands; |
7450 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7451 | for (unsigned I = 0; I < NF; ++I) |
7452 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7453 | Operands.push_back(Ops[NF + 1]); |
7454 | Operands.push_back(Ops[NF]); |
7455 | Operands.push_back(Ops[NF + 2]); |
7456 | } else { |
7457 | for (unsigned I = 0; I < NF; ++I) |
7458 | Operands.push_back(Ops[NF + I + 1]); |
7459 | Operands.push_back(Ops[2 * NF + 1]); |
7460 | Operands.push_back(Ops[NF]); |
7461 | Operands.push_back(Ops[2 * NF + 2]); |
7462 | } |
7463 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7464 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7464, __extension__ __PRETTY_FUNCTION__)); |
7465 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7466 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7467 | clang::CharUnits Align = |
7468 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7469 | llvm::Value *V; |
7470 | for (unsigned I = 0; I < NF; ++I) { |
7471 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7472 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7473 | } |
7474 | return V; |
7475 | } |
7476 | break; |
7477 | case RISCVVector::BI__builtin_rvv_vlseg6e8_v_tama: |
7478 | case RISCVVector::BI__builtin_rvv_vlseg6e16_v_tama: |
7479 | case RISCVVector::BI__builtin_rvv_vlseg6e32_v_tama: |
7480 | case RISCVVector::BI__builtin_rvv_vlseg6e64_v_tama: |
7481 | ID = Intrinsic::riscv_vlseg6_mask; |
7482 | NF = 6; |
7483 | DefaultPolicy = 3; |
7484 | |
7485 | { |
7486 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
7487 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
7488 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7489 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7490 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7491 | SmallVector<llvm::Value*, 12> Operands; |
7492 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7493 | for (unsigned I = 0; I < NF; ++I) |
7494 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7495 | Operands.push_back(Ops[NF + 1]); |
7496 | Operands.push_back(Ops[NF]); |
7497 | Operands.push_back(Ops[NF + 2]); |
7498 | } else { |
7499 | for (unsigned I = 0; I < NF; ++I) |
7500 | Operands.push_back(Ops[NF + I + 1]); |
7501 | Operands.push_back(Ops[2 * NF + 1]); |
7502 | Operands.push_back(Ops[NF]); |
7503 | Operands.push_back(Ops[2 * NF + 2]); |
7504 | } |
7505 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7506 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7506, __extension__ __PRETTY_FUNCTION__)); |
7507 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7508 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7509 | clang::CharUnits Align = |
7510 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7511 | llvm::Value *V; |
7512 | for (unsigned I = 0; I < NF; ++I) { |
7513 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7514 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7515 | } |
7516 | return V; |
7517 | } |
7518 | break; |
7519 | case RISCVVector::BI__builtin_rvv_vlseg6e8_v_tumu: |
7520 | case RISCVVector::BI__builtin_rvv_vlseg6e16_v_tumu: |
7521 | case RISCVVector::BI__builtin_rvv_vlseg6e32_v_tumu: |
7522 | case RISCVVector::BI__builtin_rvv_vlseg6e64_v_tumu: |
7523 | ID = Intrinsic::riscv_vlseg6_mask; |
7524 | NF = 6; |
7525 | DefaultPolicy = 0; |
7526 | |
7527 | { |
7528 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
7529 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
7530 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7531 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7532 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7533 | SmallVector<llvm::Value*, 12> Operands; |
7534 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7535 | for (unsigned I = 0; I < NF; ++I) |
7536 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7537 | Operands.push_back(Ops[NF + 1]); |
7538 | Operands.push_back(Ops[NF]); |
7539 | Operands.push_back(Ops[NF + 2]); |
7540 | } else { |
7541 | for (unsigned I = 0; I < NF; ++I) |
7542 | Operands.push_back(Ops[NF + I + 1]); |
7543 | Operands.push_back(Ops[2 * NF + 1]); |
7544 | Operands.push_back(Ops[NF]); |
7545 | Operands.push_back(Ops[2 * NF + 2]); |
7546 | } |
7547 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7548 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7548, __extension__ __PRETTY_FUNCTION__)); |
7549 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7550 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7551 | clang::CharUnits Align = |
7552 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7553 | llvm::Value *V; |
7554 | for (unsigned I = 0; I < NF; ++I) { |
7555 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7556 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7557 | } |
7558 | return V; |
7559 | } |
7560 | break; |
7561 | case RISCVVector::BI__builtin_rvv_vlseg6e8_v_tamu: |
7562 | case RISCVVector::BI__builtin_rvv_vlseg6e16_v_tamu: |
7563 | case RISCVVector::BI__builtin_rvv_vlseg6e32_v_tamu: |
7564 | case RISCVVector::BI__builtin_rvv_vlseg6e64_v_tamu: |
7565 | ID = Intrinsic::riscv_vlseg6_mask; |
7566 | NF = 6; |
7567 | DefaultPolicy = 1; |
7568 | |
7569 | { |
7570 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
7571 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
7572 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7573 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7574 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7575 | SmallVector<llvm::Value*, 12> Operands; |
7576 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7577 | for (unsigned I = 0; I < NF; ++I) |
7578 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7579 | Operands.push_back(Ops[NF + 1]); |
7580 | Operands.push_back(Ops[NF]); |
7581 | Operands.push_back(Ops[NF + 2]); |
7582 | } else { |
7583 | for (unsigned I = 0; I < NF; ++I) |
7584 | Operands.push_back(Ops[NF + I + 1]); |
7585 | Operands.push_back(Ops[2 * NF + 1]); |
7586 | Operands.push_back(Ops[NF]); |
7587 | Operands.push_back(Ops[2 * NF + 2]); |
7588 | } |
7589 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7590 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7590, __extension__ __PRETTY_FUNCTION__)); |
7591 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7592 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7593 | clang::CharUnits Align = |
7594 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7595 | llvm::Value *V; |
7596 | for (unsigned I = 0; I < NF; ++I) { |
7597 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7598 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7599 | } |
7600 | return V; |
7601 | } |
7602 | break; |
7603 | case RISCVVector::BI__builtin_rvv_vlseg6e8ff_v_tu: |
7604 | case RISCVVector::BI__builtin_rvv_vlseg6e16ff_v_tu: |
7605 | case RISCVVector::BI__builtin_rvv_vlseg6e32ff_v_tu: |
7606 | case RISCVVector::BI__builtin_rvv_vlseg6e64ff_v_tu: |
7607 | ID = Intrinsic::riscv_vlseg6ff; |
7608 | NF = 6; |
7609 | DefaultPolicy = 0; |
7610 | |
7611 | { |
7612 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
7613 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
7614 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7615 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7616 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
7617 | SmallVector<llvm::Value*, 12> Operands; |
7618 | Value *NewVL; |
7619 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
7620 | for (unsigned I = 0; I < NF; ++I) |
7621 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7622 | Operands.push_back(Ops[NF]); |
7623 | Operands.push_back(Ops[NF + 2]); |
7624 | NewVL = Ops[NF + 1]; |
7625 | } else { |
7626 | for (unsigned I = 0; I < NF; ++I) |
7627 | Operands.push_back(Ops[NF + I]); |
7628 | Operands.push_back(Ops[2 * NF]); |
7629 | Operands.push_back(Ops[2 * NF + 2]); |
7630 | NewVL = Ops[2 * NF + 1]; |
7631 | } |
7632 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7633 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7634 | clang::CharUnits Align = |
7635 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7636 | for (unsigned I = 0; I < NF; ++I) { |
7637 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7638 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7639 | } |
7640 | // Store new_vl. |
7641 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7642 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7643 | } |
7644 | break; |
7645 | case RISCVVector::BI__builtin_rvv_vlseg6e8ff_v_ta: |
7646 | case RISCVVector::BI__builtin_rvv_vlseg6e16ff_v_ta: |
7647 | case RISCVVector::BI__builtin_rvv_vlseg6e32ff_v_ta: |
7648 | case RISCVVector::BI__builtin_rvv_vlseg6e64ff_v_ta: |
7649 | ID = Intrinsic::riscv_vlseg6ff; |
7650 | NF = 6; |
7651 | DefaultPolicy = 1; |
7652 | |
7653 | { |
7654 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
7655 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
7656 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7657 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7658 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
7659 | SmallVector<llvm::Value*, 12> Operands; |
7660 | Value *NewVL; |
7661 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
7662 | for (unsigned I = 0; I < NF; ++I) |
7663 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7664 | Operands.push_back(Ops[NF]); |
7665 | Operands.push_back(Ops[NF + 2]); |
7666 | NewVL = Ops[NF + 1]; |
7667 | } else { |
7668 | for (unsigned I = 0; I < NF; ++I) |
7669 | Operands.push_back(Ops[NF + I]); |
7670 | Operands.push_back(Ops[2 * NF]); |
7671 | Operands.push_back(Ops[2 * NF + 2]); |
7672 | NewVL = Ops[2 * NF + 1]; |
7673 | } |
7674 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7675 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7676 | clang::CharUnits Align = |
7677 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7678 | for (unsigned I = 0; I < NF; ++I) { |
7679 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7680 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7681 | } |
7682 | // Store new_vl. |
7683 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7684 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7685 | } |
7686 | break; |
7687 | case RISCVVector::BI__builtin_rvv_vlseg6e8ff_v_tuma: |
7688 | case RISCVVector::BI__builtin_rvv_vlseg6e16ff_v_tuma: |
7689 | case RISCVVector::BI__builtin_rvv_vlseg6e32ff_v_tuma: |
7690 | case RISCVVector::BI__builtin_rvv_vlseg6e64ff_v_tuma: |
7691 | ID = Intrinsic::riscv_vlseg6ff_mask; |
7692 | NF = 6; |
7693 | DefaultPolicy = 2; |
7694 | |
7695 | { |
7696 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
7697 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
7698 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7699 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7700 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7701 | SmallVector<llvm::Value*, 12> Operands; |
7702 | Value *NewVL; |
7703 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7704 | for (unsigned I = 0; I < NF; ++I) |
7705 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7706 | Operands.push_back(Ops[NF + 1]); |
7707 | Operands.push_back(Ops[NF]); |
7708 | Operands.push_back(Ops[NF + 3]); |
7709 | NewVL = Ops[NF + 2]; |
7710 | } else { |
7711 | for (unsigned I = 0; I < NF; ++I) |
7712 | Operands.push_back(Ops[NF + I + 1]); |
7713 | Operands.push_back(Ops[2 * NF + 1]); |
7714 | Operands.push_back(Ops[NF]); |
7715 | Operands.push_back(Ops[2 * NF + 3]); |
7716 | NewVL = Ops[2 * NF + 2]; |
7717 | } |
7718 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7719 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7719, __extension__ __PRETTY_FUNCTION__)); |
7720 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7721 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7722 | clang::CharUnits Align = |
7723 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7724 | for (unsigned I = 0; I < NF; ++I) { |
7725 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7726 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7727 | } |
7728 | // Store new_vl. |
7729 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7730 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7731 | } |
7732 | break; |
7733 | case RISCVVector::BI__builtin_rvv_vlseg6e8ff_v_tama: |
7734 | case RISCVVector::BI__builtin_rvv_vlseg6e16ff_v_tama: |
7735 | case RISCVVector::BI__builtin_rvv_vlseg6e32ff_v_tama: |
7736 | case RISCVVector::BI__builtin_rvv_vlseg6e64ff_v_tama: |
7737 | ID = Intrinsic::riscv_vlseg6ff_mask; |
7738 | NF = 6; |
7739 | DefaultPolicy = 3; |
7740 | |
7741 | { |
7742 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
7743 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
7744 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7745 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7746 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7747 | SmallVector<llvm::Value*, 12> Operands; |
7748 | Value *NewVL; |
7749 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7750 | for (unsigned I = 0; I < NF; ++I) |
7751 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7752 | Operands.push_back(Ops[NF + 1]); |
7753 | Operands.push_back(Ops[NF]); |
7754 | Operands.push_back(Ops[NF + 3]); |
7755 | NewVL = Ops[NF + 2]; |
7756 | } else { |
7757 | for (unsigned I = 0; I < NF; ++I) |
7758 | Operands.push_back(Ops[NF + I + 1]); |
7759 | Operands.push_back(Ops[2 * NF + 1]); |
7760 | Operands.push_back(Ops[NF]); |
7761 | Operands.push_back(Ops[2 * NF + 3]); |
7762 | NewVL = Ops[2 * NF + 2]; |
7763 | } |
7764 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7765 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7765, __extension__ __PRETTY_FUNCTION__)); |
7766 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7767 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7768 | clang::CharUnits Align = |
7769 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7770 | for (unsigned I = 0; I < NF; ++I) { |
7771 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7772 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7773 | } |
7774 | // Store new_vl. |
7775 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7776 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7777 | } |
7778 | break; |
7779 | case RISCVVector::BI__builtin_rvv_vlseg6e8ff_v_tumu: |
7780 | case RISCVVector::BI__builtin_rvv_vlseg6e16ff_v_tumu: |
7781 | case RISCVVector::BI__builtin_rvv_vlseg6e32ff_v_tumu: |
7782 | case RISCVVector::BI__builtin_rvv_vlseg6e64ff_v_tumu: |
7783 | ID = Intrinsic::riscv_vlseg6ff_mask; |
7784 | NF = 6; |
7785 | DefaultPolicy = 0; |
7786 | |
7787 | { |
7788 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
7789 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
7790 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7791 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7792 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7793 | SmallVector<llvm::Value*, 12> Operands; |
7794 | Value *NewVL; |
7795 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7796 | for (unsigned I = 0; I < NF; ++I) |
7797 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7798 | Operands.push_back(Ops[NF + 1]); |
7799 | Operands.push_back(Ops[NF]); |
7800 | Operands.push_back(Ops[NF + 3]); |
7801 | NewVL = Ops[NF + 2]; |
7802 | } else { |
7803 | for (unsigned I = 0; I < NF; ++I) |
7804 | Operands.push_back(Ops[NF + I + 1]); |
7805 | Operands.push_back(Ops[2 * NF + 1]); |
7806 | Operands.push_back(Ops[NF]); |
7807 | Operands.push_back(Ops[2 * NF + 3]); |
7808 | NewVL = Ops[2 * NF + 2]; |
7809 | } |
7810 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7811 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7811, __extension__ __PRETTY_FUNCTION__)); |
7812 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7813 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7814 | clang::CharUnits Align = |
7815 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7816 | for (unsigned I = 0; I < NF; ++I) { |
7817 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7818 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7819 | } |
7820 | // Store new_vl. |
7821 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7822 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7823 | } |
7824 | break; |
7825 | case RISCVVector::BI__builtin_rvv_vlseg6e8ff_v_tamu: |
7826 | case RISCVVector::BI__builtin_rvv_vlseg6e16ff_v_tamu: |
7827 | case RISCVVector::BI__builtin_rvv_vlseg6e32ff_v_tamu: |
7828 | case RISCVVector::BI__builtin_rvv_vlseg6e64ff_v_tamu: |
7829 | ID = Intrinsic::riscv_vlseg6ff_mask; |
7830 | NF = 6; |
7831 | DefaultPolicy = 1; |
7832 | |
7833 | { |
7834 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
7835 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
7836 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7837 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7838 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7839 | SmallVector<llvm::Value*, 12> Operands; |
7840 | Value *NewVL; |
7841 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7842 | for (unsigned I = 0; I < NF; ++I) |
7843 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7844 | Operands.push_back(Ops[NF + 1]); |
7845 | Operands.push_back(Ops[NF]); |
7846 | Operands.push_back(Ops[NF + 3]); |
7847 | NewVL = Ops[NF + 2]; |
7848 | } else { |
7849 | for (unsigned I = 0; I < NF; ++I) |
7850 | Operands.push_back(Ops[NF + I + 1]); |
7851 | Operands.push_back(Ops[2 * NF + 1]); |
7852 | Operands.push_back(Ops[NF]); |
7853 | Operands.push_back(Ops[2 * NF + 3]); |
7854 | NewVL = Ops[2 * NF + 2]; |
7855 | } |
7856 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7857 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7857, __extension__ __PRETTY_FUNCTION__)); |
7858 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7859 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7860 | clang::CharUnits Align = |
7861 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7862 | for (unsigned I = 0; I < NF; ++I) { |
7863 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7864 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7865 | } |
7866 | // Store new_vl. |
7867 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
7868 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
7869 | } |
7870 | break; |
7871 | case RISCVVector::BI__builtin_rvv_vlseg7e8_v_tu: |
7872 | case RISCVVector::BI__builtin_rvv_vlseg7e16_v_tu: |
7873 | case RISCVVector::BI__builtin_rvv_vlseg7e32_v_tu: |
7874 | case RISCVVector::BI__builtin_rvv_vlseg7e64_v_tu: |
7875 | ID = Intrinsic::riscv_vlseg7; |
7876 | NF = 7; |
7877 | DefaultPolicy = 0; |
7878 | |
7879 | { |
7880 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7881 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
7882 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
7883 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7884 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
7885 | SmallVector<llvm::Value*, 10> Operands; |
7886 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
7887 | for (unsigned I = 0; I < NF; ++I) |
7888 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7889 | Operands.push_back(Ops[NF]); |
7890 | Operands.push_back(Ops[NF + 1]); |
7891 | } else { |
7892 | for (unsigned I = 0; I < NF; ++I) |
7893 | Operands.push_back(Ops[NF + I]); |
7894 | Operands.push_back(Ops[2 * NF]); |
7895 | Operands.push_back(Ops[2 * NF + 1]); |
7896 | } |
7897 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7898 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7899 | clang::CharUnits Align = |
7900 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7901 | llvm::Value *V; |
7902 | for (unsigned I = 0; I < NF; ++I) { |
7903 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7904 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7905 | } |
7906 | return V; |
7907 | } |
7908 | break; |
7909 | case RISCVVector::BI__builtin_rvv_vlseg7e8_v_ta: |
7910 | case RISCVVector::BI__builtin_rvv_vlseg7e16_v_ta: |
7911 | case RISCVVector::BI__builtin_rvv_vlseg7e32_v_ta: |
7912 | case RISCVVector::BI__builtin_rvv_vlseg7e64_v_ta: |
7913 | ID = Intrinsic::riscv_vlseg7; |
7914 | NF = 7; |
7915 | DefaultPolicy = 1; |
7916 | |
7917 | { |
7918 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7919 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
7920 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
7921 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7922 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
7923 | SmallVector<llvm::Value*, 10> Operands; |
7924 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
7925 | for (unsigned I = 0; I < NF; ++I) |
7926 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7927 | Operands.push_back(Ops[NF]); |
7928 | Operands.push_back(Ops[NF + 1]); |
7929 | } else { |
7930 | for (unsigned I = 0; I < NF; ++I) |
7931 | Operands.push_back(Ops[NF + I]); |
7932 | Operands.push_back(Ops[2 * NF]); |
7933 | Operands.push_back(Ops[2 * NF + 1]); |
7934 | } |
7935 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7936 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7937 | clang::CharUnits Align = |
7938 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7939 | llvm::Value *V; |
7940 | for (unsigned I = 0; I < NF; ++I) { |
7941 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7942 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7943 | } |
7944 | return V; |
7945 | } |
7946 | break; |
7947 | case RISCVVector::BI__builtin_rvv_vlseg7e8_v_tuma: |
7948 | case RISCVVector::BI__builtin_rvv_vlseg7e16_v_tuma: |
7949 | case RISCVVector::BI__builtin_rvv_vlseg7e32_v_tuma: |
7950 | case RISCVVector::BI__builtin_rvv_vlseg7e64_v_tuma: |
7951 | ID = Intrinsic::riscv_vlseg7_mask; |
7952 | NF = 7; |
7953 | DefaultPolicy = 2; |
7954 | |
7955 | { |
7956 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
7957 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
7958 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
7959 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
7960 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
7961 | SmallVector<llvm::Value*, 12> Operands; |
7962 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
7963 | for (unsigned I = 0; I < NF; ++I) |
7964 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
7965 | Operands.push_back(Ops[NF + 1]); |
7966 | Operands.push_back(Ops[NF]); |
7967 | Operands.push_back(Ops[NF + 2]); |
7968 | } else { |
7969 | for (unsigned I = 0; I < NF; ++I) |
7970 | Operands.push_back(Ops[NF + I + 1]); |
7971 | Operands.push_back(Ops[2 * NF + 1]); |
7972 | Operands.push_back(Ops[NF]); |
7973 | Operands.push_back(Ops[2 * NF + 2]); |
7974 | } |
7975 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
7976 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 7976, __extension__ __PRETTY_FUNCTION__)); |
7977 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
7978 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
7979 | clang::CharUnits Align = |
7980 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
7981 | llvm::Value *V; |
7982 | for (unsigned I = 0; I < NF; ++I) { |
7983 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
7984 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
7985 | } |
7986 | return V; |
7987 | } |
7988 | break; |
7989 | case RISCVVector::BI__builtin_rvv_vlseg7e8_v_tama: |
7990 | case RISCVVector::BI__builtin_rvv_vlseg7e16_v_tama: |
7991 | case RISCVVector::BI__builtin_rvv_vlseg7e32_v_tama: |
7992 | case RISCVVector::BI__builtin_rvv_vlseg7e64_v_tama: |
7993 | ID = Intrinsic::riscv_vlseg7_mask; |
7994 | NF = 7; |
7995 | DefaultPolicy = 3; |
7996 | |
7997 | { |
7998 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
7999 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
8000 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8001 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8002 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8003 | SmallVector<llvm::Value*, 12> Operands; |
8004 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8005 | for (unsigned I = 0; I < NF; ++I) |
8006 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8007 | Operands.push_back(Ops[NF + 1]); |
8008 | Operands.push_back(Ops[NF]); |
8009 | Operands.push_back(Ops[NF + 2]); |
8010 | } else { |
8011 | for (unsigned I = 0; I < NF; ++I) |
8012 | Operands.push_back(Ops[NF + I + 1]); |
8013 | Operands.push_back(Ops[2 * NF + 1]); |
8014 | Operands.push_back(Ops[NF]); |
8015 | Operands.push_back(Ops[2 * NF + 2]); |
8016 | } |
8017 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8018 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8018, __extension__ __PRETTY_FUNCTION__)); |
8019 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8020 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8021 | clang::CharUnits Align = |
8022 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8023 | llvm::Value *V; |
8024 | for (unsigned I = 0; I < NF; ++I) { |
8025 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8026 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8027 | } |
8028 | return V; |
8029 | } |
8030 | break; |
8031 | case RISCVVector::BI__builtin_rvv_vlseg7e8_v_tumu: |
8032 | case RISCVVector::BI__builtin_rvv_vlseg7e16_v_tumu: |
8033 | case RISCVVector::BI__builtin_rvv_vlseg7e32_v_tumu: |
8034 | case RISCVVector::BI__builtin_rvv_vlseg7e64_v_tumu: |
8035 | ID = Intrinsic::riscv_vlseg7_mask; |
8036 | NF = 7; |
8037 | DefaultPolicy = 0; |
8038 | |
8039 | { |
8040 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
8041 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
8042 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8043 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8044 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8045 | SmallVector<llvm::Value*, 12> Operands; |
8046 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8047 | for (unsigned I = 0; I < NF; ++I) |
8048 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8049 | Operands.push_back(Ops[NF + 1]); |
8050 | Operands.push_back(Ops[NF]); |
8051 | Operands.push_back(Ops[NF + 2]); |
8052 | } else { |
8053 | for (unsigned I = 0; I < NF; ++I) |
8054 | Operands.push_back(Ops[NF + I + 1]); |
8055 | Operands.push_back(Ops[2 * NF + 1]); |
8056 | Operands.push_back(Ops[NF]); |
8057 | Operands.push_back(Ops[2 * NF + 2]); |
8058 | } |
8059 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8060 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8060, __extension__ __PRETTY_FUNCTION__)); |
8061 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8062 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8063 | clang::CharUnits Align = |
8064 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8065 | llvm::Value *V; |
8066 | for (unsigned I = 0; I < NF; ++I) { |
8067 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8068 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8069 | } |
8070 | return V; |
8071 | } |
8072 | break; |
8073 | case RISCVVector::BI__builtin_rvv_vlseg7e8_v_tamu: |
8074 | case RISCVVector::BI__builtin_rvv_vlseg7e16_v_tamu: |
8075 | case RISCVVector::BI__builtin_rvv_vlseg7e32_v_tamu: |
8076 | case RISCVVector::BI__builtin_rvv_vlseg7e64_v_tamu: |
8077 | ID = Intrinsic::riscv_vlseg7_mask; |
8078 | NF = 7; |
8079 | DefaultPolicy = 1; |
8080 | |
8081 | { |
8082 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
8083 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
8084 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8085 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8086 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8087 | SmallVector<llvm::Value*, 12> Operands; |
8088 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8089 | for (unsigned I = 0; I < NF; ++I) |
8090 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8091 | Operands.push_back(Ops[NF + 1]); |
8092 | Operands.push_back(Ops[NF]); |
8093 | Operands.push_back(Ops[NF + 2]); |
8094 | } else { |
8095 | for (unsigned I = 0; I < NF; ++I) |
8096 | Operands.push_back(Ops[NF + I + 1]); |
8097 | Operands.push_back(Ops[2 * NF + 1]); |
8098 | Operands.push_back(Ops[NF]); |
8099 | Operands.push_back(Ops[2 * NF + 2]); |
8100 | } |
8101 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8102 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8102, __extension__ __PRETTY_FUNCTION__)); |
8103 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8104 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8105 | clang::CharUnits Align = |
8106 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8107 | llvm::Value *V; |
8108 | for (unsigned I = 0; I < NF; ++I) { |
8109 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8110 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8111 | } |
8112 | return V; |
8113 | } |
8114 | break; |
8115 | case RISCVVector::BI__builtin_rvv_vlseg7e8ff_v_tu: |
8116 | case RISCVVector::BI__builtin_rvv_vlseg7e16ff_v_tu: |
8117 | case RISCVVector::BI__builtin_rvv_vlseg7e32ff_v_tu: |
8118 | case RISCVVector::BI__builtin_rvv_vlseg7e64ff_v_tu: |
8119 | ID = Intrinsic::riscv_vlseg7ff; |
8120 | NF = 7; |
8121 | DefaultPolicy = 0; |
8122 | |
8123 | { |
8124 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
8125 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
8126 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8127 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8128 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
8129 | SmallVector<llvm::Value*, 12> Operands; |
8130 | Value *NewVL; |
8131 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
8132 | for (unsigned I = 0; I < NF; ++I) |
8133 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8134 | Operands.push_back(Ops[NF]); |
8135 | Operands.push_back(Ops[NF + 2]); |
8136 | NewVL = Ops[NF + 1]; |
8137 | } else { |
8138 | for (unsigned I = 0; I < NF; ++I) |
8139 | Operands.push_back(Ops[NF + I]); |
8140 | Operands.push_back(Ops[2 * NF]); |
8141 | Operands.push_back(Ops[2 * NF + 2]); |
8142 | NewVL = Ops[2 * NF + 1]; |
8143 | } |
8144 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8145 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8146 | clang::CharUnits Align = |
8147 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8148 | for (unsigned I = 0; I < NF; ++I) { |
8149 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8150 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8151 | } |
8152 | // Store new_vl. |
8153 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8154 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8155 | } |
8156 | break; |
8157 | case RISCVVector::BI__builtin_rvv_vlseg7e8ff_v_ta: |
8158 | case RISCVVector::BI__builtin_rvv_vlseg7e16ff_v_ta: |
8159 | case RISCVVector::BI__builtin_rvv_vlseg7e32ff_v_ta: |
8160 | case RISCVVector::BI__builtin_rvv_vlseg7e64ff_v_ta: |
8161 | ID = Intrinsic::riscv_vlseg7ff; |
8162 | NF = 7; |
8163 | DefaultPolicy = 1; |
8164 | |
8165 | { |
8166 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
8167 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
8168 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8169 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8170 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
8171 | SmallVector<llvm::Value*, 12> Operands; |
8172 | Value *NewVL; |
8173 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
8174 | for (unsigned I = 0; I < NF; ++I) |
8175 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8176 | Operands.push_back(Ops[NF]); |
8177 | Operands.push_back(Ops[NF + 2]); |
8178 | NewVL = Ops[NF + 1]; |
8179 | } else { |
8180 | for (unsigned I = 0; I < NF; ++I) |
8181 | Operands.push_back(Ops[NF + I]); |
8182 | Operands.push_back(Ops[2 * NF]); |
8183 | Operands.push_back(Ops[2 * NF + 2]); |
8184 | NewVL = Ops[2 * NF + 1]; |
8185 | } |
8186 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8187 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8188 | clang::CharUnits Align = |
8189 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8190 | for (unsigned I = 0; I < NF; ++I) { |
8191 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8192 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8193 | } |
8194 | // Store new_vl. |
8195 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8196 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8197 | } |
8198 | break; |
8199 | case RISCVVector::BI__builtin_rvv_vlseg7e8ff_v_tuma: |
8200 | case RISCVVector::BI__builtin_rvv_vlseg7e16ff_v_tuma: |
8201 | case RISCVVector::BI__builtin_rvv_vlseg7e32ff_v_tuma: |
8202 | case RISCVVector::BI__builtin_rvv_vlseg7e64ff_v_tuma: |
8203 | ID = Intrinsic::riscv_vlseg7ff_mask; |
8204 | NF = 7; |
8205 | DefaultPolicy = 2; |
8206 | |
8207 | { |
8208 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
8209 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
8210 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8211 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8212 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8213 | SmallVector<llvm::Value*, 12> Operands; |
8214 | Value *NewVL; |
8215 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8216 | for (unsigned I = 0; I < NF; ++I) |
8217 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8218 | Operands.push_back(Ops[NF + 1]); |
8219 | Operands.push_back(Ops[NF]); |
8220 | Operands.push_back(Ops[NF + 3]); |
8221 | NewVL = Ops[NF + 2]; |
8222 | } else { |
8223 | for (unsigned I = 0; I < NF; ++I) |
8224 | Operands.push_back(Ops[NF + I + 1]); |
8225 | Operands.push_back(Ops[2 * NF + 1]); |
8226 | Operands.push_back(Ops[NF]); |
8227 | Operands.push_back(Ops[2 * NF + 3]); |
8228 | NewVL = Ops[2 * NF + 2]; |
8229 | } |
8230 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8231 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8231, __extension__ __PRETTY_FUNCTION__)); |
8232 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8233 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8234 | clang::CharUnits Align = |
8235 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8236 | for (unsigned I = 0; I < NF; ++I) { |
8237 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8238 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8239 | } |
8240 | // Store new_vl. |
8241 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8242 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8243 | } |
8244 | break; |
8245 | case RISCVVector::BI__builtin_rvv_vlseg7e8ff_v_tama: |
8246 | case RISCVVector::BI__builtin_rvv_vlseg7e16ff_v_tama: |
8247 | case RISCVVector::BI__builtin_rvv_vlseg7e32ff_v_tama: |
8248 | case RISCVVector::BI__builtin_rvv_vlseg7e64ff_v_tama: |
8249 | ID = Intrinsic::riscv_vlseg7ff_mask; |
8250 | NF = 7; |
8251 | DefaultPolicy = 3; |
8252 | |
8253 | { |
8254 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
8255 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
8256 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8257 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8258 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8259 | SmallVector<llvm::Value*, 12> Operands; |
8260 | Value *NewVL; |
8261 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8262 | for (unsigned I = 0; I < NF; ++I) |
8263 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8264 | Operands.push_back(Ops[NF + 1]); |
8265 | Operands.push_back(Ops[NF]); |
8266 | Operands.push_back(Ops[NF + 3]); |
8267 | NewVL = Ops[NF + 2]; |
8268 | } else { |
8269 | for (unsigned I = 0; I < NF; ++I) |
8270 | Operands.push_back(Ops[NF + I + 1]); |
8271 | Operands.push_back(Ops[2 * NF + 1]); |
8272 | Operands.push_back(Ops[NF]); |
8273 | Operands.push_back(Ops[2 * NF + 3]); |
8274 | NewVL = Ops[2 * NF + 2]; |
8275 | } |
8276 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8277 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8277, __extension__ __PRETTY_FUNCTION__)); |
8278 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8279 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8280 | clang::CharUnits Align = |
8281 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8282 | for (unsigned I = 0; I < NF; ++I) { |
8283 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8284 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8285 | } |
8286 | // Store new_vl. |
8287 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8288 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8289 | } |
8290 | break; |
8291 | case RISCVVector::BI__builtin_rvv_vlseg7e8ff_v_tumu: |
8292 | case RISCVVector::BI__builtin_rvv_vlseg7e16ff_v_tumu: |
8293 | case RISCVVector::BI__builtin_rvv_vlseg7e32ff_v_tumu: |
8294 | case RISCVVector::BI__builtin_rvv_vlseg7e64ff_v_tumu: |
8295 | ID = Intrinsic::riscv_vlseg7ff_mask; |
8296 | NF = 7; |
8297 | DefaultPolicy = 0; |
8298 | |
8299 | { |
8300 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
8301 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
8302 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8303 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8304 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8305 | SmallVector<llvm::Value*, 12> Operands; |
8306 | Value *NewVL; |
8307 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8308 | for (unsigned I = 0; I < NF; ++I) |
8309 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8310 | Operands.push_back(Ops[NF + 1]); |
8311 | Operands.push_back(Ops[NF]); |
8312 | Operands.push_back(Ops[NF + 3]); |
8313 | NewVL = Ops[NF + 2]; |
8314 | } else { |
8315 | for (unsigned I = 0; I < NF; ++I) |
8316 | Operands.push_back(Ops[NF + I + 1]); |
8317 | Operands.push_back(Ops[2 * NF + 1]); |
8318 | Operands.push_back(Ops[NF]); |
8319 | Operands.push_back(Ops[2 * NF + 3]); |
8320 | NewVL = Ops[2 * NF + 2]; |
8321 | } |
8322 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8323 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8323, __extension__ __PRETTY_FUNCTION__)); |
8324 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8325 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8326 | clang::CharUnits Align = |
8327 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8328 | for (unsigned I = 0; I < NF; ++I) { |
8329 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8330 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8331 | } |
8332 | // Store new_vl. |
8333 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8334 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8335 | } |
8336 | break; |
8337 | case RISCVVector::BI__builtin_rvv_vlseg7e8ff_v_tamu: |
8338 | case RISCVVector::BI__builtin_rvv_vlseg7e16ff_v_tamu: |
8339 | case RISCVVector::BI__builtin_rvv_vlseg7e32ff_v_tamu: |
8340 | case RISCVVector::BI__builtin_rvv_vlseg7e64ff_v_tamu: |
8341 | ID = Intrinsic::riscv_vlseg7ff_mask; |
8342 | NF = 7; |
8343 | DefaultPolicy = 1; |
8344 | |
8345 | { |
8346 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
8347 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
8348 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8349 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8350 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8351 | SmallVector<llvm::Value*, 12> Operands; |
8352 | Value *NewVL; |
8353 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8354 | for (unsigned I = 0; I < NF; ++I) |
8355 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8356 | Operands.push_back(Ops[NF + 1]); |
8357 | Operands.push_back(Ops[NF]); |
8358 | Operands.push_back(Ops[NF + 3]); |
8359 | NewVL = Ops[NF + 2]; |
8360 | } else { |
8361 | for (unsigned I = 0; I < NF; ++I) |
8362 | Operands.push_back(Ops[NF + I + 1]); |
8363 | Operands.push_back(Ops[2 * NF + 1]); |
8364 | Operands.push_back(Ops[NF]); |
8365 | Operands.push_back(Ops[2 * NF + 3]); |
8366 | NewVL = Ops[2 * NF + 2]; |
8367 | } |
8368 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8369 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8369, __extension__ __PRETTY_FUNCTION__)); |
8370 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8371 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8372 | clang::CharUnits Align = |
8373 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8374 | for (unsigned I = 0; I < NF; ++I) { |
8375 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8376 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8377 | } |
8378 | // Store new_vl. |
8379 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8380 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8381 | } |
8382 | break; |
8383 | case RISCVVector::BI__builtin_rvv_vlseg8e8_v_tu: |
8384 | case RISCVVector::BI__builtin_rvv_vlseg8e16_v_tu: |
8385 | case RISCVVector::BI__builtin_rvv_vlseg8e32_v_tu: |
8386 | case RISCVVector::BI__builtin_rvv_vlseg8e64_v_tu: |
8387 | ID = Intrinsic::riscv_vlseg8; |
8388 | NF = 8; |
8389 | DefaultPolicy = 0; |
8390 | |
8391 | { |
8392 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8393 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
8394 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
8395 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8396 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
8397 | SmallVector<llvm::Value*, 10> Operands; |
8398 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
8399 | for (unsigned I = 0; I < NF; ++I) |
8400 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8401 | Operands.push_back(Ops[NF]); |
8402 | Operands.push_back(Ops[NF + 1]); |
8403 | } else { |
8404 | for (unsigned I = 0; I < NF; ++I) |
8405 | Operands.push_back(Ops[NF + I]); |
8406 | Operands.push_back(Ops[2 * NF]); |
8407 | Operands.push_back(Ops[2 * NF + 1]); |
8408 | } |
8409 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8410 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8411 | clang::CharUnits Align = |
8412 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8413 | llvm::Value *V; |
8414 | for (unsigned I = 0; I < NF; ++I) { |
8415 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8416 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8417 | } |
8418 | return V; |
8419 | } |
8420 | break; |
8421 | case RISCVVector::BI__builtin_rvv_vlseg8e8_v_ta: |
8422 | case RISCVVector::BI__builtin_rvv_vlseg8e16_v_ta: |
8423 | case RISCVVector::BI__builtin_rvv_vlseg8e32_v_ta: |
8424 | case RISCVVector::BI__builtin_rvv_vlseg8e64_v_ta: |
8425 | ID = Intrinsic::riscv_vlseg8; |
8426 | NF = 8; |
8427 | DefaultPolicy = 1; |
8428 | |
8429 | { |
8430 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8431 | // TA builtin: (val0 address, val1 address, ..., ptr, vl) |
8432 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, vl) |
8433 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8434 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
8435 | SmallVector<llvm::Value*, 10> Operands; |
8436 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
8437 | for (unsigned I = 0; I < NF; ++I) |
8438 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8439 | Operands.push_back(Ops[NF]); |
8440 | Operands.push_back(Ops[NF + 1]); |
8441 | } else { |
8442 | for (unsigned I = 0; I < NF; ++I) |
8443 | Operands.push_back(Ops[NF + I]); |
8444 | Operands.push_back(Ops[2 * NF]); |
8445 | Operands.push_back(Ops[2 * NF + 1]); |
8446 | } |
8447 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8448 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8449 | clang::CharUnits Align = |
8450 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8451 | llvm::Value *V; |
8452 | for (unsigned I = 0; I < NF; ++I) { |
8453 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8454 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8455 | } |
8456 | return V; |
8457 | } |
8458 | break; |
8459 | case RISCVVector::BI__builtin_rvv_vlseg8e8_v_tuma: |
8460 | case RISCVVector::BI__builtin_rvv_vlseg8e16_v_tuma: |
8461 | case RISCVVector::BI__builtin_rvv_vlseg8e32_v_tuma: |
8462 | case RISCVVector::BI__builtin_rvv_vlseg8e64_v_tuma: |
8463 | ID = Intrinsic::riscv_vlseg8_mask; |
8464 | NF = 8; |
8465 | DefaultPolicy = 2; |
8466 | |
8467 | { |
8468 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
8469 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
8470 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8471 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8472 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8473 | SmallVector<llvm::Value*, 12> Operands; |
8474 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8475 | for (unsigned I = 0; I < NF; ++I) |
8476 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8477 | Operands.push_back(Ops[NF + 1]); |
8478 | Operands.push_back(Ops[NF]); |
8479 | Operands.push_back(Ops[NF + 2]); |
8480 | } else { |
8481 | for (unsigned I = 0; I < NF; ++I) |
8482 | Operands.push_back(Ops[NF + I + 1]); |
8483 | Operands.push_back(Ops[2 * NF + 1]); |
8484 | Operands.push_back(Ops[NF]); |
8485 | Operands.push_back(Ops[2 * NF + 2]); |
8486 | } |
8487 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8488 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8488, __extension__ __PRETTY_FUNCTION__)); |
8489 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8490 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8491 | clang::CharUnits Align = |
8492 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8493 | llvm::Value *V; |
8494 | for (unsigned I = 0; I < NF; ++I) { |
8495 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8496 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8497 | } |
8498 | return V; |
8499 | } |
8500 | break; |
8501 | case RISCVVector::BI__builtin_rvv_vlseg8e8_v_tama: |
8502 | case RISCVVector::BI__builtin_rvv_vlseg8e16_v_tama: |
8503 | case RISCVVector::BI__builtin_rvv_vlseg8e32_v_tama: |
8504 | case RISCVVector::BI__builtin_rvv_vlseg8e64_v_tama: |
8505 | ID = Intrinsic::riscv_vlseg8_mask; |
8506 | NF = 8; |
8507 | DefaultPolicy = 3; |
8508 | |
8509 | { |
8510 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
8511 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
8512 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8513 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8514 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8515 | SmallVector<llvm::Value*, 12> Operands; |
8516 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8517 | for (unsigned I = 0; I < NF; ++I) |
8518 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8519 | Operands.push_back(Ops[NF + 1]); |
8520 | Operands.push_back(Ops[NF]); |
8521 | Operands.push_back(Ops[NF + 2]); |
8522 | } else { |
8523 | for (unsigned I = 0; I < NF; ++I) |
8524 | Operands.push_back(Ops[NF + I + 1]); |
8525 | Operands.push_back(Ops[2 * NF + 1]); |
8526 | Operands.push_back(Ops[NF]); |
8527 | Operands.push_back(Ops[2 * NF + 2]); |
8528 | } |
8529 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8530 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8530, __extension__ __PRETTY_FUNCTION__)); |
8531 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8532 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8533 | clang::CharUnits Align = |
8534 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8535 | llvm::Value *V; |
8536 | for (unsigned I = 0; I < NF; ++I) { |
8537 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8538 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8539 | } |
8540 | return V; |
8541 | } |
8542 | break; |
8543 | case RISCVVector::BI__builtin_rvv_vlseg8e8_v_tumu: |
8544 | case RISCVVector::BI__builtin_rvv_vlseg8e16_v_tumu: |
8545 | case RISCVVector::BI__builtin_rvv_vlseg8e32_v_tumu: |
8546 | case RISCVVector::BI__builtin_rvv_vlseg8e64_v_tumu: |
8547 | ID = Intrinsic::riscv_vlseg8_mask; |
8548 | NF = 8; |
8549 | DefaultPolicy = 0; |
8550 | |
8551 | { |
8552 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
8553 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
8554 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8555 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8556 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8557 | SmallVector<llvm::Value*, 12> Operands; |
8558 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8559 | for (unsigned I = 0; I < NF; ++I) |
8560 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8561 | Operands.push_back(Ops[NF + 1]); |
8562 | Operands.push_back(Ops[NF]); |
8563 | Operands.push_back(Ops[NF + 2]); |
8564 | } else { |
8565 | for (unsigned I = 0; I < NF; ++I) |
8566 | Operands.push_back(Ops[NF + I + 1]); |
8567 | Operands.push_back(Ops[2 * NF + 1]); |
8568 | Operands.push_back(Ops[NF]); |
8569 | Operands.push_back(Ops[2 * NF + 2]); |
8570 | } |
8571 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8572 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8572, __extension__ __PRETTY_FUNCTION__)); |
8573 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8574 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8575 | clang::CharUnits Align = |
8576 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8577 | llvm::Value *V; |
8578 | for (unsigned I = 0; I < NF; ++I) { |
8579 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8580 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8581 | } |
8582 | return V; |
8583 | } |
8584 | break; |
8585 | case RISCVVector::BI__builtin_rvv_vlseg8e8_v_tamu: |
8586 | case RISCVVector::BI__builtin_rvv_vlseg8e16_v_tamu: |
8587 | case RISCVVector::BI__builtin_rvv_vlseg8e32_v_tamu: |
8588 | case RISCVVector::BI__builtin_rvv_vlseg8e64_v_tamu: |
8589 | ID = Intrinsic::riscv_vlseg8_mask; |
8590 | NF = 8; |
8591 | DefaultPolicy = 1; |
8592 | |
8593 | { |
8594 | // TAMA builtin: (val0 address, ..., mask, ptr, vl) |
8595 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, vl) |
8596 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8597 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8598 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8599 | SmallVector<llvm::Value*, 12> Operands; |
8600 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8601 | for (unsigned I = 0; I < NF; ++I) |
8602 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8603 | Operands.push_back(Ops[NF + 1]); |
8604 | Operands.push_back(Ops[NF]); |
8605 | Operands.push_back(Ops[NF + 2]); |
8606 | } else { |
8607 | for (unsigned I = 0; I < NF; ++I) |
8608 | Operands.push_back(Ops[NF + I + 1]); |
8609 | Operands.push_back(Ops[2 * NF + 1]); |
8610 | Operands.push_back(Ops[NF]); |
8611 | Operands.push_back(Ops[2 * NF + 2]); |
8612 | } |
8613 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8614 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8614, __extension__ __PRETTY_FUNCTION__)); |
8615 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8616 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8617 | clang::CharUnits Align = |
8618 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8619 | llvm::Value *V; |
8620 | for (unsigned I = 0; I < NF; ++I) { |
8621 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8622 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8623 | } |
8624 | return V; |
8625 | } |
8626 | break; |
8627 | case RISCVVector::BI__builtin_rvv_vlseg8e8ff_v_tu: |
8628 | case RISCVVector::BI__builtin_rvv_vlseg8e16ff_v_tu: |
8629 | case RISCVVector::BI__builtin_rvv_vlseg8e32ff_v_tu: |
8630 | case RISCVVector::BI__builtin_rvv_vlseg8e64ff_v_tu: |
8631 | ID = Intrinsic::riscv_vlseg8ff; |
8632 | NF = 8; |
8633 | DefaultPolicy = 0; |
8634 | |
8635 | { |
8636 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
8637 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
8638 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8639 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8640 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
8641 | SmallVector<llvm::Value*, 12> Operands; |
8642 | Value *NewVL; |
8643 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
8644 | for (unsigned I = 0; I < NF; ++I) |
8645 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8646 | Operands.push_back(Ops[NF]); |
8647 | Operands.push_back(Ops[NF + 2]); |
8648 | NewVL = Ops[NF + 1]; |
8649 | } else { |
8650 | for (unsigned I = 0; I < NF; ++I) |
8651 | Operands.push_back(Ops[NF + I]); |
8652 | Operands.push_back(Ops[2 * NF]); |
8653 | Operands.push_back(Ops[2 * NF + 2]); |
8654 | NewVL = Ops[2 * NF + 1]; |
8655 | } |
8656 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8657 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8658 | clang::CharUnits Align = |
8659 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8660 | for (unsigned I = 0; I < NF; ++I) { |
8661 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8662 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8663 | } |
8664 | // Store new_vl. |
8665 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8666 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8667 | } |
8668 | break; |
8669 | case RISCVVector::BI__builtin_rvv_vlseg8e8ff_v_ta: |
8670 | case RISCVVector::BI__builtin_rvv_vlseg8e16ff_v_ta: |
8671 | case RISCVVector::BI__builtin_rvv_vlseg8e32ff_v_ta: |
8672 | case RISCVVector::BI__builtin_rvv_vlseg8e64ff_v_ta: |
8673 | ID = Intrinsic::riscv_vlseg8ff; |
8674 | NF = 8; |
8675 | DefaultPolicy = 1; |
8676 | |
8677 | { |
8678 | // TA builtin: (val0 address, val1 address, ..., ptr, new_vl, vl) |
8679 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, new_vl, vl) |
8680 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8681 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8682 | // intrinsic: (passthru0, passthru1, ..., ptr, vl) |
8683 | SmallVector<llvm::Value*, 12> Operands; |
8684 | Value *NewVL; |
8685 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
8686 | for (unsigned I = 0; I < NF; ++I) |
8687 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8688 | Operands.push_back(Ops[NF]); |
8689 | Operands.push_back(Ops[NF + 2]); |
8690 | NewVL = Ops[NF + 1]; |
8691 | } else { |
8692 | for (unsigned I = 0; I < NF; ++I) |
8693 | Operands.push_back(Ops[NF + I]); |
8694 | Operands.push_back(Ops[2 * NF]); |
8695 | Operands.push_back(Ops[2 * NF + 2]); |
8696 | NewVL = Ops[2 * NF + 1]; |
8697 | } |
8698 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8699 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8700 | clang::CharUnits Align = |
8701 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8702 | for (unsigned I = 0; I < NF; ++I) { |
8703 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8704 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8705 | } |
8706 | // Store new_vl. |
8707 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8708 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8709 | } |
8710 | break; |
8711 | case RISCVVector::BI__builtin_rvv_vlseg8e8ff_v_tuma: |
8712 | case RISCVVector::BI__builtin_rvv_vlseg8e16ff_v_tuma: |
8713 | case RISCVVector::BI__builtin_rvv_vlseg8e32ff_v_tuma: |
8714 | case RISCVVector::BI__builtin_rvv_vlseg8e64ff_v_tuma: |
8715 | ID = Intrinsic::riscv_vlseg8ff_mask; |
8716 | NF = 8; |
8717 | DefaultPolicy = 2; |
8718 | |
8719 | { |
8720 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
8721 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
8722 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8723 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8724 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8725 | SmallVector<llvm::Value*, 12> Operands; |
8726 | Value *NewVL; |
8727 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8728 | for (unsigned I = 0; I < NF; ++I) |
8729 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8730 | Operands.push_back(Ops[NF + 1]); |
8731 | Operands.push_back(Ops[NF]); |
8732 | Operands.push_back(Ops[NF + 3]); |
8733 | NewVL = Ops[NF + 2]; |
8734 | } else { |
8735 | for (unsigned I = 0; I < NF; ++I) |
8736 | Operands.push_back(Ops[NF + I + 1]); |
8737 | Operands.push_back(Ops[2 * NF + 1]); |
8738 | Operands.push_back(Ops[NF]); |
8739 | Operands.push_back(Ops[2 * NF + 3]); |
8740 | NewVL = Ops[2 * NF + 2]; |
8741 | } |
8742 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8743 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8743, __extension__ __PRETTY_FUNCTION__)); |
8744 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8745 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8746 | clang::CharUnits Align = |
8747 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8748 | for (unsigned I = 0; I < NF; ++I) { |
8749 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8750 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8751 | } |
8752 | // Store new_vl. |
8753 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8754 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8755 | } |
8756 | break; |
8757 | case RISCVVector::BI__builtin_rvv_vlseg8e8ff_v_tama: |
8758 | case RISCVVector::BI__builtin_rvv_vlseg8e16ff_v_tama: |
8759 | case RISCVVector::BI__builtin_rvv_vlseg8e32ff_v_tama: |
8760 | case RISCVVector::BI__builtin_rvv_vlseg8e64ff_v_tama: |
8761 | ID = Intrinsic::riscv_vlseg8ff_mask; |
8762 | NF = 8; |
8763 | DefaultPolicy = 3; |
8764 | |
8765 | { |
8766 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
8767 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
8768 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8769 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8770 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8771 | SmallVector<llvm::Value*, 12> Operands; |
8772 | Value *NewVL; |
8773 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8774 | for (unsigned I = 0; I < NF; ++I) |
8775 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8776 | Operands.push_back(Ops[NF + 1]); |
8777 | Operands.push_back(Ops[NF]); |
8778 | Operands.push_back(Ops[NF + 3]); |
8779 | NewVL = Ops[NF + 2]; |
8780 | } else { |
8781 | for (unsigned I = 0; I < NF; ++I) |
8782 | Operands.push_back(Ops[NF + I + 1]); |
8783 | Operands.push_back(Ops[2 * NF + 1]); |
8784 | Operands.push_back(Ops[NF]); |
8785 | Operands.push_back(Ops[2 * NF + 3]); |
8786 | NewVL = Ops[2 * NF + 2]; |
8787 | } |
8788 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8789 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8789, __extension__ __PRETTY_FUNCTION__)); |
8790 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8791 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8792 | clang::CharUnits Align = |
8793 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8794 | for (unsigned I = 0; I < NF; ++I) { |
8795 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8796 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8797 | } |
8798 | // Store new_vl. |
8799 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8800 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8801 | } |
8802 | break; |
8803 | case RISCVVector::BI__builtin_rvv_vlseg8e8ff_v_tumu: |
8804 | case RISCVVector::BI__builtin_rvv_vlseg8e16ff_v_tumu: |
8805 | case RISCVVector::BI__builtin_rvv_vlseg8e32ff_v_tumu: |
8806 | case RISCVVector::BI__builtin_rvv_vlseg8e64ff_v_tumu: |
8807 | ID = Intrinsic::riscv_vlseg8ff_mask; |
8808 | NF = 8; |
8809 | DefaultPolicy = 0; |
8810 | |
8811 | { |
8812 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
8813 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
8814 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8815 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8816 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8817 | SmallVector<llvm::Value*, 12> Operands; |
8818 | Value *NewVL; |
8819 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8820 | for (unsigned I = 0; I < NF; ++I) |
8821 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8822 | Operands.push_back(Ops[NF + 1]); |
8823 | Operands.push_back(Ops[NF]); |
8824 | Operands.push_back(Ops[NF + 3]); |
8825 | NewVL = Ops[NF + 2]; |
8826 | } else { |
8827 | for (unsigned I = 0; I < NF; ++I) |
8828 | Operands.push_back(Ops[NF + I + 1]); |
8829 | Operands.push_back(Ops[2 * NF + 1]); |
8830 | Operands.push_back(Ops[NF]); |
8831 | Operands.push_back(Ops[2 * NF + 3]); |
8832 | NewVL = Ops[2 * NF + 2]; |
8833 | } |
8834 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8835 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8835, __extension__ __PRETTY_FUNCTION__)); |
8836 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8837 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8838 | clang::CharUnits Align = |
8839 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8840 | for (unsigned I = 0; I < NF; ++I) { |
8841 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8842 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8843 | } |
8844 | // Store new_vl. |
8845 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8846 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8847 | } |
8848 | break; |
8849 | case RISCVVector::BI__builtin_rvv_vlseg8e8ff_v_tamu: |
8850 | case RISCVVector::BI__builtin_rvv_vlseg8e16ff_v_tamu: |
8851 | case RISCVVector::BI__builtin_rvv_vlseg8e32ff_v_tamu: |
8852 | case RISCVVector::BI__builtin_rvv_vlseg8e64ff_v_tamu: |
8853 | ID = Intrinsic::riscv_vlseg8ff_mask; |
8854 | NF = 8; |
8855 | DefaultPolicy = 1; |
8856 | |
8857 | { |
8858 | // TAMA builtin: (val0 address, ..., mask, ptr, new_vl, vl) |
8859 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, new_vl, vl) |
8860 | // intrinsic: (maskedoff0, ..., ptr, mask, vl) |
8861 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8862 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8863 | SmallVector<llvm::Value*, 12> Operands; |
8864 | Value *NewVL; |
8865 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8866 | for (unsigned I = 0; I < NF; ++I) |
8867 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8868 | Operands.push_back(Ops[NF + 1]); |
8869 | Operands.push_back(Ops[NF]); |
8870 | Operands.push_back(Ops[NF + 3]); |
8871 | NewVL = Ops[NF + 2]; |
8872 | } else { |
8873 | for (unsigned I = 0; I < NF; ++I) |
8874 | Operands.push_back(Ops[NF + I + 1]); |
8875 | Operands.push_back(Ops[2 * NF + 1]); |
8876 | Operands.push_back(Ops[NF]); |
8877 | Operands.push_back(Ops[2 * NF + 3]); |
8878 | NewVL = Ops[2 * NF + 2]; |
8879 | } |
8880 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
8881 | assert(Operands.size() == NF + 4)(static_cast <bool> (Operands.size() == NF + 4) ? void ( 0) : __assert_fail ("Operands.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 8881, __extension__ __PRETTY_FUNCTION__)); |
8882 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8883 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8884 | clang::CharUnits Align = |
8885 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8886 | for (unsigned I = 0; I < NF; ++I) { |
8887 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8888 | Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8889 | } |
8890 | // Store new_vl. |
8891 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF}); |
8892 | return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align)); |
8893 | } |
8894 | break; |
8895 | case RISCVVector::BI__builtin_rvv_vlsseg2e16_v_tu: |
8896 | case RISCVVector::BI__builtin_rvv_vlsseg2e8_v_tu: |
8897 | case RISCVVector::BI__builtin_rvv_vlsseg2e32_v_tu: |
8898 | case RISCVVector::BI__builtin_rvv_vlsseg2e64_v_tu: |
8899 | ID = Intrinsic::riscv_vlsseg2; |
8900 | NF = 2; |
8901 | DefaultPolicy = 0; |
8902 | |
8903 | { |
8904 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
8905 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
8906 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8907 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8908 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
8909 | SmallVector<llvm::Value*, 12> Operands; |
8910 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
8911 | for (unsigned I = 0; I < NF; ++I) |
8912 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8913 | Operands.push_back(Ops[NF]); |
8914 | Operands.push_back(Ops[NF + 1]); |
8915 | Operands.push_back(Ops[NF + 2]); |
8916 | } else { |
8917 | for (unsigned I = 0; I < NF; ++I) |
8918 | Operands.push_back(Ops[NF + I]); |
8919 | Operands.push_back(Ops[2 * NF]); |
8920 | Operands.push_back(Ops[2 * NF + 1]); |
8921 | Operands.push_back(Ops[2 * NF + 2]); |
8922 | } |
8923 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8924 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8925 | clang::CharUnits Align = |
8926 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8927 | llvm::Value *V; |
8928 | for (unsigned I = 0; I < NF; ++I) { |
8929 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8930 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8931 | } |
8932 | return V; |
8933 | } |
8934 | break; |
8935 | case RISCVVector::BI__builtin_rvv_vlsseg2e16_v_ta: |
8936 | case RISCVVector::BI__builtin_rvv_vlsseg2e8_v_ta: |
8937 | case RISCVVector::BI__builtin_rvv_vlsseg2e32_v_ta: |
8938 | case RISCVVector::BI__builtin_rvv_vlsseg2e64_v_ta: |
8939 | ID = Intrinsic::riscv_vlsseg2; |
8940 | NF = 2; |
8941 | DefaultPolicy = 1; |
8942 | |
8943 | { |
8944 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
8945 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
8946 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8947 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8948 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
8949 | SmallVector<llvm::Value*, 12> Operands; |
8950 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
8951 | for (unsigned I = 0; I < NF; ++I) |
8952 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8953 | Operands.push_back(Ops[NF]); |
8954 | Operands.push_back(Ops[NF + 1]); |
8955 | Operands.push_back(Ops[NF + 2]); |
8956 | } else { |
8957 | for (unsigned I = 0; I < NF; ++I) |
8958 | Operands.push_back(Ops[NF + I]); |
8959 | Operands.push_back(Ops[2 * NF]); |
8960 | Operands.push_back(Ops[2 * NF + 1]); |
8961 | Operands.push_back(Ops[2 * NF + 2]); |
8962 | } |
8963 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
8964 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
8965 | clang::CharUnits Align = |
8966 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
8967 | llvm::Value *V; |
8968 | for (unsigned I = 0; I < NF; ++I) { |
8969 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
8970 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
8971 | } |
8972 | return V; |
8973 | } |
8974 | break; |
8975 | case RISCVVector::BI__builtin_rvv_vlsseg2e16_v_tuma: |
8976 | case RISCVVector::BI__builtin_rvv_vlsseg2e8_v_tuma: |
8977 | case RISCVVector::BI__builtin_rvv_vlsseg2e32_v_tuma: |
8978 | case RISCVVector::BI__builtin_rvv_vlsseg2e64_v_tuma: |
8979 | ID = Intrinsic::riscv_vlsseg2_mask; |
8980 | NF = 2; |
8981 | DefaultPolicy = 2; |
8982 | |
8983 | { |
8984 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
8985 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
8986 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
8987 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
8988 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
8989 | SmallVector<llvm::Value*, 12> Operands; |
8990 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
8991 | for (unsigned I = 0; I < NF; ++I) |
8992 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
8993 | Operands.push_back(Ops[NF + 1]); |
8994 | Operands.push_back(Ops[NF + 2]); |
8995 | Operands.push_back(Ops[NF]); |
8996 | Operands.push_back(Ops[NF + 3]); |
8997 | } else { |
8998 | for (unsigned I = 0; I < NF; ++I) |
8999 | Operands.push_back(Ops[NF + I + 1]); |
9000 | Operands.push_back(Ops[2 * NF + 1]); |
9001 | Operands.push_back(Ops[2 * NF + 2]); |
9002 | Operands.push_back(Ops[NF]); |
9003 | Operands.push_back(Ops[2 * NF + 3]); |
9004 | } |
9005 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9006 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9006, __extension__ __PRETTY_FUNCTION__)); |
9007 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9008 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9009 | clang::CharUnits Align = |
9010 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9011 | llvm::Value *V; |
9012 | for (unsigned I = 0; I < NF; ++I) { |
9013 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9014 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9015 | } |
9016 | return V; |
9017 | } |
9018 | break; |
9019 | case RISCVVector::BI__builtin_rvv_vlsseg2e16_v_tama: |
9020 | case RISCVVector::BI__builtin_rvv_vlsseg2e8_v_tama: |
9021 | case RISCVVector::BI__builtin_rvv_vlsseg2e32_v_tama: |
9022 | case RISCVVector::BI__builtin_rvv_vlsseg2e64_v_tama: |
9023 | ID = Intrinsic::riscv_vlsseg2_mask; |
9024 | NF = 2; |
9025 | DefaultPolicy = 3; |
9026 | |
9027 | { |
9028 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9029 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9030 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9031 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9032 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9033 | SmallVector<llvm::Value*, 12> Operands; |
9034 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9035 | for (unsigned I = 0; I < NF; ++I) |
9036 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9037 | Operands.push_back(Ops[NF + 1]); |
9038 | Operands.push_back(Ops[NF + 2]); |
9039 | Operands.push_back(Ops[NF]); |
9040 | Operands.push_back(Ops[NF + 3]); |
9041 | } else { |
9042 | for (unsigned I = 0; I < NF; ++I) |
9043 | Operands.push_back(Ops[NF + I + 1]); |
9044 | Operands.push_back(Ops[2 * NF + 1]); |
9045 | Operands.push_back(Ops[2 * NF + 2]); |
9046 | Operands.push_back(Ops[NF]); |
9047 | Operands.push_back(Ops[2 * NF + 3]); |
9048 | } |
9049 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9050 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9050, __extension__ __PRETTY_FUNCTION__)); |
9051 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9052 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9053 | clang::CharUnits Align = |
9054 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9055 | llvm::Value *V; |
9056 | for (unsigned I = 0; I < NF; ++I) { |
9057 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9058 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9059 | } |
9060 | return V; |
9061 | } |
9062 | break; |
9063 | case RISCVVector::BI__builtin_rvv_vlsseg2e16_v_tumu: |
9064 | case RISCVVector::BI__builtin_rvv_vlsseg2e8_v_tumu: |
9065 | case RISCVVector::BI__builtin_rvv_vlsseg2e32_v_tumu: |
9066 | case RISCVVector::BI__builtin_rvv_vlsseg2e64_v_tumu: |
9067 | ID = Intrinsic::riscv_vlsseg2_mask; |
9068 | NF = 2; |
9069 | DefaultPolicy = 0; |
9070 | |
9071 | { |
9072 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9073 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9074 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9075 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9076 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9077 | SmallVector<llvm::Value*, 12> Operands; |
9078 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9079 | for (unsigned I = 0; I < NF; ++I) |
9080 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9081 | Operands.push_back(Ops[NF + 1]); |
9082 | Operands.push_back(Ops[NF + 2]); |
9083 | Operands.push_back(Ops[NF]); |
9084 | Operands.push_back(Ops[NF + 3]); |
9085 | } else { |
9086 | for (unsigned I = 0; I < NF; ++I) |
9087 | Operands.push_back(Ops[NF + I + 1]); |
9088 | Operands.push_back(Ops[2 * NF + 1]); |
9089 | Operands.push_back(Ops[2 * NF + 2]); |
9090 | Operands.push_back(Ops[NF]); |
9091 | Operands.push_back(Ops[2 * NF + 3]); |
9092 | } |
9093 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9094 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9094, __extension__ __PRETTY_FUNCTION__)); |
9095 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9096 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9097 | clang::CharUnits Align = |
9098 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9099 | llvm::Value *V; |
9100 | for (unsigned I = 0; I < NF; ++I) { |
9101 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9102 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9103 | } |
9104 | return V; |
9105 | } |
9106 | break; |
9107 | case RISCVVector::BI__builtin_rvv_vlsseg2e16_v_tamu: |
9108 | case RISCVVector::BI__builtin_rvv_vlsseg2e8_v_tamu: |
9109 | case RISCVVector::BI__builtin_rvv_vlsseg2e32_v_tamu: |
9110 | case RISCVVector::BI__builtin_rvv_vlsseg2e64_v_tamu: |
9111 | ID = Intrinsic::riscv_vlsseg2_mask; |
9112 | NF = 2; |
9113 | DefaultPolicy = 1; |
9114 | |
9115 | { |
9116 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9117 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9118 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9119 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9120 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9121 | SmallVector<llvm::Value*, 12> Operands; |
9122 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9123 | for (unsigned I = 0; I < NF; ++I) |
9124 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9125 | Operands.push_back(Ops[NF + 1]); |
9126 | Operands.push_back(Ops[NF + 2]); |
9127 | Operands.push_back(Ops[NF]); |
9128 | Operands.push_back(Ops[NF + 3]); |
9129 | } else { |
9130 | for (unsigned I = 0; I < NF; ++I) |
9131 | Operands.push_back(Ops[NF + I + 1]); |
9132 | Operands.push_back(Ops[2 * NF + 1]); |
9133 | Operands.push_back(Ops[2 * NF + 2]); |
9134 | Operands.push_back(Ops[NF]); |
9135 | Operands.push_back(Ops[2 * NF + 3]); |
9136 | } |
9137 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9138 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9138, __extension__ __PRETTY_FUNCTION__)); |
9139 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9140 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9141 | clang::CharUnits Align = |
9142 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9143 | llvm::Value *V; |
9144 | for (unsigned I = 0; I < NF; ++I) { |
9145 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9146 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9147 | } |
9148 | return V; |
9149 | } |
9150 | break; |
9151 | case RISCVVector::BI__builtin_rvv_vlsseg3e8_v_tu: |
9152 | case RISCVVector::BI__builtin_rvv_vlsseg3e16_v_tu: |
9153 | case RISCVVector::BI__builtin_rvv_vlsseg3e32_v_tu: |
9154 | case RISCVVector::BI__builtin_rvv_vlsseg3e64_v_tu: |
9155 | ID = Intrinsic::riscv_vlsseg3; |
9156 | NF = 3; |
9157 | DefaultPolicy = 0; |
9158 | |
9159 | { |
9160 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
9161 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
9162 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9163 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9164 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
9165 | SmallVector<llvm::Value*, 12> Operands; |
9166 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
9167 | for (unsigned I = 0; I < NF; ++I) |
9168 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9169 | Operands.push_back(Ops[NF]); |
9170 | Operands.push_back(Ops[NF + 1]); |
9171 | Operands.push_back(Ops[NF + 2]); |
9172 | } else { |
9173 | for (unsigned I = 0; I < NF; ++I) |
9174 | Operands.push_back(Ops[NF + I]); |
9175 | Operands.push_back(Ops[2 * NF]); |
9176 | Operands.push_back(Ops[2 * NF + 1]); |
9177 | Operands.push_back(Ops[2 * NF + 2]); |
9178 | } |
9179 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9180 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9181 | clang::CharUnits Align = |
9182 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9183 | llvm::Value *V; |
9184 | for (unsigned I = 0; I < NF; ++I) { |
9185 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9186 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9187 | } |
9188 | return V; |
9189 | } |
9190 | break; |
9191 | case RISCVVector::BI__builtin_rvv_vlsseg3e8_v_ta: |
9192 | case RISCVVector::BI__builtin_rvv_vlsseg3e16_v_ta: |
9193 | case RISCVVector::BI__builtin_rvv_vlsseg3e32_v_ta: |
9194 | case RISCVVector::BI__builtin_rvv_vlsseg3e64_v_ta: |
9195 | ID = Intrinsic::riscv_vlsseg3; |
9196 | NF = 3; |
9197 | DefaultPolicy = 1; |
9198 | |
9199 | { |
9200 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
9201 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
9202 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9203 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9204 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
9205 | SmallVector<llvm::Value*, 12> Operands; |
9206 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
9207 | for (unsigned I = 0; I < NF; ++I) |
9208 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9209 | Operands.push_back(Ops[NF]); |
9210 | Operands.push_back(Ops[NF + 1]); |
9211 | Operands.push_back(Ops[NF + 2]); |
9212 | } else { |
9213 | for (unsigned I = 0; I < NF; ++I) |
9214 | Operands.push_back(Ops[NF + I]); |
9215 | Operands.push_back(Ops[2 * NF]); |
9216 | Operands.push_back(Ops[2 * NF + 1]); |
9217 | Operands.push_back(Ops[2 * NF + 2]); |
9218 | } |
9219 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9220 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9221 | clang::CharUnits Align = |
9222 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9223 | llvm::Value *V; |
9224 | for (unsigned I = 0; I < NF; ++I) { |
9225 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9226 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9227 | } |
9228 | return V; |
9229 | } |
9230 | break; |
9231 | case RISCVVector::BI__builtin_rvv_vlsseg3e8_v_tuma: |
9232 | case RISCVVector::BI__builtin_rvv_vlsseg3e16_v_tuma: |
9233 | case RISCVVector::BI__builtin_rvv_vlsseg3e32_v_tuma: |
9234 | case RISCVVector::BI__builtin_rvv_vlsseg3e64_v_tuma: |
9235 | ID = Intrinsic::riscv_vlsseg3_mask; |
9236 | NF = 3; |
9237 | DefaultPolicy = 2; |
9238 | |
9239 | { |
9240 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9241 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9242 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9243 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9244 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9245 | SmallVector<llvm::Value*, 12> Operands; |
9246 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9247 | for (unsigned I = 0; I < NF; ++I) |
9248 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9249 | Operands.push_back(Ops[NF + 1]); |
9250 | Operands.push_back(Ops[NF + 2]); |
9251 | Operands.push_back(Ops[NF]); |
9252 | Operands.push_back(Ops[NF + 3]); |
9253 | } else { |
9254 | for (unsigned I = 0; I < NF; ++I) |
9255 | Operands.push_back(Ops[NF + I + 1]); |
9256 | Operands.push_back(Ops[2 * NF + 1]); |
9257 | Operands.push_back(Ops[2 * NF + 2]); |
9258 | Operands.push_back(Ops[NF]); |
9259 | Operands.push_back(Ops[2 * NF + 3]); |
9260 | } |
9261 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9262 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9262, __extension__ __PRETTY_FUNCTION__)); |
9263 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9264 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9265 | clang::CharUnits Align = |
9266 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9267 | llvm::Value *V; |
9268 | for (unsigned I = 0; I < NF; ++I) { |
9269 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9270 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9271 | } |
9272 | return V; |
9273 | } |
9274 | break; |
9275 | case RISCVVector::BI__builtin_rvv_vlsseg3e8_v_tama: |
9276 | case RISCVVector::BI__builtin_rvv_vlsseg3e16_v_tama: |
9277 | case RISCVVector::BI__builtin_rvv_vlsseg3e32_v_tama: |
9278 | case RISCVVector::BI__builtin_rvv_vlsseg3e64_v_tama: |
9279 | ID = Intrinsic::riscv_vlsseg3_mask; |
9280 | NF = 3; |
9281 | DefaultPolicy = 3; |
9282 | |
9283 | { |
9284 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9285 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9286 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9287 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9288 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9289 | SmallVector<llvm::Value*, 12> Operands; |
9290 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9291 | for (unsigned I = 0; I < NF; ++I) |
9292 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9293 | Operands.push_back(Ops[NF + 1]); |
9294 | Operands.push_back(Ops[NF + 2]); |
9295 | Operands.push_back(Ops[NF]); |
9296 | Operands.push_back(Ops[NF + 3]); |
9297 | } else { |
9298 | for (unsigned I = 0; I < NF; ++I) |
9299 | Operands.push_back(Ops[NF + I + 1]); |
9300 | Operands.push_back(Ops[2 * NF + 1]); |
9301 | Operands.push_back(Ops[2 * NF + 2]); |
9302 | Operands.push_back(Ops[NF]); |
9303 | Operands.push_back(Ops[2 * NF + 3]); |
9304 | } |
9305 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9306 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9306, __extension__ __PRETTY_FUNCTION__)); |
9307 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9308 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9309 | clang::CharUnits Align = |
9310 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9311 | llvm::Value *V; |
9312 | for (unsigned I = 0; I < NF; ++I) { |
9313 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9314 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9315 | } |
9316 | return V; |
9317 | } |
9318 | break; |
9319 | case RISCVVector::BI__builtin_rvv_vlsseg3e8_v_tumu: |
9320 | case RISCVVector::BI__builtin_rvv_vlsseg3e16_v_tumu: |
9321 | case RISCVVector::BI__builtin_rvv_vlsseg3e32_v_tumu: |
9322 | case RISCVVector::BI__builtin_rvv_vlsseg3e64_v_tumu: |
9323 | ID = Intrinsic::riscv_vlsseg3_mask; |
9324 | NF = 3; |
9325 | DefaultPolicy = 0; |
9326 | |
9327 | { |
9328 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9329 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9330 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9331 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9332 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9333 | SmallVector<llvm::Value*, 12> Operands; |
9334 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9335 | for (unsigned I = 0; I < NF; ++I) |
9336 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9337 | Operands.push_back(Ops[NF + 1]); |
9338 | Operands.push_back(Ops[NF + 2]); |
9339 | Operands.push_back(Ops[NF]); |
9340 | Operands.push_back(Ops[NF + 3]); |
9341 | } else { |
9342 | for (unsigned I = 0; I < NF; ++I) |
9343 | Operands.push_back(Ops[NF + I + 1]); |
9344 | Operands.push_back(Ops[2 * NF + 1]); |
9345 | Operands.push_back(Ops[2 * NF + 2]); |
9346 | Operands.push_back(Ops[NF]); |
9347 | Operands.push_back(Ops[2 * NF + 3]); |
9348 | } |
9349 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9350 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9350, __extension__ __PRETTY_FUNCTION__)); |
9351 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9352 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9353 | clang::CharUnits Align = |
9354 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9355 | llvm::Value *V; |
9356 | for (unsigned I = 0; I < NF; ++I) { |
9357 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9358 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9359 | } |
9360 | return V; |
9361 | } |
9362 | break; |
9363 | case RISCVVector::BI__builtin_rvv_vlsseg3e8_v_tamu: |
9364 | case RISCVVector::BI__builtin_rvv_vlsseg3e16_v_tamu: |
9365 | case RISCVVector::BI__builtin_rvv_vlsseg3e32_v_tamu: |
9366 | case RISCVVector::BI__builtin_rvv_vlsseg3e64_v_tamu: |
9367 | ID = Intrinsic::riscv_vlsseg3_mask; |
9368 | NF = 3; |
9369 | DefaultPolicy = 1; |
9370 | |
9371 | { |
9372 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9373 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9374 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9375 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9376 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9377 | SmallVector<llvm::Value*, 12> Operands; |
9378 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9379 | for (unsigned I = 0; I < NF; ++I) |
9380 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9381 | Operands.push_back(Ops[NF + 1]); |
9382 | Operands.push_back(Ops[NF + 2]); |
9383 | Operands.push_back(Ops[NF]); |
9384 | Operands.push_back(Ops[NF + 3]); |
9385 | } else { |
9386 | for (unsigned I = 0; I < NF; ++I) |
9387 | Operands.push_back(Ops[NF + I + 1]); |
9388 | Operands.push_back(Ops[2 * NF + 1]); |
9389 | Operands.push_back(Ops[2 * NF + 2]); |
9390 | Operands.push_back(Ops[NF]); |
9391 | Operands.push_back(Ops[2 * NF + 3]); |
9392 | } |
9393 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9394 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9394, __extension__ __PRETTY_FUNCTION__)); |
9395 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9396 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9397 | clang::CharUnits Align = |
9398 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9399 | llvm::Value *V; |
9400 | for (unsigned I = 0; I < NF; ++I) { |
9401 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9402 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9403 | } |
9404 | return V; |
9405 | } |
9406 | break; |
9407 | case RISCVVector::BI__builtin_rvv_vlsseg4e8_v_tu: |
9408 | case RISCVVector::BI__builtin_rvv_vlsseg4e16_v_tu: |
9409 | case RISCVVector::BI__builtin_rvv_vlsseg4e32_v_tu: |
9410 | case RISCVVector::BI__builtin_rvv_vlsseg4e64_v_tu: |
9411 | ID = Intrinsic::riscv_vlsseg4; |
9412 | NF = 4; |
9413 | DefaultPolicy = 0; |
9414 | |
9415 | { |
9416 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
9417 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
9418 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9419 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9420 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
9421 | SmallVector<llvm::Value*, 12> Operands; |
9422 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
9423 | for (unsigned I = 0; I < NF; ++I) |
9424 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9425 | Operands.push_back(Ops[NF]); |
9426 | Operands.push_back(Ops[NF + 1]); |
9427 | Operands.push_back(Ops[NF + 2]); |
9428 | } else { |
9429 | for (unsigned I = 0; I < NF; ++I) |
9430 | Operands.push_back(Ops[NF + I]); |
9431 | Operands.push_back(Ops[2 * NF]); |
9432 | Operands.push_back(Ops[2 * NF + 1]); |
9433 | Operands.push_back(Ops[2 * NF + 2]); |
9434 | } |
9435 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9436 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9437 | clang::CharUnits Align = |
9438 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9439 | llvm::Value *V; |
9440 | for (unsigned I = 0; I < NF; ++I) { |
9441 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9442 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9443 | } |
9444 | return V; |
9445 | } |
9446 | break; |
9447 | case RISCVVector::BI__builtin_rvv_vlsseg4e8_v_ta: |
9448 | case RISCVVector::BI__builtin_rvv_vlsseg4e16_v_ta: |
9449 | case RISCVVector::BI__builtin_rvv_vlsseg4e32_v_ta: |
9450 | case RISCVVector::BI__builtin_rvv_vlsseg4e64_v_ta: |
9451 | ID = Intrinsic::riscv_vlsseg4; |
9452 | NF = 4; |
9453 | DefaultPolicy = 1; |
9454 | |
9455 | { |
9456 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
9457 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
9458 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9459 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9460 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
9461 | SmallVector<llvm::Value*, 12> Operands; |
9462 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
9463 | for (unsigned I = 0; I < NF; ++I) |
9464 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9465 | Operands.push_back(Ops[NF]); |
9466 | Operands.push_back(Ops[NF + 1]); |
9467 | Operands.push_back(Ops[NF + 2]); |
9468 | } else { |
9469 | for (unsigned I = 0; I < NF; ++I) |
9470 | Operands.push_back(Ops[NF + I]); |
9471 | Operands.push_back(Ops[2 * NF]); |
9472 | Operands.push_back(Ops[2 * NF + 1]); |
9473 | Operands.push_back(Ops[2 * NF + 2]); |
9474 | } |
9475 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9476 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9477 | clang::CharUnits Align = |
9478 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9479 | llvm::Value *V; |
9480 | for (unsigned I = 0; I < NF; ++I) { |
9481 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9482 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9483 | } |
9484 | return V; |
9485 | } |
9486 | break; |
9487 | case RISCVVector::BI__builtin_rvv_vlsseg4e8_v_tuma: |
9488 | case RISCVVector::BI__builtin_rvv_vlsseg4e16_v_tuma: |
9489 | case RISCVVector::BI__builtin_rvv_vlsseg4e32_v_tuma: |
9490 | case RISCVVector::BI__builtin_rvv_vlsseg4e64_v_tuma: |
9491 | ID = Intrinsic::riscv_vlsseg4_mask; |
9492 | NF = 4; |
9493 | DefaultPolicy = 2; |
9494 | |
9495 | { |
9496 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9497 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9498 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9499 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9500 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9501 | SmallVector<llvm::Value*, 12> Operands; |
9502 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9503 | for (unsigned I = 0; I < NF; ++I) |
9504 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9505 | Operands.push_back(Ops[NF + 1]); |
9506 | Operands.push_back(Ops[NF + 2]); |
9507 | Operands.push_back(Ops[NF]); |
9508 | Operands.push_back(Ops[NF + 3]); |
9509 | } else { |
9510 | for (unsigned I = 0; I < NF; ++I) |
9511 | Operands.push_back(Ops[NF + I + 1]); |
9512 | Operands.push_back(Ops[2 * NF + 1]); |
9513 | Operands.push_back(Ops[2 * NF + 2]); |
9514 | Operands.push_back(Ops[NF]); |
9515 | Operands.push_back(Ops[2 * NF + 3]); |
9516 | } |
9517 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9518 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9518, __extension__ __PRETTY_FUNCTION__)); |
9519 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9520 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9521 | clang::CharUnits Align = |
9522 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9523 | llvm::Value *V; |
9524 | for (unsigned I = 0; I < NF; ++I) { |
9525 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9526 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9527 | } |
9528 | return V; |
9529 | } |
9530 | break; |
9531 | case RISCVVector::BI__builtin_rvv_vlsseg4e8_v_tama: |
9532 | case RISCVVector::BI__builtin_rvv_vlsseg4e16_v_tama: |
9533 | case RISCVVector::BI__builtin_rvv_vlsseg4e32_v_tama: |
9534 | case RISCVVector::BI__builtin_rvv_vlsseg4e64_v_tama: |
9535 | ID = Intrinsic::riscv_vlsseg4_mask; |
9536 | NF = 4; |
9537 | DefaultPolicy = 3; |
9538 | |
9539 | { |
9540 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9541 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9542 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9543 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9544 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9545 | SmallVector<llvm::Value*, 12> Operands; |
9546 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9547 | for (unsigned I = 0; I < NF; ++I) |
9548 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9549 | Operands.push_back(Ops[NF + 1]); |
9550 | Operands.push_back(Ops[NF + 2]); |
9551 | Operands.push_back(Ops[NF]); |
9552 | Operands.push_back(Ops[NF + 3]); |
9553 | } else { |
9554 | for (unsigned I = 0; I < NF; ++I) |
9555 | Operands.push_back(Ops[NF + I + 1]); |
9556 | Operands.push_back(Ops[2 * NF + 1]); |
9557 | Operands.push_back(Ops[2 * NF + 2]); |
9558 | Operands.push_back(Ops[NF]); |
9559 | Operands.push_back(Ops[2 * NF + 3]); |
9560 | } |
9561 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9562 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9562, __extension__ __PRETTY_FUNCTION__)); |
9563 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9564 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9565 | clang::CharUnits Align = |
9566 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9567 | llvm::Value *V; |
9568 | for (unsigned I = 0; I < NF; ++I) { |
9569 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9570 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9571 | } |
9572 | return V; |
9573 | } |
9574 | break; |
9575 | case RISCVVector::BI__builtin_rvv_vlsseg4e8_v_tumu: |
9576 | case RISCVVector::BI__builtin_rvv_vlsseg4e16_v_tumu: |
9577 | case RISCVVector::BI__builtin_rvv_vlsseg4e32_v_tumu: |
9578 | case RISCVVector::BI__builtin_rvv_vlsseg4e64_v_tumu: |
9579 | ID = Intrinsic::riscv_vlsseg4_mask; |
9580 | NF = 4; |
9581 | DefaultPolicy = 0; |
9582 | |
9583 | { |
9584 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9585 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9586 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9587 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9588 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9589 | SmallVector<llvm::Value*, 12> Operands; |
9590 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9591 | for (unsigned I = 0; I < NF; ++I) |
9592 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9593 | Operands.push_back(Ops[NF + 1]); |
9594 | Operands.push_back(Ops[NF + 2]); |
9595 | Operands.push_back(Ops[NF]); |
9596 | Operands.push_back(Ops[NF + 3]); |
9597 | } else { |
9598 | for (unsigned I = 0; I < NF; ++I) |
9599 | Operands.push_back(Ops[NF + I + 1]); |
9600 | Operands.push_back(Ops[2 * NF + 1]); |
9601 | Operands.push_back(Ops[2 * NF + 2]); |
9602 | Operands.push_back(Ops[NF]); |
9603 | Operands.push_back(Ops[2 * NF + 3]); |
9604 | } |
9605 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9606 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9606, __extension__ __PRETTY_FUNCTION__)); |
9607 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9608 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9609 | clang::CharUnits Align = |
9610 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9611 | llvm::Value *V; |
9612 | for (unsigned I = 0; I < NF; ++I) { |
9613 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9614 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9615 | } |
9616 | return V; |
9617 | } |
9618 | break; |
9619 | case RISCVVector::BI__builtin_rvv_vlsseg4e8_v_tamu: |
9620 | case RISCVVector::BI__builtin_rvv_vlsseg4e16_v_tamu: |
9621 | case RISCVVector::BI__builtin_rvv_vlsseg4e32_v_tamu: |
9622 | case RISCVVector::BI__builtin_rvv_vlsseg4e64_v_tamu: |
9623 | ID = Intrinsic::riscv_vlsseg4_mask; |
9624 | NF = 4; |
9625 | DefaultPolicy = 1; |
9626 | |
9627 | { |
9628 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9629 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9630 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9631 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9632 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9633 | SmallVector<llvm::Value*, 12> Operands; |
9634 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9635 | for (unsigned I = 0; I < NF; ++I) |
9636 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9637 | Operands.push_back(Ops[NF + 1]); |
9638 | Operands.push_back(Ops[NF + 2]); |
9639 | Operands.push_back(Ops[NF]); |
9640 | Operands.push_back(Ops[NF + 3]); |
9641 | } else { |
9642 | for (unsigned I = 0; I < NF; ++I) |
9643 | Operands.push_back(Ops[NF + I + 1]); |
9644 | Operands.push_back(Ops[2 * NF + 1]); |
9645 | Operands.push_back(Ops[2 * NF + 2]); |
9646 | Operands.push_back(Ops[NF]); |
9647 | Operands.push_back(Ops[2 * NF + 3]); |
9648 | } |
9649 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9650 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9650, __extension__ __PRETTY_FUNCTION__)); |
9651 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9652 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9653 | clang::CharUnits Align = |
9654 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9655 | llvm::Value *V; |
9656 | for (unsigned I = 0; I < NF; ++I) { |
9657 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9658 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9659 | } |
9660 | return V; |
9661 | } |
9662 | break; |
9663 | case RISCVVector::BI__builtin_rvv_vlsseg5e8_v_tu: |
9664 | case RISCVVector::BI__builtin_rvv_vlsseg5e16_v_tu: |
9665 | case RISCVVector::BI__builtin_rvv_vlsseg5e32_v_tu: |
9666 | case RISCVVector::BI__builtin_rvv_vlsseg5e64_v_tu: |
9667 | ID = Intrinsic::riscv_vlsseg5; |
9668 | NF = 5; |
9669 | DefaultPolicy = 0; |
9670 | |
9671 | { |
9672 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
9673 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
9674 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9675 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9676 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
9677 | SmallVector<llvm::Value*, 12> Operands; |
9678 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
9679 | for (unsigned I = 0; I < NF; ++I) |
9680 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9681 | Operands.push_back(Ops[NF]); |
9682 | Operands.push_back(Ops[NF + 1]); |
9683 | Operands.push_back(Ops[NF + 2]); |
9684 | } else { |
9685 | for (unsigned I = 0; I < NF; ++I) |
9686 | Operands.push_back(Ops[NF + I]); |
9687 | Operands.push_back(Ops[2 * NF]); |
9688 | Operands.push_back(Ops[2 * NF + 1]); |
9689 | Operands.push_back(Ops[2 * NF + 2]); |
9690 | } |
9691 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9692 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9693 | clang::CharUnits Align = |
9694 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9695 | llvm::Value *V; |
9696 | for (unsigned I = 0; I < NF; ++I) { |
9697 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9698 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9699 | } |
9700 | return V; |
9701 | } |
9702 | break; |
9703 | case RISCVVector::BI__builtin_rvv_vlsseg5e8_v_ta: |
9704 | case RISCVVector::BI__builtin_rvv_vlsseg5e16_v_ta: |
9705 | case RISCVVector::BI__builtin_rvv_vlsseg5e32_v_ta: |
9706 | case RISCVVector::BI__builtin_rvv_vlsseg5e64_v_ta: |
9707 | ID = Intrinsic::riscv_vlsseg5; |
9708 | NF = 5; |
9709 | DefaultPolicy = 1; |
9710 | |
9711 | { |
9712 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
9713 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
9714 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9715 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9716 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
9717 | SmallVector<llvm::Value*, 12> Operands; |
9718 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
9719 | for (unsigned I = 0; I < NF; ++I) |
9720 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9721 | Operands.push_back(Ops[NF]); |
9722 | Operands.push_back(Ops[NF + 1]); |
9723 | Operands.push_back(Ops[NF + 2]); |
9724 | } else { |
9725 | for (unsigned I = 0; I < NF; ++I) |
9726 | Operands.push_back(Ops[NF + I]); |
9727 | Operands.push_back(Ops[2 * NF]); |
9728 | Operands.push_back(Ops[2 * NF + 1]); |
9729 | Operands.push_back(Ops[2 * NF + 2]); |
9730 | } |
9731 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9732 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9733 | clang::CharUnits Align = |
9734 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9735 | llvm::Value *V; |
9736 | for (unsigned I = 0; I < NF; ++I) { |
9737 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9738 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9739 | } |
9740 | return V; |
9741 | } |
9742 | break; |
9743 | case RISCVVector::BI__builtin_rvv_vlsseg5e8_v_tuma: |
9744 | case RISCVVector::BI__builtin_rvv_vlsseg5e16_v_tuma: |
9745 | case RISCVVector::BI__builtin_rvv_vlsseg5e32_v_tuma: |
9746 | case RISCVVector::BI__builtin_rvv_vlsseg5e64_v_tuma: |
9747 | ID = Intrinsic::riscv_vlsseg5_mask; |
9748 | NF = 5; |
9749 | DefaultPolicy = 2; |
9750 | |
9751 | { |
9752 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9753 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9754 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9755 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9756 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9757 | SmallVector<llvm::Value*, 12> Operands; |
9758 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9759 | for (unsigned I = 0; I < NF; ++I) |
9760 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9761 | Operands.push_back(Ops[NF + 1]); |
9762 | Operands.push_back(Ops[NF + 2]); |
9763 | Operands.push_back(Ops[NF]); |
9764 | Operands.push_back(Ops[NF + 3]); |
9765 | } else { |
9766 | for (unsigned I = 0; I < NF; ++I) |
9767 | Operands.push_back(Ops[NF + I + 1]); |
9768 | Operands.push_back(Ops[2 * NF + 1]); |
9769 | Operands.push_back(Ops[2 * NF + 2]); |
9770 | Operands.push_back(Ops[NF]); |
9771 | Operands.push_back(Ops[2 * NF + 3]); |
9772 | } |
9773 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9774 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9774, __extension__ __PRETTY_FUNCTION__)); |
9775 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9776 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9777 | clang::CharUnits Align = |
9778 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9779 | llvm::Value *V; |
9780 | for (unsigned I = 0; I < NF; ++I) { |
9781 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9782 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9783 | } |
9784 | return V; |
9785 | } |
9786 | break; |
9787 | case RISCVVector::BI__builtin_rvv_vlsseg5e8_v_tama: |
9788 | case RISCVVector::BI__builtin_rvv_vlsseg5e16_v_tama: |
9789 | case RISCVVector::BI__builtin_rvv_vlsseg5e32_v_tama: |
9790 | case RISCVVector::BI__builtin_rvv_vlsseg5e64_v_tama: |
9791 | ID = Intrinsic::riscv_vlsseg5_mask; |
9792 | NF = 5; |
9793 | DefaultPolicy = 3; |
9794 | |
9795 | { |
9796 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9797 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9798 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9799 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9800 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9801 | SmallVector<llvm::Value*, 12> Operands; |
9802 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9803 | for (unsigned I = 0; I < NF; ++I) |
9804 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9805 | Operands.push_back(Ops[NF + 1]); |
9806 | Operands.push_back(Ops[NF + 2]); |
9807 | Operands.push_back(Ops[NF]); |
9808 | Operands.push_back(Ops[NF + 3]); |
9809 | } else { |
9810 | for (unsigned I = 0; I < NF; ++I) |
9811 | Operands.push_back(Ops[NF + I + 1]); |
9812 | Operands.push_back(Ops[2 * NF + 1]); |
9813 | Operands.push_back(Ops[2 * NF + 2]); |
9814 | Operands.push_back(Ops[NF]); |
9815 | Operands.push_back(Ops[2 * NF + 3]); |
9816 | } |
9817 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9818 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9818, __extension__ __PRETTY_FUNCTION__)); |
9819 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9820 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9821 | clang::CharUnits Align = |
9822 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9823 | llvm::Value *V; |
9824 | for (unsigned I = 0; I < NF; ++I) { |
9825 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9826 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9827 | } |
9828 | return V; |
9829 | } |
9830 | break; |
9831 | case RISCVVector::BI__builtin_rvv_vlsseg5e8_v_tumu: |
9832 | case RISCVVector::BI__builtin_rvv_vlsseg5e16_v_tumu: |
9833 | case RISCVVector::BI__builtin_rvv_vlsseg5e32_v_tumu: |
9834 | case RISCVVector::BI__builtin_rvv_vlsseg5e64_v_tumu: |
9835 | ID = Intrinsic::riscv_vlsseg5_mask; |
9836 | NF = 5; |
9837 | DefaultPolicy = 0; |
9838 | |
9839 | { |
9840 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9841 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9842 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9843 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9844 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9845 | SmallVector<llvm::Value*, 12> Operands; |
9846 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9847 | for (unsigned I = 0; I < NF; ++I) |
9848 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9849 | Operands.push_back(Ops[NF + 1]); |
9850 | Operands.push_back(Ops[NF + 2]); |
9851 | Operands.push_back(Ops[NF]); |
9852 | Operands.push_back(Ops[NF + 3]); |
9853 | } else { |
9854 | for (unsigned I = 0; I < NF; ++I) |
9855 | Operands.push_back(Ops[NF + I + 1]); |
9856 | Operands.push_back(Ops[2 * NF + 1]); |
9857 | Operands.push_back(Ops[2 * NF + 2]); |
9858 | Operands.push_back(Ops[NF]); |
9859 | Operands.push_back(Ops[2 * NF + 3]); |
9860 | } |
9861 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9862 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9862, __extension__ __PRETTY_FUNCTION__)); |
9863 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9864 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9865 | clang::CharUnits Align = |
9866 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9867 | llvm::Value *V; |
9868 | for (unsigned I = 0; I < NF; ++I) { |
9869 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9870 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9871 | } |
9872 | return V; |
9873 | } |
9874 | break; |
9875 | case RISCVVector::BI__builtin_rvv_vlsseg5e8_v_tamu: |
9876 | case RISCVVector::BI__builtin_rvv_vlsseg5e16_v_tamu: |
9877 | case RISCVVector::BI__builtin_rvv_vlsseg5e32_v_tamu: |
9878 | case RISCVVector::BI__builtin_rvv_vlsseg5e64_v_tamu: |
9879 | ID = Intrinsic::riscv_vlsseg5_mask; |
9880 | NF = 5; |
9881 | DefaultPolicy = 1; |
9882 | |
9883 | { |
9884 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
9885 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
9886 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
9887 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9888 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9889 | SmallVector<llvm::Value*, 12> Operands; |
9890 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
9891 | for (unsigned I = 0; I < NF; ++I) |
9892 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9893 | Operands.push_back(Ops[NF + 1]); |
9894 | Operands.push_back(Ops[NF + 2]); |
9895 | Operands.push_back(Ops[NF]); |
9896 | Operands.push_back(Ops[NF + 3]); |
9897 | } else { |
9898 | for (unsigned I = 0; I < NF; ++I) |
9899 | Operands.push_back(Ops[NF + I + 1]); |
9900 | Operands.push_back(Ops[2 * NF + 1]); |
9901 | Operands.push_back(Ops[2 * NF + 2]); |
9902 | Operands.push_back(Ops[NF]); |
9903 | Operands.push_back(Ops[2 * NF + 3]); |
9904 | } |
9905 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
9906 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 9906, __extension__ __PRETTY_FUNCTION__)); |
9907 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9908 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9909 | clang::CharUnits Align = |
9910 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9911 | llvm::Value *V; |
9912 | for (unsigned I = 0; I < NF; ++I) { |
9913 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9914 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9915 | } |
9916 | return V; |
9917 | } |
9918 | break; |
9919 | case RISCVVector::BI__builtin_rvv_vlsseg6e8_v_tu: |
9920 | case RISCVVector::BI__builtin_rvv_vlsseg6e16_v_tu: |
9921 | case RISCVVector::BI__builtin_rvv_vlsseg6e32_v_tu: |
9922 | case RISCVVector::BI__builtin_rvv_vlsseg6e64_v_tu: |
9923 | ID = Intrinsic::riscv_vlsseg6; |
9924 | NF = 6; |
9925 | DefaultPolicy = 0; |
9926 | |
9927 | { |
9928 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
9929 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
9930 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9931 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9932 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
9933 | SmallVector<llvm::Value*, 12> Operands; |
9934 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
9935 | for (unsigned I = 0; I < NF; ++I) |
9936 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9937 | Operands.push_back(Ops[NF]); |
9938 | Operands.push_back(Ops[NF + 1]); |
9939 | Operands.push_back(Ops[NF + 2]); |
9940 | } else { |
9941 | for (unsigned I = 0; I < NF; ++I) |
9942 | Operands.push_back(Ops[NF + I]); |
9943 | Operands.push_back(Ops[2 * NF]); |
9944 | Operands.push_back(Ops[2 * NF + 1]); |
9945 | Operands.push_back(Ops[2 * NF + 2]); |
9946 | } |
9947 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9948 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9949 | clang::CharUnits Align = |
9950 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9951 | llvm::Value *V; |
9952 | for (unsigned I = 0; I < NF; ++I) { |
9953 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9954 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9955 | } |
9956 | return V; |
9957 | } |
9958 | break; |
9959 | case RISCVVector::BI__builtin_rvv_vlsseg6e8_v_ta: |
9960 | case RISCVVector::BI__builtin_rvv_vlsseg6e16_v_ta: |
9961 | case RISCVVector::BI__builtin_rvv_vlsseg6e32_v_ta: |
9962 | case RISCVVector::BI__builtin_rvv_vlsseg6e64_v_ta: |
9963 | ID = Intrinsic::riscv_vlsseg6; |
9964 | NF = 6; |
9965 | DefaultPolicy = 1; |
9966 | |
9967 | { |
9968 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
9969 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
9970 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
9971 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
9972 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
9973 | SmallVector<llvm::Value*, 12> Operands; |
9974 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
9975 | for (unsigned I = 0; I < NF; ++I) |
9976 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
9977 | Operands.push_back(Ops[NF]); |
9978 | Operands.push_back(Ops[NF + 1]); |
9979 | Operands.push_back(Ops[NF + 2]); |
9980 | } else { |
9981 | for (unsigned I = 0; I < NF; ++I) |
9982 | Operands.push_back(Ops[NF + I]); |
9983 | Operands.push_back(Ops[2 * NF]); |
9984 | Operands.push_back(Ops[2 * NF + 1]); |
9985 | Operands.push_back(Ops[2 * NF + 2]); |
9986 | } |
9987 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
9988 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
9989 | clang::CharUnits Align = |
9990 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
9991 | llvm::Value *V; |
9992 | for (unsigned I = 0; I < NF; ++I) { |
9993 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
9994 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
9995 | } |
9996 | return V; |
9997 | } |
9998 | break; |
9999 | case RISCVVector::BI__builtin_rvv_vlsseg6e8_v_tuma: |
10000 | case RISCVVector::BI__builtin_rvv_vlsseg6e16_v_tuma: |
10001 | case RISCVVector::BI__builtin_rvv_vlsseg6e32_v_tuma: |
10002 | case RISCVVector::BI__builtin_rvv_vlsseg6e64_v_tuma: |
10003 | ID = Intrinsic::riscv_vlsseg6_mask; |
10004 | NF = 6; |
10005 | DefaultPolicy = 2; |
10006 | |
10007 | { |
10008 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10009 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10010 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10011 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10012 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10013 | SmallVector<llvm::Value*, 12> Operands; |
10014 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10015 | for (unsigned I = 0; I < NF; ++I) |
10016 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10017 | Operands.push_back(Ops[NF + 1]); |
10018 | Operands.push_back(Ops[NF + 2]); |
10019 | Operands.push_back(Ops[NF]); |
10020 | Operands.push_back(Ops[NF + 3]); |
10021 | } else { |
10022 | for (unsigned I = 0; I < NF; ++I) |
10023 | Operands.push_back(Ops[NF + I + 1]); |
10024 | Operands.push_back(Ops[2 * NF + 1]); |
10025 | Operands.push_back(Ops[2 * NF + 2]); |
10026 | Operands.push_back(Ops[NF]); |
10027 | Operands.push_back(Ops[2 * NF + 3]); |
10028 | } |
10029 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10030 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10030, __extension__ __PRETTY_FUNCTION__)); |
10031 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10032 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10033 | clang::CharUnits Align = |
10034 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10035 | llvm::Value *V; |
10036 | for (unsigned I = 0; I < NF; ++I) { |
10037 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10038 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10039 | } |
10040 | return V; |
10041 | } |
10042 | break; |
10043 | case RISCVVector::BI__builtin_rvv_vlsseg6e8_v_tama: |
10044 | case RISCVVector::BI__builtin_rvv_vlsseg6e16_v_tama: |
10045 | case RISCVVector::BI__builtin_rvv_vlsseg6e32_v_tama: |
10046 | case RISCVVector::BI__builtin_rvv_vlsseg6e64_v_tama: |
10047 | ID = Intrinsic::riscv_vlsseg6_mask; |
10048 | NF = 6; |
10049 | DefaultPolicy = 3; |
10050 | |
10051 | { |
10052 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10053 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10054 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10055 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10056 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10057 | SmallVector<llvm::Value*, 12> Operands; |
10058 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10059 | for (unsigned I = 0; I < NF; ++I) |
10060 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10061 | Operands.push_back(Ops[NF + 1]); |
10062 | Operands.push_back(Ops[NF + 2]); |
10063 | Operands.push_back(Ops[NF]); |
10064 | Operands.push_back(Ops[NF + 3]); |
10065 | } else { |
10066 | for (unsigned I = 0; I < NF; ++I) |
10067 | Operands.push_back(Ops[NF + I + 1]); |
10068 | Operands.push_back(Ops[2 * NF + 1]); |
10069 | Operands.push_back(Ops[2 * NF + 2]); |
10070 | Operands.push_back(Ops[NF]); |
10071 | Operands.push_back(Ops[2 * NF + 3]); |
10072 | } |
10073 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10074 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10074, __extension__ __PRETTY_FUNCTION__)); |
10075 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10076 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10077 | clang::CharUnits Align = |
10078 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10079 | llvm::Value *V; |
10080 | for (unsigned I = 0; I < NF; ++I) { |
10081 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10082 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10083 | } |
10084 | return V; |
10085 | } |
10086 | break; |
10087 | case RISCVVector::BI__builtin_rvv_vlsseg6e8_v_tumu: |
10088 | case RISCVVector::BI__builtin_rvv_vlsseg6e16_v_tumu: |
10089 | case RISCVVector::BI__builtin_rvv_vlsseg6e32_v_tumu: |
10090 | case RISCVVector::BI__builtin_rvv_vlsseg6e64_v_tumu: |
10091 | ID = Intrinsic::riscv_vlsseg6_mask; |
10092 | NF = 6; |
10093 | DefaultPolicy = 0; |
10094 | |
10095 | { |
10096 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10097 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10098 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10099 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10100 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10101 | SmallVector<llvm::Value*, 12> Operands; |
10102 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10103 | for (unsigned I = 0; I < NF; ++I) |
10104 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10105 | Operands.push_back(Ops[NF + 1]); |
10106 | Operands.push_back(Ops[NF + 2]); |
10107 | Operands.push_back(Ops[NF]); |
10108 | Operands.push_back(Ops[NF + 3]); |
10109 | } else { |
10110 | for (unsigned I = 0; I < NF; ++I) |
10111 | Operands.push_back(Ops[NF + I + 1]); |
10112 | Operands.push_back(Ops[2 * NF + 1]); |
10113 | Operands.push_back(Ops[2 * NF + 2]); |
10114 | Operands.push_back(Ops[NF]); |
10115 | Operands.push_back(Ops[2 * NF + 3]); |
10116 | } |
10117 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10118 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10118, __extension__ __PRETTY_FUNCTION__)); |
10119 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10120 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10121 | clang::CharUnits Align = |
10122 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10123 | llvm::Value *V; |
10124 | for (unsigned I = 0; I < NF; ++I) { |
10125 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10126 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10127 | } |
10128 | return V; |
10129 | } |
10130 | break; |
10131 | case RISCVVector::BI__builtin_rvv_vlsseg6e8_v_tamu: |
10132 | case RISCVVector::BI__builtin_rvv_vlsseg6e16_v_tamu: |
10133 | case RISCVVector::BI__builtin_rvv_vlsseg6e32_v_tamu: |
10134 | case RISCVVector::BI__builtin_rvv_vlsseg6e64_v_tamu: |
10135 | ID = Intrinsic::riscv_vlsseg6_mask; |
10136 | NF = 6; |
10137 | DefaultPolicy = 1; |
10138 | |
10139 | { |
10140 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10141 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10142 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10143 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10144 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10145 | SmallVector<llvm::Value*, 12> Operands; |
10146 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10147 | for (unsigned I = 0; I < NF; ++I) |
10148 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10149 | Operands.push_back(Ops[NF + 1]); |
10150 | Operands.push_back(Ops[NF + 2]); |
10151 | Operands.push_back(Ops[NF]); |
10152 | Operands.push_back(Ops[NF + 3]); |
10153 | } else { |
10154 | for (unsigned I = 0; I < NF; ++I) |
10155 | Operands.push_back(Ops[NF + I + 1]); |
10156 | Operands.push_back(Ops[2 * NF + 1]); |
10157 | Operands.push_back(Ops[2 * NF + 2]); |
10158 | Operands.push_back(Ops[NF]); |
10159 | Operands.push_back(Ops[2 * NF + 3]); |
10160 | } |
10161 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10162 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10162, __extension__ __PRETTY_FUNCTION__)); |
10163 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10164 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10165 | clang::CharUnits Align = |
10166 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10167 | llvm::Value *V; |
10168 | for (unsigned I = 0; I < NF; ++I) { |
10169 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10170 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10171 | } |
10172 | return V; |
10173 | } |
10174 | break; |
10175 | case RISCVVector::BI__builtin_rvv_vlsseg7e8_v_tu: |
10176 | case RISCVVector::BI__builtin_rvv_vlsseg7e16_v_tu: |
10177 | case RISCVVector::BI__builtin_rvv_vlsseg7e32_v_tu: |
10178 | case RISCVVector::BI__builtin_rvv_vlsseg7e64_v_tu: |
10179 | ID = Intrinsic::riscv_vlsseg7; |
10180 | NF = 7; |
10181 | DefaultPolicy = 0; |
10182 | |
10183 | { |
10184 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
10185 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
10186 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10187 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10188 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
10189 | SmallVector<llvm::Value*, 12> Operands; |
10190 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
10191 | for (unsigned I = 0; I < NF; ++I) |
10192 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10193 | Operands.push_back(Ops[NF]); |
10194 | Operands.push_back(Ops[NF + 1]); |
10195 | Operands.push_back(Ops[NF + 2]); |
10196 | } else { |
10197 | for (unsigned I = 0; I < NF; ++I) |
10198 | Operands.push_back(Ops[NF + I]); |
10199 | Operands.push_back(Ops[2 * NF]); |
10200 | Operands.push_back(Ops[2 * NF + 1]); |
10201 | Operands.push_back(Ops[2 * NF + 2]); |
10202 | } |
10203 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10204 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10205 | clang::CharUnits Align = |
10206 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10207 | llvm::Value *V; |
10208 | for (unsigned I = 0; I < NF; ++I) { |
10209 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10210 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10211 | } |
10212 | return V; |
10213 | } |
10214 | break; |
10215 | case RISCVVector::BI__builtin_rvv_vlsseg7e8_v_ta: |
10216 | case RISCVVector::BI__builtin_rvv_vlsseg7e16_v_ta: |
10217 | case RISCVVector::BI__builtin_rvv_vlsseg7e32_v_ta: |
10218 | case RISCVVector::BI__builtin_rvv_vlsseg7e64_v_ta: |
10219 | ID = Intrinsic::riscv_vlsseg7; |
10220 | NF = 7; |
10221 | DefaultPolicy = 1; |
10222 | |
10223 | { |
10224 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
10225 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
10226 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10227 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10228 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
10229 | SmallVector<llvm::Value*, 12> Operands; |
10230 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
10231 | for (unsigned I = 0; I < NF; ++I) |
10232 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10233 | Operands.push_back(Ops[NF]); |
10234 | Operands.push_back(Ops[NF + 1]); |
10235 | Operands.push_back(Ops[NF + 2]); |
10236 | } else { |
10237 | for (unsigned I = 0; I < NF; ++I) |
10238 | Operands.push_back(Ops[NF + I]); |
10239 | Operands.push_back(Ops[2 * NF]); |
10240 | Operands.push_back(Ops[2 * NF + 1]); |
10241 | Operands.push_back(Ops[2 * NF + 2]); |
10242 | } |
10243 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10244 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10245 | clang::CharUnits Align = |
10246 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10247 | llvm::Value *V; |
10248 | for (unsigned I = 0; I < NF; ++I) { |
10249 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10250 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10251 | } |
10252 | return V; |
10253 | } |
10254 | break; |
10255 | case RISCVVector::BI__builtin_rvv_vlsseg7e8_v_tuma: |
10256 | case RISCVVector::BI__builtin_rvv_vlsseg7e16_v_tuma: |
10257 | case RISCVVector::BI__builtin_rvv_vlsseg7e32_v_tuma: |
10258 | case RISCVVector::BI__builtin_rvv_vlsseg7e64_v_tuma: |
10259 | ID = Intrinsic::riscv_vlsseg7_mask; |
10260 | NF = 7; |
10261 | DefaultPolicy = 2; |
10262 | |
10263 | { |
10264 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10265 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10266 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10267 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10268 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10269 | SmallVector<llvm::Value*, 12> Operands; |
10270 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10271 | for (unsigned I = 0; I < NF; ++I) |
10272 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10273 | Operands.push_back(Ops[NF + 1]); |
10274 | Operands.push_back(Ops[NF + 2]); |
10275 | Operands.push_back(Ops[NF]); |
10276 | Operands.push_back(Ops[NF + 3]); |
10277 | } else { |
10278 | for (unsigned I = 0; I < NF; ++I) |
10279 | Operands.push_back(Ops[NF + I + 1]); |
10280 | Operands.push_back(Ops[2 * NF + 1]); |
10281 | Operands.push_back(Ops[2 * NF + 2]); |
10282 | Operands.push_back(Ops[NF]); |
10283 | Operands.push_back(Ops[2 * NF + 3]); |
10284 | } |
10285 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10286 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10286, __extension__ __PRETTY_FUNCTION__)); |
10287 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10288 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10289 | clang::CharUnits Align = |
10290 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10291 | llvm::Value *V; |
10292 | for (unsigned I = 0; I < NF; ++I) { |
10293 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10294 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10295 | } |
10296 | return V; |
10297 | } |
10298 | break; |
10299 | case RISCVVector::BI__builtin_rvv_vlsseg7e8_v_tama: |
10300 | case RISCVVector::BI__builtin_rvv_vlsseg7e16_v_tama: |
10301 | case RISCVVector::BI__builtin_rvv_vlsseg7e32_v_tama: |
10302 | case RISCVVector::BI__builtin_rvv_vlsseg7e64_v_tama: |
10303 | ID = Intrinsic::riscv_vlsseg7_mask; |
10304 | NF = 7; |
10305 | DefaultPolicy = 3; |
10306 | |
10307 | { |
10308 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10309 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10310 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10311 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10312 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10313 | SmallVector<llvm::Value*, 12> Operands; |
10314 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10315 | for (unsigned I = 0; I < NF; ++I) |
10316 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10317 | Operands.push_back(Ops[NF + 1]); |
10318 | Operands.push_back(Ops[NF + 2]); |
10319 | Operands.push_back(Ops[NF]); |
10320 | Operands.push_back(Ops[NF + 3]); |
10321 | } else { |
10322 | for (unsigned I = 0; I < NF; ++I) |
10323 | Operands.push_back(Ops[NF + I + 1]); |
10324 | Operands.push_back(Ops[2 * NF + 1]); |
10325 | Operands.push_back(Ops[2 * NF + 2]); |
10326 | Operands.push_back(Ops[NF]); |
10327 | Operands.push_back(Ops[2 * NF + 3]); |
10328 | } |
10329 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10330 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10330, __extension__ __PRETTY_FUNCTION__)); |
10331 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10332 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10333 | clang::CharUnits Align = |
10334 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10335 | llvm::Value *V; |
10336 | for (unsigned I = 0; I < NF; ++I) { |
10337 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10338 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10339 | } |
10340 | return V; |
10341 | } |
10342 | break; |
10343 | case RISCVVector::BI__builtin_rvv_vlsseg7e8_v_tumu: |
10344 | case RISCVVector::BI__builtin_rvv_vlsseg7e16_v_tumu: |
10345 | case RISCVVector::BI__builtin_rvv_vlsseg7e32_v_tumu: |
10346 | case RISCVVector::BI__builtin_rvv_vlsseg7e64_v_tumu: |
10347 | ID = Intrinsic::riscv_vlsseg7_mask; |
10348 | NF = 7; |
10349 | DefaultPolicy = 0; |
10350 | |
10351 | { |
10352 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10353 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10354 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10355 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10356 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10357 | SmallVector<llvm::Value*, 12> Operands; |
10358 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10359 | for (unsigned I = 0; I < NF; ++I) |
10360 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10361 | Operands.push_back(Ops[NF + 1]); |
10362 | Operands.push_back(Ops[NF + 2]); |
10363 | Operands.push_back(Ops[NF]); |
10364 | Operands.push_back(Ops[NF + 3]); |
10365 | } else { |
10366 | for (unsigned I = 0; I < NF; ++I) |
10367 | Operands.push_back(Ops[NF + I + 1]); |
10368 | Operands.push_back(Ops[2 * NF + 1]); |
10369 | Operands.push_back(Ops[2 * NF + 2]); |
10370 | Operands.push_back(Ops[NF]); |
10371 | Operands.push_back(Ops[2 * NF + 3]); |
10372 | } |
10373 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10374 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10374, __extension__ __PRETTY_FUNCTION__)); |
10375 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10376 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10377 | clang::CharUnits Align = |
10378 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10379 | llvm::Value *V; |
10380 | for (unsigned I = 0; I < NF; ++I) { |
10381 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10382 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10383 | } |
10384 | return V; |
10385 | } |
10386 | break; |
10387 | case RISCVVector::BI__builtin_rvv_vlsseg7e8_v_tamu: |
10388 | case RISCVVector::BI__builtin_rvv_vlsseg7e16_v_tamu: |
10389 | case RISCVVector::BI__builtin_rvv_vlsseg7e32_v_tamu: |
10390 | case RISCVVector::BI__builtin_rvv_vlsseg7e64_v_tamu: |
10391 | ID = Intrinsic::riscv_vlsseg7_mask; |
10392 | NF = 7; |
10393 | DefaultPolicy = 1; |
10394 | |
10395 | { |
10396 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10397 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10398 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10399 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10400 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10401 | SmallVector<llvm::Value*, 12> Operands; |
10402 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10403 | for (unsigned I = 0; I < NF; ++I) |
10404 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10405 | Operands.push_back(Ops[NF + 1]); |
10406 | Operands.push_back(Ops[NF + 2]); |
10407 | Operands.push_back(Ops[NF]); |
10408 | Operands.push_back(Ops[NF + 3]); |
10409 | } else { |
10410 | for (unsigned I = 0; I < NF; ++I) |
10411 | Operands.push_back(Ops[NF + I + 1]); |
10412 | Operands.push_back(Ops[2 * NF + 1]); |
10413 | Operands.push_back(Ops[2 * NF + 2]); |
10414 | Operands.push_back(Ops[NF]); |
10415 | Operands.push_back(Ops[2 * NF + 3]); |
10416 | } |
10417 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10418 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10418, __extension__ __PRETTY_FUNCTION__)); |
10419 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10420 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10421 | clang::CharUnits Align = |
10422 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10423 | llvm::Value *V; |
10424 | for (unsigned I = 0; I < NF; ++I) { |
10425 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10426 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10427 | } |
10428 | return V; |
10429 | } |
10430 | break; |
10431 | case RISCVVector::BI__builtin_rvv_vlsseg8e8_v_tu: |
10432 | case RISCVVector::BI__builtin_rvv_vlsseg8e16_v_tu: |
10433 | case RISCVVector::BI__builtin_rvv_vlsseg8e32_v_tu: |
10434 | case RISCVVector::BI__builtin_rvv_vlsseg8e64_v_tu: |
10435 | ID = Intrinsic::riscv_vlsseg8; |
10436 | NF = 8; |
10437 | DefaultPolicy = 0; |
10438 | |
10439 | { |
10440 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
10441 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
10442 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10443 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10444 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
10445 | SmallVector<llvm::Value*, 12> Operands; |
10446 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
10447 | for (unsigned I = 0; I < NF; ++I) |
10448 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10449 | Operands.push_back(Ops[NF]); |
10450 | Operands.push_back(Ops[NF + 1]); |
10451 | Operands.push_back(Ops[NF + 2]); |
10452 | } else { |
10453 | for (unsigned I = 0; I < NF; ++I) |
10454 | Operands.push_back(Ops[NF + I]); |
10455 | Operands.push_back(Ops[2 * NF]); |
10456 | Operands.push_back(Ops[2 * NF + 1]); |
10457 | Operands.push_back(Ops[2 * NF + 2]); |
10458 | } |
10459 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10460 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10461 | clang::CharUnits Align = |
10462 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10463 | llvm::Value *V; |
10464 | for (unsigned I = 0; I < NF; ++I) { |
10465 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10466 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10467 | } |
10468 | return V; |
10469 | } |
10470 | break; |
10471 | case RISCVVector::BI__builtin_rvv_vlsseg8e8_v_ta: |
10472 | case RISCVVector::BI__builtin_rvv_vlsseg8e16_v_ta: |
10473 | case RISCVVector::BI__builtin_rvv_vlsseg8e32_v_ta: |
10474 | case RISCVVector::BI__builtin_rvv_vlsseg8e64_v_ta: |
10475 | ID = Intrinsic::riscv_vlsseg8; |
10476 | NF = 8; |
10477 | DefaultPolicy = 1; |
10478 | |
10479 | { |
10480 | // TA builtin: (val0 address, val1 address, ..., ptr, stride, vl) |
10481 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, stride, vl) |
10482 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10483 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10484 | // intrinsic: (passthru0, passthru1, ..., ptr, stride, vl) |
10485 | SmallVector<llvm::Value*, 12> Operands; |
10486 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
10487 | for (unsigned I = 0; I < NF; ++I) |
10488 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10489 | Operands.push_back(Ops[NF]); |
10490 | Operands.push_back(Ops[NF + 1]); |
10491 | Operands.push_back(Ops[NF + 2]); |
10492 | } else { |
10493 | for (unsigned I = 0; I < NF; ++I) |
10494 | Operands.push_back(Ops[NF + I]); |
10495 | Operands.push_back(Ops[2 * NF]); |
10496 | Operands.push_back(Ops[2 * NF + 1]); |
10497 | Operands.push_back(Ops[2 * NF + 2]); |
10498 | } |
10499 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10500 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10501 | clang::CharUnits Align = |
10502 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10503 | llvm::Value *V; |
10504 | for (unsigned I = 0; I < NF; ++I) { |
10505 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10506 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10507 | } |
10508 | return V; |
10509 | } |
10510 | break; |
10511 | case RISCVVector::BI__builtin_rvv_vlsseg8e8_v_tuma: |
10512 | case RISCVVector::BI__builtin_rvv_vlsseg8e16_v_tuma: |
10513 | case RISCVVector::BI__builtin_rvv_vlsseg8e32_v_tuma: |
10514 | case RISCVVector::BI__builtin_rvv_vlsseg8e64_v_tuma: |
10515 | ID = Intrinsic::riscv_vlsseg8_mask; |
10516 | NF = 8; |
10517 | DefaultPolicy = 2; |
10518 | |
10519 | { |
10520 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10521 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10522 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10523 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10524 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10525 | SmallVector<llvm::Value*, 12> Operands; |
10526 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10527 | for (unsigned I = 0; I < NF; ++I) |
10528 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10529 | Operands.push_back(Ops[NF + 1]); |
10530 | Operands.push_back(Ops[NF + 2]); |
10531 | Operands.push_back(Ops[NF]); |
10532 | Operands.push_back(Ops[NF + 3]); |
10533 | } else { |
10534 | for (unsigned I = 0; I < NF; ++I) |
10535 | Operands.push_back(Ops[NF + I + 1]); |
10536 | Operands.push_back(Ops[2 * NF + 1]); |
10537 | Operands.push_back(Ops[2 * NF + 2]); |
10538 | Operands.push_back(Ops[NF]); |
10539 | Operands.push_back(Ops[2 * NF + 3]); |
10540 | } |
10541 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10542 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10542, __extension__ __PRETTY_FUNCTION__)); |
10543 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10544 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10545 | clang::CharUnits Align = |
10546 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10547 | llvm::Value *V; |
10548 | for (unsigned I = 0; I < NF; ++I) { |
10549 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10550 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10551 | } |
10552 | return V; |
10553 | } |
10554 | break; |
10555 | case RISCVVector::BI__builtin_rvv_vlsseg8e8_v_tama: |
10556 | case RISCVVector::BI__builtin_rvv_vlsseg8e16_v_tama: |
10557 | case RISCVVector::BI__builtin_rvv_vlsseg8e32_v_tama: |
10558 | case RISCVVector::BI__builtin_rvv_vlsseg8e64_v_tama: |
10559 | ID = Intrinsic::riscv_vlsseg8_mask; |
10560 | NF = 8; |
10561 | DefaultPolicy = 3; |
10562 | |
10563 | { |
10564 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10565 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10566 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10567 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10568 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10569 | SmallVector<llvm::Value*, 12> Operands; |
10570 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10571 | for (unsigned I = 0; I < NF; ++I) |
10572 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10573 | Operands.push_back(Ops[NF + 1]); |
10574 | Operands.push_back(Ops[NF + 2]); |
10575 | Operands.push_back(Ops[NF]); |
10576 | Operands.push_back(Ops[NF + 3]); |
10577 | } else { |
10578 | for (unsigned I = 0; I < NF; ++I) |
10579 | Operands.push_back(Ops[NF + I + 1]); |
10580 | Operands.push_back(Ops[2 * NF + 1]); |
10581 | Operands.push_back(Ops[2 * NF + 2]); |
10582 | Operands.push_back(Ops[NF]); |
10583 | Operands.push_back(Ops[2 * NF + 3]); |
10584 | } |
10585 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10586 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10586, __extension__ __PRETTY_FUNCTION__)); |
10587 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10588 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10589 | clang::CharUnits Align = |
10590 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10591 | llvm::Value *V; |
10592 | for (unsigned I = 0; I < NF; ++I) { |
10593 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10594 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10595 | } |
10596 | return V; |
10597 | } |
10598 | break; |
10599 | case RISCVVector::BI__builtin_rvv_vlsseg8e8_v_tumu: |
10600 | case RISCVVector::BI__builtin_rvv_vlsseg8e16_v_tumu: |
10601 | case RISCVVector::BI__builtin_rvv_vlsseg8e32_v_tumu: |
10602 | case RISCVVector::BI__builtin_rvv_vlsseg8e64_v_tumu: |
10603 | ID = Intrinsic::riscv_vlsseg8_mask; |
10604 | NF = 8; |
10605 | DefaultPolicy = 0; |
10606 | |
10607 | { |
10608 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10609 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10610 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10611 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10612 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10613 | SmallVector<llvm::Value*, 12> Operands; |
10614 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10615 | for (unsigned I = 0; I < NF; ++I) |
10616 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10617 | Operands.push_back(Ops[NF + 1]); |
10618 | Operands.push_back(Ops[NF + 2]); |
10619 | Operands.push_back(Ops[NF]); |
10620 | Operands.push_back(Ops[NF + 3]); |
10621 | } else { |
10622 | for (unsigned I = 0; I < NF; ++I) |
10623 | Operands.push_back(Ops[NF + I + 1]); |
10624 | Operands.push_back(Ops[2 * NF + 1]); |
10625 | Operands.push_back(Ops[2 * NF + 2]); |
10626 | Operands.push_back(Ops[NF]); |
10627 | Operands.push_back(Ops[2 * NF + 3]); |
10628 | } |
10629 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10630 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10630, __extension__ __PRETTY_FUNCTION__)); |
10631 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10632 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10633 | clang::CharUnits Align = |
10634 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10635 | llvm::Value *V; |
10636 | for (unsigned I = 0; I < NF; ++I) { |
10637 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10638 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10639 | } |
10640 | return V; |
10641 | } |
10642 | break; |
10643 | case RISCVVector::BI__builtin_rvv_vlsseg8e8_v_tamu: |
10644 | case RISCVVector::BI__builtin_rvv_vlsseg8e16_v_tamu: |
10645 | case RISCVVector::BI__builtin_rvv_vlsseg8e32_v_tamu: |
10646 | case RISCVVector::BI__builtin_rvv_vlsseg8e64_v_tamu: |
10647 | ID = Intrinsic::riscv_vlsseg8_mask; |
10648 | NF = 8; |
10649 | DefaultPolicy = 1; |
10650 | |
10651 | { |
10652 | //TAMA builtin: (val0 address, ..., mask, ptr, stride, vl) |
10653 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, stride, vl) |
10654 | // intrinsic: (maskedoff0, ..., ptr, stride, mask, vl) |
10655 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10656 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
10657 | SmallVector<llvm::Value*, 12> Operands; |
10658 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10659 | for (unsigned I = 0; I < NF; ++I) |
10660 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10661 | Operands.push_back(Ops[NF + 1]); |
10662 | Operands.push_back(Ops[NF + 2]); |
10663 | Operands.push_back(Ops[NF]); |
10664 | Operands.push_back(Ops[NF + 3]); |
10665 | } else { |
10666 | for (unsigned I = 0; I < NF; ++I) |
10667 | Operands.push_back(Ops[NF + I + 1]); |
10668 | Operands.push_back(Ops[2 * NF + 1]); |
10669 | Operands.push_back(Ops[2 * NF + 2]); |
10670 | Operands.push_back(Ops[NF]); |
10671 | Operands.push_back(Ops[2 * NF + 3]); |
10672 | } |
10673 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10674 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10674, __extension__ __PRETTY_FUNCTION__)); |
10675 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10676 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10677 | clang::CharUnits Align = |
10678 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10679 | llvm::Value *V; |
10680 | for (unsigned I = 0; I < NF; ++I) { |
10681 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10682 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10683 | } |
10684 | return V; |
10685 | } |
10686 | break; |
10687 | case RISCVVector::BI__builtin_rvv_vluxei8_v_tu: |
10688 | case RISCVVector::BI__builtin_rvv_vluxei64_v_tu: |
10689 | case RISCVVector::BI__builtin_rvv_vluxei16_v_tu: |
10690 | case RISCVVector::BI__builtin_rvv_vluxei32_v_tu: |
10691 | ID = Intrinsic::riscv_vluxei; |
10692 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
10693 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
10694 | break; |
10695 | case RISCVVector::BI__builtin_rvv_vluxei8_v_ta: |
10696 | case RISCVVector::BI__builtin_rvv_vluxei64_v_ta: |
10697 | case RISCVVector::BI__builtin_rvv_vluxei16_v_ta: |
10698 | case RISCVVector::BI__builtin_rvv_vluxei32_v_ta: |
10699 | ID = Intrinsic::riscv_vluxei; |
10700 | Ops[0] = Builder.CreateBitCast(Ops[0], ResultType->getPointerTo()); |
10701 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
10702 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
10703 | break; |
10704 | case RISCVVector::BI__builtin_rvv_vluxei8_v_tuma: |
10705 | case RISCVVector::BI__builtin_rvv_vluxei64_v_tuma: |
10706 | case RISCVVector::BI__builtin_rvv_vluxei16_v_tuma: |
10707 | case RISCVVector::BI__builtin_rvv_vluxei32_v_tuma: |
10708 | ID = Intrinsic::riscv_vluxei_mask; |
10709 | DefaultPolicy = 2; |
10710 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
10711 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
10712 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10713 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
10714 | break; |
10715 | case RISCVVector::BI__builtin_rvv_vluxei8_v_tama: |
10716 | case RISCVVector::BI__builtin_rvv_vluxei64_v_tama: |
10717 | case RISCVVector::BI__builtin_rvv_vluxei16_v_tama: |
10718 | case RISCVVector::BI__builtin_rvv_vluxei32_v_tama: |
10719 | ID = Intrinsic::riscv_vluxei_mask; |
10720 | DefaultPolicy = 3; |
10721 | Ops[1] = Builder.CreateBitCast(Ops[1], ResultType->getPointerTo()); |
10722 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
10723 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10724 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
10725 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
10726 | break; |
10727 | case RISCVVector::BI__builtin_rvv_vluxei8_v_tumu: |
10728 | case RISCVVector::BI__builtin_rvv_vluxei64_v_tumu: |
10729 | case RISCVVector::BI__builtin_rvv_vluxei16_v_tumu: |
10730 | case RISCVVector::BI__builtin_rvv_vluxei32_v_tumu: |
10731 | ID = Intrinsic::riscv_vluxei_mask; |
10732 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
10733 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
10734 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10735 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
10736 | break; |
10737 | case RISCVVector::BI__builtin_rvv_vluxei8_v_tamu: |
10738 | case RISCVVector::BI__builtin_rvv_vluxei64_v_tamu: |
10739 | case RISCVVector::BI__builtin_rvv_vluxei16_v_tamu: |
10740 | case RISCVVector::BI__builtin_rvv_vluxei32_v_tamu: |
10741 | ID = Intrinsic::riscv_vluxei_mask; |
10742 | DefaultPolicy = 1; |
10743 | Ops[2] = Builder.CreateBitCast(Ops[2], ResultType->getPointerTo()); |
10744 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
10745 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10746 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
10747 | break; |
10748 | case RISCVVector::BI__builtin_rvv_vluxseg2ei8_v_tu: |
10749 | case RISCVVector::BI__builtin_rvv_vluxseg2ei16_v_tu: |
10750 | case RISCVVector::BI__builtin_rvv_vluxseg2ei32_v_tu: |
10751 | case RISCVVector::BI__builtin_rvv_vluxseg2ei64_v_tu: |
10752 | ID = Intrinsic::riscv_vluxseg2; |
10753 | NF = 2; |
10754 | DefaultPolicy = 0; |
10755 | |
10756 | { |
10757 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
10758 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
10759 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10760 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
10761 | SmallVector<llvm::Value*, 12> Operands; |
10762 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
10763 | for (unsigned I = 0; I < NF; ++I) |
10764 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10765 | Operands.push_back(Ops[NF]); |
10766 | Operands.push_back(Ops[NF + 1]); |
10767 | Operands.push_back(Ops[NF + 2]); |
10768 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
10769 | } else { |
10770 | for (unsigned I = 0; I < NF; ++I) |
10771 | Operands.push_back(Ops[NF + I]); |
10772 | Operands.push_back(Ops[2 * NF]); |
10773 | Operands.push_back(Ops[2 * NF + 1]); |
10774 | Operands.push_back(Ops[2 * NF + 2]); |
10775 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
10776 | } |
10777 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10778 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10779 | clang::CharUnits Align = |
10780 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10781 | llvm::Value *V; |
10782 | for (unsigned I = 0; I < NF; ++I) { |
10783 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10784 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10785 | } |
10786 | return V; |
10787 | } |
10788 | break; |
10789 | case RISCVVector::BI__builtin_rvv_vluxseg2ei8_v_ta: |
10790 | case RISCVVector::BI__builtin_rvv_vluxseg2ei16_v_ta: |
10791 | case RISCVVector::BI__builtin_rvv_vluxseg2ei32_v_ta: |
10792 | case RISCVVector::BI__builtin_rvv_vluxseg2ei64_v_ta: |
10793 | ID = Intrinsic::riscv_vluxseg2; |
10794 | NF = 2; |
10795 | DefaultPolicy = 1; |
10796 | |
10797 | { |
10798 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
10799 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
10800 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10801 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
10802 | SmallVector<llvm::Value*, 12> Operands; |
10803 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
10804 | for (unsigned I = 0; I < NF; ++I) |
10805 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10806 | Operands.push_back(Ops[NF]); |
10807 | Operands.push_back(Ops[NF + 1]); |
10808 | Operands.push_back(Ops[NF + 2]); |
10809 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
10810 | } else { |
10811 | for (unsigned I = 0; I < NF; ++I) |
10812 | Operands.push_back(Ops[NF + I]); |
10813 | Operands.push_back(Ops[2 * NF]); |
10814 | Operands.push_back(Ops[2 * NF + 1]); |
10815 | Operands.push_back(Ops[2 * NF + 2]); |
10816 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
10817 | } |
10818 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10819 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10820 | clang::CharUnits Align = |
10821 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10822 | llvm::Value *V; |
10823 | for (unsigned I = 0; I < NF; ++I) { |
10824 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10825 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10826 | } |
10827 | return V; |
10828 | } |
10829 | break; |
10830 | case RISCVVector::BI__builtin_rvv_vluxseg2ei8_v_tuma: |
10831 | case RISCVVector::BI__builtin_rvv_vluxseg2ei16_v_tuma: |
10832 | case RISCVVector::BI__builtin_rvv_vluxseg2ei32_v_tuma: |
10833 | case RISCVVector::BI__builtin_rvv_vluxseg2ei64_v_tuma: |
10834 | ID = Intrinsic::riscv_vluxseg2_mask; |
10835 | NF = 2; |
10836 | DefaultPolicy = 2; |
10837 | |
10838 | { |
10839 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
10840 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
10841 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10842 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
10843 | SmallVector<llvm::Value*, 12> Operands; |
10844 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10845 | for (unsigned I = 0; I < NF; ++I) |
10846 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10847 | Operands.push_back(Ops[NF + 1]); |
10848 | Operands.push_back(Ops[NF + 2]); |
10849 | Operands.push_back(Ops[NF]); |
10850 | Operands.push_back(Ops[NF + 3]); |
10851 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
10852 | } else { |
10853 | for (unsigned I = 0; I < NF; ++I) |
10854 | Operands.push_back(Ops[NF + I + 1]); |
10855 | Operands.push_back(Ops[2 * NF + 1]); |
10856 | Operands.push_back(Ops[2 * NF + 2]); |
10857 | Operands.push_back(Ops[NF]); |
10858 | Operands.push_back(Ops[2 * NF + 3]); |
10859 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
10860 | } |
10861 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10862 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10862, __extension__ __PRETTY_FUNCTION__)); |
10863 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10864 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10865 | clang::CharUnits Align = |
10866 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10867 | llvm::Value *V; |
10868 | for (unsigned I = 0; I < NF; ++I) { |
10869 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10870 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10871 | } |
10872 | return V; |
10873 | } |
10874 | break; |
10875 | case RISCVVector::BI__builtin_rvv_vluxseg2ei8_v_tama: |
10876 | case RISCVVector::BI__builtin_rvv_vluxseg2ei16_v_tama: |
10877 | case RISCVVector::BI__builtin_rvv_vluxseg2ei32_v_tama: |
10878 | case RISCVVector::BI__builtin_rvv_vluxseg2ei64_v_tama: |
10879 | ID = Intrinsic::riscv_vluxseg2_mask; |
10880 | NF = 2; |
10881 | DefaultPolicy = 3; |
10882 | |
10883 | { |
10884 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
10885 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
10886 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10887 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
10888 | SmallVector<llvm::Value*, 12> Operands; |
10889 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10890 | for (unsigned I = 0; I < NF; ++I) |
10891 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10892 | Operands.push_back(Ops[NF + 1]); |
10893 | Operands.push_back(Ops[NF + 2]); |
10894 | Operands.push_back(Ops[NF]); |
10895 | Operands.push_back(Ops[NF + 3]); |
10896 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
10897 | } else { |
10898 | for (unsigned I = 0; I < NF; ++I) |
10899 | Operands.push_back(Ops[NF + I + 1]); |
10900 | Operands.push_back(Ops[2 * NF + 1]); |
10901 | Operands.push_back(Ops[2 * NF + 2]); |
10902 | Operands.push_back(Ops[NF]); |
10903 | Operands.push_back(Ops[2 * NF + 3]); |
10904 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
10905 | } |
10906 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10907 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10907, __extension__ __PRETTY_FUNCTION__)); |
10908 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10909 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10910 | clang::CharUnits Align = |
10911 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10912 | llvm::Value *V; |
10913 | for (unsigned I = 0; I < NF; ++I) { |
10914 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10915 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10916 | } |
10917 | return V; |
10918 | } |
10919 | break; |
10920 | case RISCVVector::BI__builtin_rvv_vluxseg2ei8_v_tumu: |
10921 | case RISCVVector::BI__builtin_rvv_vluxseg2ei16_v_tumu: |
10922 | case RISCVVector::BI__builtin_rvv_vluxseg2ei32_v_tumu: |
10923 | case RISCVVector::BI__builtin_rvv_vluxseg2ei64_v_tumu: |
10924 | ID = Intrinsic::riscv_vluxseg2_mask; |
10925 | NF = 2; |
10926 | DefaultPolicy = 0; |
10927 | |
10928 | { |
10929 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
10930 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
10931 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10932 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
10933 | SmallVector<llvm::Value*, 12> Operands; |
10934 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10935 | for (unsigned I = 0; I < NF; ++I) |
10936 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10937 | Operands.push_back(Ops[NF + 1]); |
10938 | Operands.push_back(Ops[NF + 2]); |
10939 | Operands.push_back(Ops[NF]); |
10940 | Operands.push_back(Ops[NF + 3]); |
10941 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
10942 | } else { |
10943 | for (unsigned I = 0; I < NF; ++I) |
10944 | Operands.push_back(Ops[NF + I + 1]); |
10945 | Operands.push_back(Ops[2 * NF + 1]); |
10946 | Operands.push_back(Ops[2 * NF + 2]); |
10947 | Operands.push_back(Ops[NF]); |
10948 | Operands.push_back(Ops[2 * NF + 3]); |
10949 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
10950 | } |
10951 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10952 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10952, __extension__ __PRETTY_FUNCTION__)); |
10953 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10954 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
10955 | clang::CharUnits Align = |
10956 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
10957 | llvm::Value *V; |
10958 | for (unsigned I = 0; I < NF; ++I) { |
10959 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
10960 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
10961 | } |
10962 | return V; |
10963 | } |
10964 | break; |
10965 | case RISCVVector::BI__builtin_rvv_vluxseg2ei8_v_tamu: |
10966 | case RISCVVector::BI__builtin_rvv_vluxseg2ei16_v_tamu: |
10967 | case RISCVVector::BI__builtin_rvv_vluxseg2ei32_v_tamu: |
10968 | case RISCVVector::BI__builtin_rvv_vluxseg2ei64_v_tamu: |
10969 | ID = Intrinsic::riscv_vluxseg2_mask; |
10970 | NF = 2; |
10971 | DefaultPolicy = 1; |
10972 | |
10973 | { |
10974 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
10975 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
10976 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
10977 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
10978 | SmallVector<llvm::Value*, 12> Operands; |
10979 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
10980 | for (unsigned I = 0; I < NF; ++I) |
10981 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
10982 | Operands.push_back(Ops[NF + 1]); |
10983 | Operands.push_back(Ops[NF + 2]); |
10984 | Operands.push_back(Ops[NF]); |
10985 | Operands.push_back(Ops[NF + 3]); |
10986 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
10987 | } else { |
10988 | for (unsigned I = 0; I < NF; ++I) |
10989 | Operands.push_back(Ops[NF + I + 1]); |
10990 | Operands.push_back(Ops[2 * NF + 1]); |
10991 | Operands.push_back(Ops[2 * NF + 2]); |
10992 | Operands.push_back(Ops[NF]); |
10993 | Operands.push_back(Ops[2 * NF + 3]); |
10994 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
10995 | } |
10996 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
10997 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 10997, __extension__ __PRETTY_FUNCTION__)); |
10998 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
10999 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11000 | clang::CharUnits Align = |
11001 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11002 | llvm::Value *V; |
11003 | for (unsigned I = 0; I < NF; ++I) { |
11004 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11005 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11006 | } |
11007 | return V; |
11008 | } |
11009 | break; |
11010 | case RISCVVector::BI__builtin_rvv_vluxseg3ei8_v_tu: |
11011 | case RISCVVector::BI__builtin_rvv_vluxseg3ei16_v_tu: |
11012 | case RISCVVector::BI__builtin_rvv_vluxseg3ei32_v_tu: |
11013 | case RISCVVector::BI__builtin_rvv_vluxseg3ei64_v_tu: |
11014 | ID = Intrinsic::riscv_vluxseg3; |
11015 | NF = 3; |
11016 | DefaultPolicy = 0; |
11017 | |
11018 | { |
11019 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
11020 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
11021 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11022 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
11023 | SmallVector<llvm::Value*, 12> Operands; |
11024 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
11025 | for (unsigned I = 0; I < NF; ++I) |
11026 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11027 | Operands.push_back(Ops[NF]); |
11028 | Operands.push_back(Ops[NF + 1]); |
11029 | Operands.push_back(Ops[NF + 2]); |
11030 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
11031 | } else { |
11032 | for (unsigned I = 0; I < NF; ++I) |
11033 | Operands.push_back(Ops[NF + I]); |
11034 | Operands.push_back(Ops[2 * NF]); |
11035 | Operands.push_back(Ops[2 * NF + 1]); |
11036 | Operands.push_back(Ops[2 * NF + 2]); |
11037 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
11038 | } |
11039 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11040 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11041 | clang::CharUnits Align = |
11042 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11043 | llvm::Value *V; |
11044 | for (unsigned I = 0; I < NF; ++I) { |
11045 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11046 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11047 | } |
11048 | return V; |
11049 | } |
11050 | break; |
11051 | case RISCVVector::BI__builtin_rvv_vluxseg3ei8_v_ta: |
11052 | case RISCVVector::BI__builtin_rvv_vluxseg3ei16_v_ta: |
11053 | case RISCVVector::BI__builtin_rvv_vluxseg3ei32_v_ta: |
11054 | case RISCVVector::BI__builtin_rvv_vluxseg3ei64_v_ta: |
11055 | ID = Intrinsic::riscv_vluxseg3; |
11056 | NF = 3; |
11057 | DefaultPolicy = 1; |
11058 | |
11059 | { |
11060 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
11061 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
11062 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11063 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
11064 | SmallVector<llvm::Value*, 12> Operands; |
11065 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
11066 | for (unsigned I = 0; I < NF; ++I) |
11067 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11068 | Operands.push_back(Ops[NF]); |
11069 | Operands.push_back(Ops[NF + 1]); |
11070 | Operands.push_back(Ops[NF + 2]); |
11071 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
11072 | } else { |
11073 | for (unsigned I = 0; I < NF; ++I) |
11074 | Operands.push_back(Ops[NF + I]); |
11075 | Operands.push_back(Ops[2 * NF]); |
11076 | Operands.push_back(Ops[2 * NF + 1]); |
11077 | Operands.push_back(Ops[2 * NF + 2]); |
11078 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
11079 | } |
11080 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11081 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11082 | clang::CharUnits Align = |
11083 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11084 | llvm::Value *V; |
11085 | for (unsigned I = 0; I < NF; ++I) { |
11086 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11087 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11088 | } |
11089 | return V; |
11090 | } |
11091 | break; |
11092 | case RISCVVector::BI__builtin_rvv_vluxseg3ei8_v_tuma: |
11093 | case RISCVVector::BI__builtin_rvv_vluxseg3ei16_v_tuma: |
11094 | case RISCVVector::BI__builtin_rvv_vluxseg3ei32_v_tuma: |
11095 | case RISCVVector::BI__builtin_rvv_vluxseg3ei64_v_tuma: |
11096 | ID = Intrinsic::riscv_vluxseg3_mask; |
11097 | NF = 3; |
11098 | DefaultPolicy = 2; |
11099 | |
11100 | { |
11101 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11102 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11103 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11104 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11105 | SmallVector<llvm::Value*, 12> Operands; |
11106 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11107 | for (unsigned I = 0; I < NF; ++I) |
11108 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11109 | Operands.push_back(Ops[NF + 1]); |
11110 | Operands.push_back(Ops[NF + 2]); |
11111 | Operands.push_back(Ops[NF]); |
11112 | Operands.push_back(Ops[NF + 3]); |
11113 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11114 | } else { |
11115 | for (unsigned I = 0; I < NF; ++I) |
11116 | Operands.push_back(Ops[NF + I + 1]); |
11117 | Operands.push_back(Ops[2 * NF + 1]); |
11118 | Operands.push_back(Ops[2 * NF + 2]); |
11119 | Operands.push_back(Ops[NF]); |
11120 | Operands.push_back(Ops[2 * NF + 3]); |
11121 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11122 | } |
11123 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11124 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11124, __extension__ __PRETTY_FUNCTION__)); |
11125 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11126 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11127 | clang::CharUnits Align = |
11128 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11129 | llvm::Value *V; |
11130 | for (unsigned I = 0; I < NF; ++I) { |
11131 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11132 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11133 | } |
11134 | return V; |
11135 | } |
11136 | break; |
11137 | case RISCVVector::BI__builtin_rvv_vluxseg3ei8_v_tama: |
11138 | case RISCVVector::BI__builtin_rvv_vluxseg3ei16_v_tama: |
11139 | case RISCVVector::BI__builtin_rvv_vluxseg3ei32_v_tama: |
11140 | case RISCVVector::BI__builtin_rvv_vluxseg3ei64_v_tama: |
11141 | ID = Intrinsic::riscv_vluxseg3_mask; |
11142 | NF = 3; |
11143 | DefaultPolicy = 3; |
11144 | |
11145 | { |
11146 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11147 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11148 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11149 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11150 | SmallVector<llvm::Value*, 12> Operands; |
11151 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11152 | for (unsigned I = 0; I < NF; ++I) |
11153 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11154 | Operands.push_back(Ops[NF + 1]); |
11155 | Operands.push_back(Ops[NF + 2]); |
11156 | Operands.push_back(Ops[NF]); |
11157 | Operands.push_back(Ops[NF + 3]); |
11158 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11159 | } else { |
11160 | for (unsigned I = 0; I < NF; ++I) |
11161 | Operands.push_back(Ops[NF + I + 1]); |
11162 | Operands.push_back(Ops[2 * NF + 1]); |
11163 | Operands.push_back(Ops[2 * NF + 2]); |
11164 | Operands.push_back(Ops[NF]); |
11165 | Operands.push_back(Ops[2 * NF + 3]); |
11166 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11167 | } |
11168 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11169 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11169, __extension__ __PRETTY_FUNCTION__)); |
11170 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11171 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11172 | clang::CharUnits Align = |
11173 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11174 | llvm::Value *V; |
11175 | for (unsigned I = 0; I < NF; ++I) { |
11176 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11177 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11178 | } |
11179 | return V; |
11180 | } |
11181 | break; |
11182 | case RISCVVector::BI__builtin_rvv_vluxseg3ei8_v_tumu: |
11183 | case RISCVVector::BI__builtin_rvv_vluxseg3ei16_v_tumu: |
11184 | case RISCVVector::BI__builtin_rvv_vluxseg3ei32_v_tumu: |
11185 | case RISCVVector::BI__builtin_rvv_vluxseg3ei64_v_tumu: |
11186 | ID = Intrinsic::riscv_vluxseg3_mask; |
11187 | NF = 3; |
11188 | DefaultPolicy = 0; |
11189 | |
11190 | { |
11191 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11192 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11193 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11194 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11195 | SmallVector<llvm::Value*, 12> Operands; |
11196 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11197 | for (unsigned I = 0; I < NF; ++I) |
11198 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11199 | Operands.push_back(Ops[NF + 1]); |
11200 | Operands.push_back(Ops[NF + 2]); |
11201 | Operands.push_back(Ops[NF]); |
11202 | Operands.push_back(Ops[NF + 3]); |
11203 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11204 | } else { |
11205 | for (unsigned I = 0; I < NF; ++I) |
11206 | Operands.push_back(Ops[NF + I + 1]); |
11207 | Operands.push_back(Ops[2 * NF + 1]); |
11208 | Operands.push_back(Ops[2 * NF + 2]); |
11209 | Operands.push_back(Ops[NF]); |
11210 | Operands.push_back(Ops[2 * NF + 3]); |
11211 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11212 | } |
11213 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11214 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11214, __extension__ __PRETTY_FUNCTION__)); |
11215 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11216 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11217 | clang::CharUnits Align = |
11218 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11219 | llvm::Value *V; |
11220 | for (unsigned I = 0; I < NF; ++I) { |
11221 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11222 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11223 | } |
11224 | return V; |
11225 | } |
11226 | break; |
11227 | case RISCVVector::BI__builtin_rvv_vluxseg3ei8_v_tamu: |
11228 | case RISCVVector::BI__builtin_rvv_vluxseg3ei16_v_tamu: |
11229 | case RISCVVector::BI__builtin_rvv_vluxseg3ei32_v_tamu: |
11230 | case RISCVVector::BI__builtin_rvv_vluxseg3ei64_v_tamu: |
11231 | ID = Intrinsic::riscv_vluxseg3_mask; |
11232 | NF = 3; |
11233 | DefaultPolicy = 1; |
11234 | |
11235 | { |
11236 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11237 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11238 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11239 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11240 | SmallVector<llvm::Value*, 12> Operands; |
11241 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11242 | for (unsigned I = 0; I < NF; ++I) |
11243 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11244 | Operands.push_back(Ops[NF + 1]); |
11245 | Operands.push_back(Ops[NF + 2]); |
11246 | Operands.push_back(Ops[NF]); |
11247 | Operands.push_back(Ops[NF + 3]); |
11248 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11249 | } else { |
11250 | for (unsigned I = 0; I < NF; ++I) |
11251 | Operands.push_back(Ops[NF + I + 1]); |
11252 | Operands.push_back(Ops[2 * NF + 1]); |
11253 | Operands.push_back(Ops[2 * NF + 2]); |
11254 | Operands.push_back(Ops[NF]); |
11255 | Operands.push_back(Ops[2 * NF + 3]); |
11256 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11257 | } |
11258 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11259 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11259, __extension__ __PRETTY_FUNCTION__)); |
11260 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11261 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11262 | clang::CharUnits Align = |
11263 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11264 | llvm::Value *V; |
11265 | for (unsigned I = 0; I < NF; ++I) { |
11266 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11267 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11268 | } |
11269 | return V; |
11270 | } |
11271 | break; |
11272 | case RISCVVector::BI__builtin_rvv_vluxseg4ei8_v_tu: |
11273 | case RISCVVector::BI__builtin_rvv_vluxseg4ei16_v_tu: |
11274 | case RISCVVector::BI__builtin_rvv_vluxseg4ei32_v_tu: |
11275 | case RISCVVector::BI__builtin_rvv_vluxseg4ei64_v_tu: |
11276 | ID = Intrinsic::riscv_vluxseg4; |
11277 | NF = 4; |
11278 | DefaultPolicy = 0; |
11279 | |
11280 | { |
11281 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
11282 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
11283 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11284 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
11285 | SmallVector<llvm::Value*, 12> Operands; |
11286 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
11287 | for (unsigned I = 0; I < NF; ++I) |
11288 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11289 | Operands.push_back(Ops[NF]); |
11290 | Operands.push_back(Ops[NF + 1]); |
11291 | Operands.push_back(Ops[NF + 2]); |
11292 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
11293 | } else { |
11294 | for (unsigned I = 0; I < NF; ++I) |
11295 | Operands.push_back(Ops[NF + I]); |
11296 | Operands.push_back(Ops[2 * NF]); |
11297 | Operands.push_back(Ops[2 * NF + 1]); |
11298 | Operands.push_back(Ops[2 * NF + 2]); |
11299 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
11300 | } |
11301 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11302 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11303 | clang::CharUnits Align = |
11304 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11305 | llvm::Value *V; |
11306 | for (unsigned I = 0; I < NF; ++I) { |
11307 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11308 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11309 | } |
11310 | return V; |
11311 | } |
11312 | break; |
11313 | case RISCVVector::BI__builtin_rvv_vluxseg4ei8_v_ta: |
11314 | case RISCVVector::BI__builtin_rvv_vluxseg4ei16_v_ta: |
11315 | case RISCVVector::BI__builtin_rvv_vluxseg4ei32_v_ta: |
11316 | case RISCVVector::BI__builtin_rvv_vluxseg4ei64_v_ta: |
11317 | ID = Intrinsic::riscv_vluxseg4; |
11318 | NF = 4; |
11319 | DefaultPolicy = 1; |
11320 | |
11321 | { |
11322 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
11323 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
11324 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11325 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
11326 | SmallVector<llvm::Value*, 12> Operands; |
11327 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
11328 | for (unsigned I = 0; I < NF; ++I) |
11329 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11330 | Operands.push_back(Ops[NF]); |
11331 | Operands.push_back(Ops[NF + 1]); |
11332 | Operands.push_back(Ops[NF + 2]); |
11333 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
11334 | } else { |
11335 | for (unsigned I = 0; I < NF; ++I) |
11336 | Operands.push_back(Ops[NF + I]); |
11337 | Operands.push_back(Ops[2 * NF]); |
11338 | Operands.push_back(Ops[2 * NF + 1]); |
11339 | Operands.push_back(Ops[2 * NF + 2]); |
11340 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
11341 | } |
11342 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11343 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11344 | clang::CharUnits Align = |
11345 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11346 | llvm::Value *V; |
11347 | for (unsigned I = 0; I < NF; ++I) { |
11348 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11349 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11350 | } |
11351 | return V; |
11352 | } |
11353 | break; |
11354 | case RISCVVector::BI__builtin_rvv_vluxseg4ei8_v_tuma: |
11355 | case RISCVVector::BI__builtin_rvv_vluxseg4ei16_v_tuma: |
11356 | case RISCVVector::BI__builtin_rvv_vluxseg4ei32_v_tuma: |
11357 | case RISCVVector::BI__builtin_rvv_vluxseg4ei64_v_tuma: |
11358 | ID = Intrinsic::riscv_vluxseg4_mask; |
11359 | NF = 4; |
11360 | DefaultPolicy = 2; |
11361 | |
11362 | { |
11363 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11364 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11365 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11366 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11367 | SmallVector<llvm::Value*, 12> Operands; |
11368 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11369 | for (unsigned I = 0; I < NF; ++I) |
11370 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11371 | Operands.push_back(Ops[NF + 1]); |
11372 | Operands.push_back(Ops[NF + 2]); |
11373 | Operands.push_back(Ops[NF]); |
11374 | Operands.push_back(Ops[NF + 3]); |
11375 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11376 | } else { |
11377 | for (unsigned I = 0; I < NF; ++I) |
11378 | Operands.push_back(Ops[NF + I + 1]); |
11379 | Operands.push_back(Ops[2 * NF + 1]); |
11380 | Operands.push_back(Ops[2 * NF + 2]); |
11381 | Operands.push_back(Ops[NF]); |
11382 | Operands.push_back(Ops[2 * NF + 3]); |
11383 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11384 | } |
11385 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11386 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11386, __extension__ __PRETTY_FUNCTION__)); |
11387 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11388 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11389 | clang::CharUnits Align = |
11390 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11391 | llvm::Value *V; |
11392 | for (unsigned I = 0; I < NF; ++I) { |
11393 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11394 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11395 | } |
11396 | return V; |
11397 | } |
11398 | break; |
11399 | case RISCVVector::BI__builtin_rvv_vluxseg4ei8_v_tama: |
11400 | case RISCVVector::BI__builtin_rvv_vluxseg4ei16_v_tama: |
11401 | case RISCVVector::BI__builtin_rvv_vluxseg4ei32_v_tama: |
11402 | case RISCVVector::BI__builtin_rvv_vluxseg4ei64_v_tama: |
11403 | ID = Intrinsic::riscv_vluxseg4_mask; |
11404 | NF = 4; |
11405 | DefaultPolicy = 3; |
11406 | |
11407 | { |
11408 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11409 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11410 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11411 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11412 | SmallVector<llvm::Value*, 12> Operands; |
11413 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11414 | for (unsigned I = 0; I < NF; ++I) |
11415 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11416 | Operands.push_back(Ops[NF + 1]); |
11417 | Operands.push_back(Ops[NF + 2]); |
11418 | Operands.push_back(Ops[NF]); |
11419 | Operands.push_back(Ops[NF + 3]); |
11420 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11421 | } else { |
11422 | for (unsigned I = 0; I < NF; ++I) |
11423 | Operands.push_back(Ops[NF + I + 1]); |
11424 | Operands.push_back(Ops[2 * NF + 1]); |
11425 | Operands.push_back(Ops[2 * NF + 2]); |
11426 | Operands.push_back(Ops[NF]); |
11427 | Operands.push_back(Ops[2 * NF + 3]); |
11428 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11429 | } |
11430 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11431 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11431, __extension__ __PRETTY_FUNCTION__)); |
11432 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11433 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11434 | clang::CharUnits Align = |
11435 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11436 | llvm::Value *V; |
11437 | for (unsigned I = 0; I < NF; ++I) { |
11438 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11439 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11440 | } |
11441 | return V; |
11442 | } |
11443 | break; |
11444 | case RISCVVector::BI__builtin_rvv_vluxseg4ei8_v_tumu: |
11445 | case RISCVVector::BI__builtin_rvv_vluxseg4ei16_v_tumu: |
11446 | case RISCVVector::BI__builtin_rvv_vluxseg4ei32_v_tumu: |
11447 | case RISCVVector::BI__builtin_rvv_vluxseg4ei64_v_tumu: |
11448 | ID = Intrinsic::riscv_vluxseg4_mask; |
11449 | NF = 4; |
11450 | DefaultPolicy = 0; |
11451 | |
11452 | { |
11453 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11454 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11455 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11456 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11457 | SmallVector<llvm::Value*, 12> Operands; |
11458 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11459 | for (unsigned I = 0; I < NF; ++I) |
11460 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11461 | Operands.push_back(Ops[NF + 1]); |
11462 | Operands.push_back(Ops[NF + 2]); |
11463 | Operands.push_back(Ops[NF]); |
11464 | Operands.push_back(Ops[NF + 3]); |
11465 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11466 | } else { |
11467 | for (unsigned I = 0; I < NF; ++I) |
11468 | Operands.push_back(Ops[NF + I + 1]); |
11469 | Operands.push_back(Ops[2 * NF + 1]); |
11470 | Operands.push_back(Ops[2 * NF + 2]); |
11471 | Operands.push_back(Ops[NF]); |
11472 | Operands.push_back(Ops[2 * NF + 3]); |
11473 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11474 | } |
11475 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11476 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11476, __extension__ __PRETTY_FUNCTION__)); |
11477 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11478 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11479 | clang::CharUnits Align = |
11480 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11481 | llvm::Value *V; |
11482 | for (unsigned I = 0; I < NF; ++I) { |
11483 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11484 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11485 | } |
11486 | return V; |
11487 | } |
11488 | break; |
11489 | case RISCVVector::BI__builtin_rvv_vluxseg4ei8_v_tamu: |
11490 | case RISCVVector::BI__builtin_rvv_vluxseg4ei16_v_tamu: |
11491 | case RISCVVector::BI__builtin_rvv_vluxseg4ei32_v_tamu: |
11492 | case RISCVVector::BI__builtin_rvv_vluxseg4ei64_v_tamu: |
11493 | ID = Intrinsic::riscv_vluxseg4_mask; |
11494 | NF = 4; |
11495 | DefaultPolicy = 1; |
11496 | |
11497 | { |
11498 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11499 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11500 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11501 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11502 | SmallVector<llvm::Value*, 12> Operands; |
11503 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11504 | for (unsigned I = 0; I < NF; ++I) |
11505 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11506 | Operands.push_back(Ops[NF + 1]); |
11507 | Operands.push_back(Ops[NF + 2]); |
11508 | Operands.push_back(Ops[NF]); |
11509 | Operands.push_back(Ops[NF + 3]); |
11510 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11511 | } else { |
11512 | for (unsigned I = 0; I < NF; ++I) |
11513 | Operands.push_back(Ops[NF + I + 1]); |
11514 | Operands.push_back(Ops[2 * NF + 1]); |
11515 | Operands.push_back(Ops[2 * NF + 2]); |
11516 | Operands.push_back(Ops[NF]); |
11517 | Operands.push_back(Ops[2 * NF + 3]); |
11518 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11519 | } |
11520 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11521 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11521, __extension__ __PRETTY_FUNCTION__)); |
11522 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11523 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11524 | clang::CharUnits Align = |
11525 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11526 | llvm::Value *V; |
11527 | for (unsigned I = 0; I < NF; ++I) { |
11528 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11529 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11530 | } |
11531 | return V; |
11532 | } |
11533 | break; |
11534 | case RISCVVector::BI__builtin_rvv_vluxseg5ei8_v_tu: |
11535 | case RISCVVector::BI__builtin_rvv_vluxseg5ei16_v_tu: |
11536 | case RISCVVector::BI__builtin_rvv_vluxseg5ei32_v_tu: |
11537 | case RISCVVector::BI__builtin_rvv_vluxseg5ei64_v_tu: |
11538 | ID = Intrinsic::riscv_vluxseg5; |
11539 | NF = 5; |
11540 | DefaultPolicy = 0; |
11541 | |
11542 | { |
11543 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
11544 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
11545 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11546 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
11547 | SmallVector<llvm::Value*, 12> Operands; |
11548 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
11549 | for (unsigned I = 0; I < NF; ++I) |
11550 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11551 | Operands.push_back(Ops[NF]); |
11552 | Operands.push_back(Ops[NF + 1]); |
11553 | Operands.push_back(Ops[NF + 2]); |
11554 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
11555 | } else { |
11556 | for (unsigned I = 0; I < NF; ++I) |
11557 | Operands.push_back(Ops[NF + I]); |
11558 | Operands.push_back(Ops[2 * NF]); |
11559 | Operands.push_back(Ops[2 * NF + 1]); |
11560 | Operands.push_back(Ops[2 * NF + 2]); |
11561 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
11562 | } |
11563 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11564 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11565 | clang::CharUnits Align = |
11566 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11567 | llvm::Value *V; |
11568 | for (unsigned I = 0; I < NF; ++I) { |
11569 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11570 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11571 | } |
11572 | return V; |
11573 | } |
11574 | break; |
11575 | case RISCVVector::BI__builtin_rvv_vluxseg5ei8_v_ta: |
11576 | case RISCVVector::BI__builtin_rvv_vluxseg5ei16_v_ta: |
11577 | case RISCVVector::BI__builtin_rvv_vluxseg5ei32_v_ta: |
11578 | case RISCVVector::BI__builtin_rvv_vluxseg5ei64_v_ta: |
11579 | ID = Intrinsic::riscv_vluxseg5; |
11580 | NF = 5; |
11581 | DefaultPolicy = 1; |
11582 | |
11583 | { |
11584 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
11585 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
11586 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11587 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
11588 | SmallVector<llvm::Value*, 12> Operands; |
11589 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
11590 | for (unsigned I = 0; I < NF; ++I) |
11591 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11592 | Operands.push_back(Ops[NF]); |
11593 | Operands.push_back(Ops[NF + 1]); |
11594 | Operands.push_back(Ops[NF + 2]); |
11595 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
11596 | } else { |
11597 | for (unsigned I = 0; I < NF; ++I) |
11598 | Operands.push_back(Ops[NF + I]); |
11599 | Operands.push_back(Ops[2 * NF]); |
11600 | Operands.push_back(Ops[2 * NF + 1]); |
11601 | Operands.push_back(Ops[2 * NF + 2]); |
11602 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
11603 | } |
11604 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11605 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11606 | clang::CharUnits Align = |
11607 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11608 | llvm::Value *V; |
11609 | for (unsigned I = 0; I < NF; ++I) { |
11610 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11611 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11612 | } |
11613 | return V; |
11614 | } |
11615 | break; |
11616 | case RISCVVector::BI__builtin_rvv_vluxseg5ei8_v_tuma: |
11617 | case RISCVVector::BI__builtin_rvv_vluxseg5ei16_v_tuma: |
11618 | case RISCVVector::BI__builtin_rvv_vluxseg5ei32_v_tuma: |
11619 | case RISCVVector::BI__builtin_rvv_vluxseg5ei64_v_tuma: |
11620 | ID = Intrinsic::riscv_vluxseg5_mask; |
11621 | NF = 5; |
11622 | DefaultPolicy = 2; |
11623 | |
11624 | { |
11625 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11626 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11627 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11628 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11629 | SmallVector<llvm::Value*, 12> Operands; |
11630 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11631 | for (unsigned I = 0; I < NF; ++I) |
11632 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11633 | Operands.push_back(Ops[NF + 1]); |
11634 | Operands.push_back(Ops[NF + 2]); |
11635 | Operands.push_back(Ops[NF]); |
11636 | Operands.push_back(Ops[NF + 3]); |
11637 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11638 | } else { |
11639 | for (unsigned I = 0; I < NF; ++I) |
11640 | Operands.push_back(Ops[NF + I + 1]); |
11641 | Operands.push_back(Ops[2 * NF + 1]); |
11642 | Operands.push_back(Ops[2 * NF + 2]); |
11643 | Operands.push_back(Ops[NF]); |
11644 | Operands.push_back(Ops[2 * NF + 3]); |
11645 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11646 | } |
11647 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11648 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11648, __extension__ __PRETTY_FUNCTION__)); |
11649 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11650 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11651 | clang::CharUnits Align = |
11652 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11653 | llvm::Value *V; |
11654 | for (unsigned I = 0; I < NF; ++I) { |
11655 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11656 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11657 | } |
11658 | return V; |
11659 | } |
11660 | break; |
11661 | case RISCVVector::BI__builtin_rvv_vluxseg5ei8_v_tama: |
11662 | case RISCVVector::BI__builtin_rvv_vluxseg5ei16_v_tama: |
11663 | case RISCVVector::BI__builtin_rvv_vluxseg5ei32_v_tama: |
11664 | case RISCVVector::BI__builtin_rvv_vluxseg5ei64_v_tama: |
11665 | ID = Intrinsic::riscv_vluxseg5_mask; |
11666 | NF = 5; |
11667 | DefaultPolicy = 3; |
11668 | |
11669 | { |
11670 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11671 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11672 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11673 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11674 | SmallVector<llvm::Value*, 12> Operands; |
11675 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11676 | for (unsigned I = 0; I < NF; ++I) |
11677 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11678 | Operands.push_back(Ops[NF + 1]); |
11679 | Operands.push_back(Ops[NF + 2]); |
11680 | Operands.push_back(Ops[NF]); |
11681 | Operands.push_back(Ops[NF + 3]); |
11682 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11683 | } else { |
11684 | for (unsigned I = 0; I < NF; ++I) |
11685 | Operands.push_back(Ops[NF + I + 1]); |
11686 | Operands.push_back(Ops[2 * NF + 1]); |
11687 | Operands.push_back(Ops[2 * NF + 2]); |
11688 | Operands.push_back(Ops[NF]); |
11689 | Operands.push_back(Ops[2 * NF + 3]); |
11690 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11691 | } |
11692 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11693 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11693, __extension__ __PRETTY_FUNCTION__)); |
11694 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11695 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11696 | clang::CharUnits Align = |
11697 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11698 | llvm::Value *V; |
11699 | for (unsigned I = 0; I < NF; ++I) { |
11700 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11701 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11702 | } |
11703 | return V; |
11704 | } |
11705 | break; |
11706 | case RISCVVector::BI__builtin_rvv_vluxseg5ei8_v_tumu: |
11707 | case RISCVVector::BI__builtin_rvv_vluxseg5ei16_v_tumu: |
11708 | case RISCVVector::BI__builtin_rvv_vluxseg5ei32_v_tumu: |
11709 | case RISCVVector::BI__builtin_rvv_vluxseg5ei64_v_tumu: |
11710 | ID = Intrinsic::riscv_vluxseg5_mask; |
11711 | NF = 5; |
11712 | DefaultPolicy = 0; |
11713 | |
11714 | { |
11715 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11716 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11717 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11718 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11719 | SmallVector<llvm::Value*, 12> Operands; |
11720 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11721 | for (unsigned I = 0; I < NF; ++I) |
11722 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11723 | Operands.push_back(Ops[NF + 1]); |
11724 | Operands.push_back(Ops[NF + 2]); |
11725 | Operands.push_back(Ops[NF]); |
11726 | Operands.push_back(Ops[NF + 3]); |
11727 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11728 | } else { |
11729 | for (unsigned I = 0; I < NF; ++I) |
11730 | Operands.push_back(Ops[NF + I + 1]); |
11731 | Operands.push_back(Ops[2 * NF + 1]); |
11732 | Operands.push_back(Ops[2 * NF + 2]); |
11733 | Operands.push_back(Ops[NF]); |
11734 | Operands.push_back(Ops[2 * NF + 3]); |
11735 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11736 | } |
11737 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11738 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11738, __extension__ __PRETTY_FUNCTION__)); |
11739 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11740 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11741 | clang::CharUnits Align = |
11742 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11743 | llvm::Value *V; |
11744 | for (unsigned I = 0; I < NF; ++I) { |
11745 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11746 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11747 | } |
11748 | return V; |
11749 | } |
11750 | break; |
11751 | case RISCVVector::BI__builtin_rvv_vluxseg5ei8_v_tamu: |
11752 | case RISCVVector::BI__builtin_rvv_vluxseg5ei16_v_tamu: |
11753 | case RISCVVector::BI__builtin_rvv_vluxseg5ei32_v_tamu: |
11754 | case RISCVVector::BI__builtin_rvv_vluxseg5ei64_v_tamu: |
11755 | ID = Intrinsic::riscv_vluxseg5_mask; |
11756 | NF = 5; |
11757 | DefaultPolicy = 1; |
11758 | |
11759 | { |
11760 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11761 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11762 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11763 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11764 | SmallVector<llvm::Value*, 12> Operands; |
11765 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11766 | for (unsigned I = 0; I < NF; ++I) |
11767 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11768 | Operands.push_back(Ops[NF + 1]); |
11769 | Operands.push_back(Ops[NF + 2]); |
11770 | Operands.push_back(Ops[NF]); |
11771 | Operands.push_back(Ops[NF + 3]); |
11772 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11773 | } else { |
11774 | for (unsigned I = 0; I < NF; ++I) |
11775 | Operands.push_back(Ops[NF + I + 1]); |
11776 | Operands.push_back(Ops[2 * NF + 1]); |
11777 | Operands.push_back(Ops[2 * NF + 2]); |
11778 | Operands.push_back(Ops[NF]); |
11779 | Operands.push_back(Ops[2 * NF + 3]); |
11780 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11781 | } |
11782 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11783 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11783, __extension__ __PRETTY_FUNCTION__)); |
11784 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11785 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11786 | clang::CharUnits Align = |
11787 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11788 | llvm::Value *V; |
11789 | for (unsigned I = 0; I < NF; ++I) { |
11790 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11791 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11792 | } |
11793 | return V; |
11794 | } |
11795 | break; |
11796 | case RISCVVector::BI__builtin_rvv_vluxseg6ei8_v_tu: |
11797 | case RISCVVector::BI__builtin_rvv_vluxseg6ei16_v_tu: |
11798 | case RISCVVector::BI__builtin_rvv_vluxseg6ei32_v_tu: |
11799 | case RISCVVector::BI__builtin_rvv_vluxseg6ei64_v_tu: |
11800 | ID = Intrinsic::riscv_vluxseg6; |
11801 | NF = 6; |
11802 | DefaultPolicy = 0; |
11803 | |
11804 | { |
11805 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
11806 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
11807 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11808 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
11809 | SmallVector<llvm::Value*, 12> Operands; |
11810 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
11811 | for (unsigned I = 0; I < NF; ++I) |
11812 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11813 | Operands.push_back(Ops[NF]); |
11814 | Operands.push_back(Ops[NF + 1]); |
11815 | Operands.push_back(Ops[NF + 2]); |
11816 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
11817 | } else { |
11818 | for (unsigned I = 0; I < NF; ++I) |
11819 | Operands.push_back(Ops[NF + I]); |
11820 | Operands.push_back(Ops[2 * NF]); |
11821 | Operands.push_back(Ops[2 * NF + 1]); |
11822 | Operands.push_back(Ops[2 * NF + 2]); |
11823 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
11824 | } |
11825 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11826 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11827 | clang::CharUnits Align = |
11828 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11829 | llvm::Value *V; |
11830 | for (unsigned I = 0; I < NF; ++I) { |
11831 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11832 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11833 | } |
11834 | return V; |
11835 | } |
11836 | break; |
11837 | case RISCVVector::BI__builtin_rvv_vluxseg6ei8_v_ta: |
11838 | case RISCVVector::BI__builtin_rvv_vluxseg6ei16_v_ta: |
11839 | case RISCVVector::BI__builtin_rvv_vluxseg6ei32_v_ta: |
11840 | case RISCVVector::BI__builtin_rvv_vluxseg6ei64_v_ta: |
11841 | ID = Intrinsic::riscv_vluxseg6; |
11842 | NF = 6; |
11843 | DefaultPolicy = 1; |
11844 | |
11845 | { |
11846 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
11847 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
11848 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11849 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
11850 | SmallVector<llvm::Value*, 12> Operands; |
11851 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
11852 | for (unsigned I = 0; I < NF; ++I) |
11853 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11854 | Operands.push_back(Ops[NF]); |
11855 | Operands.push_back(Ops[NF + 1]); |
11856 | Operands.push_back(Ops[NF + 2]); |
11857 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
11858 | } else { |
11859 | for (unsigned I = 0; I < NF; ++I) |
11860 | Operands.push_back(Ops[NF + I]); |
11861 | Operands.push_back(Ops[2 * NF]); |
11862 | Operands.push_back(Ops[2 * NF + 1]); |
11863 | Operands.push_back(Ops[2 * NF + 2]); |
11864 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
11865 | } |
11866 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11867 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11868 | clang::CharUnits Align = |
11869 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11870 | llvm::Value *V; |
11871 | for (unsigned I = 0; I < NF; ++I) { |
11872 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11873 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11874 | } |
11875 | return V; |
11876 | } |
11877 | break; |
11878 | case RISCVVector::BI__builtin_rvv_vluxseg6ei8_v_tuma: |
11879 | case RISCVVector::BI__builtin_rvv_vluxseg6ei16_v_tuma: |
11880 | case RISCVVector::BI__builtin_rvv_vluxseg6ei32_v_tuma: |
11881 | case RISCVVector::BI__builtin_rvv_vluxseg6ei64_v_tuma: |
11882 | ID = Intrinsic::riscv_vluxseg6_mask; |
11883 | NF = 6; |
11884 | DefaultPolicy = 2; |
11885 | |
11886 | { |
11887 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11888 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11889 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11890 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11891 | SmallVector<llvm::Value*, 12> Operands; |
11892 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11893 | for (unsigned I = 0; I < NF; ++I) |
11894 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11895 | Operands.push_back(Ops[NF + 1]); |
11896 | Operands.push_back(Ops[NF + 2]); |
11897 | Operands.push_back(Ops[NF]); |
11898 | Operands.push_back(Ops[NF + 3]); |
11899 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11900 | } else { |
11901 | for (unsigned I = 0; I < NF; ++I) |
11902 | Operands.push_back(Ops[NF + I + 1]); |
11903 | Operands.push_back(Ops[2 * NF + 1]); |
11904 | Operands.push_back(Ops[2 * NF + 2]); |
11905 | Operands.push_back(Ops[NF]); |
11906 | Operands.push_back(Ops[2 * NF + 3]); |
11907 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11908 | } |
11909 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11910 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11910, __extension__ __PRETTY_FUNCTION__)); |
11911 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11912 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11913 | clang::CharUnits Align = |
11914 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11915 | llvm::Value *V; |
11916 | for (unsigned I = 0; I < NF; ++I) { |
11917 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11918 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11919 | } |
11920 | return V; |
11921 | } |
11922 | break; |
11923 | case RISCVVector::BI__builtin_rvv_vluxseg6ei8_v_tama: |
11924 | case RISCVVector::BI__builtin_rvv_vluxseg6ei16_v_tama: |
11925 | case RISCVVector::BI__builtin_rvv_vluxseg6ei32_v_tama: |
11926 | case RISCVVector::BI__builtin_rvv_vluxseg6ei64_v_tama: |
11927 | ID = Intrinsic::riscv_vluxseg6_mask; |
11928 | NF = 6; |
11929 | DefaultPolicy = 3; |
11930 | |
11931 | { |
11932 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11933 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11934 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11935 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11936 | SmallVector<llvm::Value*, 12> Operands; |
11937 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11938 | for (unsigned I = 0; I < NF; ++I) |
11939 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11940 | Operands.push_back(Ops[NF + 1]); |
11941 | Operands.push_back(Ops[NF + 2]); |
11942 | Operands.push_back(Ops[NF]); |
11943 | Operands.push_back(Ops[NF + 3]); |
11944 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11945 | } else { |
11946 | for (unsigned I = 0; I < NF; ++I) |
11947 | Operands.push_back(Ops[NF + I + 1]); |
11948 | Operands.push_back(Ops[2 * NF + 1]); |
11949 | Operands.push_back(Ops[2 * NF + 2]); |
11950 | Operands.push_back(Ops[NF]); |
11951 | Operands.push_back(Ops[2 * NF + 3]); |
11952 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11953 | } |
11954 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
11955 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 11955, __extension__ __PRETTY_FUNCTION__)); |
11956 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
11957 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
11958 | clang::CharUnits Align = |
11959 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
11960 | llvm::Value *V; |
11961 | for (unsigned I = 0; I < NF; ++I) { |
11962 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
11963 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
11964 | } |
11965 | return V; |
11966 | } |
11967 | break; |
11968 | case RISCVVector::BI__builtin_rvv_vluxseg6ei8_v_tumu: |
11969 | case RISCVVector::BI__builtin_rvv_vluxseg6ei16_v_tumu: |
11970 | case RISCVVector::BI__builtin_rvv_vluxseg6ei32_v_tumu: |
11971 | case RISCVVector::BI__builtin_rvv_vluxseg6ei64_v_tumu: |
11972 | ID = Intrinsic::riscv_vluxseg6_mask; |
11973 | NF = 6; |
11974 | DefaultPolicy = 0; |
11975 | |
11976 | { |
11977 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
11978 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
11979 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
11980 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
11981 | SmallVector<llvm::Value*, 12> Operands; |
11982 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
11983 | for (unsigned I = 0; I < NF; ++I) |
11984 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
11985 | Operands.push_back(Ops[NF + 1]); |
11986 | Operands.push_back(Ops[NF + 2]); |
11987 | Operands.push_back(Ops[NF]); |
11988 | Operands.push_back(Ops[NF + 3]); |
11989 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
11990 | } else { |
11991 | for (unsigned I = 0; I < NF; ++I) |
11992 | Operands.push_back(Ops[NF + I + 1]); |
11993 | Operands.push_back(Ops[2 * NF + 1]); |
11994 | Operands.push_back(Ops[2 * NF + 2]); |
11995 | Operands.push_back(Ops[NF]); |
11996 | Operands.push_back(Ops[2 * NF + 3]); |
11997 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
11998 | } |
11999 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12000 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12000, __extension__ __PRETTY_FUNCTION__)); |
12001 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12002 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12003 | clang::CharUnits Align = |
12004 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12005 | llvm::Value *V; |
12006 | for (unsigned I = 0; I < NF; ++I) { |
12007 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12008 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12009 | } |
12010 | return V; |
12011 | } |
12012 | break; |
12013 | case RISCVVector::BI__builtin_rvv_vluxseg6ei8_v_tamu: |
12014 | case RISCVVector::BI__builtin_rvv_vluxseg6ei16_v_tamu: |
12015 | case RISCVVector::BI__builtin_rvv_vluxseg6ei32_v_tamu: |
12016 | case RISCVVector::BI__builtin_rvv_vluxseg6ei64_v_tamu: |
12017 | ID = Intrinsic::riscv_vluxseg6_mask; |
12018 | NF = 6; |
12019 | DefaultPolicy = 1; |
12020 | |
12021 | { |
12022 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12023 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12024 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12025 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12026 | SmallVector<llvm::Value*, 12> Operands; |
12027 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12028 | for (unsigned I = 0; I < NF; ++I) |
12029 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12030 | Operands.push_back(Ops[NF + 1]); |
12031 | Operands.push_back(Ops[NF + 2]); |
12032 | Operands.push_back(Ops[NF]); |
12033 | Operands.push_back(Ops[NF + 3]); |
12034 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12035 | } else { |
12036 | for (unsigned I = 0; I < NF; ++I) |
12037 | Operands.push_back(Ops[NF + I + 1]); |
12038 | Operands.push_back(Ops[2 * NF + 1]); |
12039 | Operands.push_back(Ops[2 * NF + 2]); |
12040 | Operands.push_back(Ops[NF]); |
12041 | Operands.push_back(Ops[2 * NF + 3]); |
12042 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12043 | } |
12044 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12045 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12045, __extension__ __PRETTY_FUNCTION__)); |
12046 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12047 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12048 | clang::CharUnits Align = |
12049 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12050 | llvm::Value *V; |
12051 | for (unsigned I = 0; I < NF; ++I) { |
12052 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12053 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12054 | } |
12055 | return V; |
12056 | } |
12057 | break; |
12058 | case RISCVVector::BI__builtin_rvv_vluxseg7ei8_v_tu: |
12059 | case RISCVVector::BI__builtin_rvv_vluxseg7ei16_v_tu: |
12060 | case RISCVVector::BI__builtin_rvv_vluxseg7ei32_v_tu: |
12061 | case RISCVVector::BI__builtin_rvv_vluxseg7ei64_v_tu: |
12062 | ID = Intrinsic::riscv_vluxseg7; |
12063 | NF = 7; |
12064 | DefaultPolicy = 0; |
12065 | |
12066 | { |
12067 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
12068 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
12069 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12070 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
12071 | SmallVector<llvm::Value*, 12> Operands; |
12072 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
12073 | for (unsigned I = 0; I < NF; ++I) |
12074 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12075 | Operands.push_back(Ops[NF]); |
12076 | Operands.push_back(Ops[NF + 1]); |
12077 | Operands.push_back(Ops[NF + 2]); |
12078 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
12079 | } else { |
12080 | for (unsigned I = 0; I < NF; ++I) |
12081 | Operands.push_back(Ops[NF + I]); |
12082 | Operands.push_back(Ops[2 * NF]); |
12083 | Operands.push_back(Ops[2 * NF + 1]); |
12084 | Operands.push_back(Ops[2 * NF + 2]); |
12085 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
12086 | } |
12087 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12088 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12089 | clang::CharUnits Align = |
12090 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12091 | llvm::Value *V; |
12092 | for (unsigned I = 0; I < NF; ++I) { |
12093 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12094 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12095 | } |
12096 | return V; |
12097 | } |
12098 | break; |
12099 | case RISCVVector::BI__builtin_rvv_vluxseg7ei8_v_ta: |
12100 | case RISCVVector::BI__builtin_rvv_vluxseg7ei16_v_ta: |
12101 | case RISCVVector::BI__builtin_rvv_vluxseg7ei32_v_ta: |
12102 | case RISCVVector::BI__builtin_rvv_vluxseg7ei64_v_ta: |
12103 | ID = Intrinsic::riscv_vluxseg7; |
12104 | NF = 7; |
12105 | DefaultPolicy = 1; |
12106 | |
12107 | { |
12108 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
12109 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
12110 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12111 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
12112 | SmallVector<llvm::Value*, 12> Operands; |
12113 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
12114 | for (unsigned I = 0; I < NF; ++I) |
12115 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12116 | Operands.push_back(Ops[NF]); |
12117 | Operands.push_back(Ops[NF + 1]); |
12118 | Operands.push_back(Ops[NF + 2]); |
12119 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
12120 | } else { |
12121 | for (unsigned I = 0; I < NF; ++I) |
12122 | Operands.push_back(Ops[NF + I]); |
12123 | Operands.push_back(Ops[2 * NF]); |
12124 | Operands.push_back(Ops[2 * NF + 1]); |
12125 | Operands.push_back(Ops[2 * NF + 2]); |
12126 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
12127 | } |
12128 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12129 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12130 | clang::CharUnits Align = |
12131 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12132 | llvm::Value *V; |
12133 | for (unsigned I = 0; I < NF; ++I) { |
12134 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12135 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12136 | } |
12137 | return V; |
12138 | } |
12139 | break; |
12140 | case RISCVVector::BI__builtin_rvv_vluxseg7ei8_v_tuma: |
12141 | case RISCVVector::BI__builtin_rvv_vluxseg7ei16_v_tuma: |
12142 | case RISCVVector::BI__builtin_rvv_vluxseg7ei32_v_tuma: |
12143 | case RISCVVector::BI__builtin_rvv_vluxseg7ei64_v_tuma: |
12144 | ID = Intrinsic::riscv_vluxseg7_mask; |
12145 | NF = 7; |
12146 | DefaultPolicy = 2; |
12147 | |
12148 | { |
12149 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12150 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12151 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12152 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12153 | SmallVector<llvm::Value*, 12> Operands; |
12154 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12155 | for (unsigned I = 0; I < NF; ++I) |
12156 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12157 | Operands.push_back(Ops[NF + 1]); |
12158 | Operands.push_back(Ops[NF + 2]); |
12159 | Operands.push_back(Ops[NF]); |
12160 | Operands.push_back(Ops[NF + 3]); |
12161 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12162 | } else { |
12163 | for (unsigned I = 0; I < NF; ++I) |
12164 | Operands.push_back(Ops[NF + I + 1]); |
12165 | Operands.push_back(Ops[2 * NF + 1]); |
12166 | Operands.push_back(Ops[2 * NF + 2]); |
12167 | Operands.push_back(Ops[NF]); |
12168 | Operands.push_back(Ops[2 * NF + 3]); |
12169 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12170 | } |
12171 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12172 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12172, __extension__ __PRETTY_FUNCTION__)); |
12173 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12174 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12175 | clang::CharUnits Align = |
12176 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12177 | llvm::Value *V; |
12178 | for (unsigned I = 0; I < NF; ++I) { |
12179 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12180 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12181 | } |
12182 | return V; |
12183 | } |
12184 | break; |
12185 | case RISCVVector::BI__builtin_rvv_vluxseg7ei8_v_tama: |
12186 | case RISCVVector::BI__builtin_rvv_vluxseg7ei16_v_tama: |
12187 | case RISCVVector::BI__builtin_rvv_vluxseg7ei32_v_tama: |
12188 | case RISCVVector::BI__builtin_rvv_vluxseg7ei64_v_tama: |
12189 | ID = Intrinsic::riscv_vluxseg7_mask; |
12190 | NF = 7; |
12191 | DefaultPolicy = 3; |
12192 | |
12193 | { |
12194 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12195 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12196 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12197 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12198 | SmallVector<llvm::Value*, 12> Operands; |
12199 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12200 | for (unsigned I = 0; I < NF; ++I) |
12201 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12202 | Operands.push_back(Ops[NF + 1]); |
12203 | Operands.push_back(Ops[NF + 2]); |
12204 | Operands.push_back(Ops[NF]); |
12205 | Operands.push_back(Ops[NF + 3]); |
12206 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12207 | } else { |
12208 | for (unsigned I = 0; I < NF; ++I) |
12209 | Operands.push_back(Ops[NF + I + 1]); |
12210 | Operands.push_back(Ops[2 * NF + 1]); |
12211 | Operands.push_back(Ops[2 * NF + 2]); |
12212 | Operands.push_back(Ops[NF]); |
12213 | Operands.push_back(Ops[2 * NF + 3]); |
12214 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12215 | } |
12216 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12217 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12217, __extension__ __PRETTY_FUNCTION__)); |
12218 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12219 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12220 | clang::CharUnits Align = |
12221 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12222 | llvm::Value *V; |
12223 | for (unsigned I = 0; I < NF; ++I) { |
12224 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12225 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12226 | } |
12227 | return V; |
12228 | } |
12229 | break; |
12230 | case RISCVVector::BI__builtin_rvv_vluxseg7ei8_v_tumu: |
12231 | case RISCVVector::BI__builtin_rvv_vluxseg7ei16_v_tumu: |
12232 | case RISCVVector::BI__builtin_rvv_vluxseg7ei32_v_tumu: |
12233 | case RISCVVector::BI__builtin_rvv_vluxseg7ei64_v_tumu: |
12234 | ID = Intrinsic::riscv_vluxseg7_mask; |
12235 | NF = 7; |
12236 | DefaultPolicy = 0; |
12237 | |
12238 | { |
12239 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12240 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12241 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12242 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12243 | SmallVector<llvm::Value*, 12> Operands; |
12244 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12245 | for (unsigned I = 0; I < NF; ++I) |
12246 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12247 | Operands.push_back(Ops[NF + 1]); |
12248 | Operands.push_back(Ops[NF + 2]); |
12249 | Operands.push_back(Ops[NF]); |
12250 | Operands.push_back(Ops[NF + 3]); |
12251 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12252 | } else { |
12253 | for (unsigned I = 0; I < NF; ++I) |
12254 | Operands.push_back(Ops[NF + I + 1]); |
12255 | Operands.push_back(Ops[2 * NF + 1]); |
12256 | Operands.push_back(Ops[2 * NF + 2]); |
12257 | Operands.push_back(Ops[NF]); |
12258 | Operands.push_back(Ops[2 * NF + 3]); |
12259 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12260 | } |
12261 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12262 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12262, __extension__ __PRETTY_FUNCTION__)); |
12263 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12264 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12265 | clang::CharUnits Align = |
12266 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12267 | llvm::Value *V; |
12268 | for (unsigned I = 0; I < NF; ++I) { |
12269 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12270 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12271 | } |
12272 | return V; |
12273 | } |
12274 | break; |
12275 | case RISCVVector::BI__builtin_rvv_vluxseg7ei8_v_tamu: |
12276 | case RISCVVector::BI__builtin_rvv_vluxseg7ei16_v_tamu: |
12277 | case RISCVVector::BI__builtin_rvv_vluxseg7ei32_v_tamu: |
12278 | case RISCVVector::BI__builtin_rvv_vluxseg7ei64_v_tamu: |
12279 | ID = Intrinsic::riscv_vluxseg7_mask; |
12280 | NF = 7; |
12281 | DefaultPolicy = 1; |
12282 | |
12283 | { |
12284 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12285 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12286 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12287 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12288 | SmallVector<llvm::Value*, 12> Operands; |
12289 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12290 | for (unsigned I = 0; I < NF; ++I) |
12291 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12292 | Operands.push_back(Ops[NF + 1]); |
12293 | Operands.push_back(Ops[NF + 2]); |
12294 | Operands.push_back(Ops[NF]); |
12295 | Operands.push_back(Ops[NF + 3]); |
12296 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12297 | } else { |
12298 | for (unsigned I = 0; I < NF; ++I) |
12299 | Operands.push_back(Ops[NF + I + 1]); |
12300 | Operands.push_back(Ops[2 * NF + 1]); |
12301 | Operands.push_back(Ops[2 * NF + 2]); |
12302 | Operands.push_back(Ops[NF]); |
12303 | Operands.push_back(Ops[2 * NF + 3]); |
12304 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12305 | } |
12306 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12307 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12307, __extension__ __PRETTY_FUNCTION__)); |
12308 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12309 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12310 | clang::CharUnits Align = |
12311 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12312 | llvm::Value *V; |
12313 | for (unsigned I = 0; I < NF; ++I) { |
12314 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12315 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12316 | } |
12317 | return V; |
12318 | } |
12319 | break; |
12320 | case RISCVVector::BI__builtin_rvv_vluxseg8ei8_v_tu: |
12321 | case RISCVVector::BI__builtin_rvv_vluxseg8ei16_v_tu: |
12322 | case RISCVVector::BI__builtin_rvv_vluxseg8ei32_v_tu: |
12323 | case RISCVVector::BI__builtin_rvv_vluxseg8ei64_v_tu: |
12324 | ID = Intrinsic::riscv_vluxseg8; |
12325 | NF = 8; |
12326 | DefaultPolicy = 0; |
12327 | |
12328 | { |
12329 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
12330 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
12331 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12332 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
12333 | SmallVector<llvm::Value*, 12> Operands; |
12334 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
12335 | for (unsigned I = 0; I < NF; ++I) |
12336 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12337 | Operands.push_back(Ops[NF]); |
12338 | Operands.push_back(Ops[NF + 1]); |
12339 | Operands.push_back(Ops[NF + 2]); |
12340 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
12341 | } else { |
12342 | for (unsigned I = 0; I < NF; ++I) |
12343 | Operands.push_back(Ops[NF + I]); |
12344 | Operands.push_back(Ops[2 * NF]); |
12345 | Operands.push_back(Ops[2 * NF + 1]); |
12346 | Operands.push_back(Ops[2 * NF + 2]); |
12347 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
12348 | } |
12349 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12350 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12351 | clang::CharUnits Align = |
12352 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12353 | llvm::Value *V; |
12354 | for (unsigned I = 0; I < NF; ++I) { |
12355 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12356 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12357 | } |
12358 | return V; |
12359 | } |
12360 | break; |
12361 | case RISCVVector::BI__builtin_rvv_vluxseg8ei8_v_ta: |
12362 | case RISCVVector::BI__builtin_rvv_vluxseg8ei16_v_ta: |
12363 | case RISCVVector::BI__builtin_rvv_vluxseg8ei32_v_ta: |
12364 | case RISCVVector::BI__builtin_rvv_vluxseg8ei64_v_ta: |
12365 | ID = Intrinsic::riscv_vluxseg8; |
12366 | NF = 8; |
12367 | DefaultPolicy = 1; |
12368 | |
12369 | { |
12370 | // TA builtin: (val0 address, val1 address, ..., ptr, index, vl) |
12371 | // TU builtin: (val0 address, ..., passthru0, ..., ptr, index, vl) |
12372 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12373 | // intrinsic: (passthru0, passthru1, ..., ptr, index, vl) |
12374 | SmallVector<llvm::Value*, 12> Operands; |
12375 | if (DefaultPolicy == TAIL_AGNOSTIC) { |
12376 | for (unsigned I = 0; I < NF; ++I) |
12377 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12378 | Operands.push_back(Ops[NF]); |
12379 | Operands.push_back(Ops[NF + 1]); |
12380 | Operands.push_back(Ops[NF + 2]); |
12381 | IntrinsicTypes = {ResultType, Ops[NF + 1]->getType(), Ops.back()->getType()}; |
12382 | } else { |
12383 | for (unsigned I = 0; I < NF; ++I) |
12384 | Operands.push_back(Ops[NF + I]); |
12385 | Operands.push_back(Ops[2 * NF]); |
12386 | Operands.push_back(Ops[2 * NF + 1]); |
12387 | Operands.push_back(Ops[2 * NF + 2]); |
12388 | IntrinsicTypes = {ResultType, Ops[2 * NF + 1]->getType(), Ops.back()->getType()}; |
12389 | } |
12390 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12391 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12392 | clang::CharUnits Align = |
12393 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12394 | llvm::Value *V; |
12395 | for (unsigned I = 0; I < NF; ++I) { |
12396 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12397 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12398 | } |
12399 | return V; |
12400 | } |
12401 | break; |
12402 | case RISCVVector::BI__builtin_rvv_vluxseg8ei8_v_tuma: |
12403 | case RISCVVector::BI__builtin_rvv_vluxseg8ei16_v_tuma: |
12404 | case RISCVVector::BI__builtin_rvv_vluxseg8ei32_v_tuma: |
12405 | case RISCVVector::BI__builtin_rvv_vluxseg8ei64_v_tuma: |
12406 | ID = Intrinsic::riscv_vluxseg8_mask; |
12407 | NF = 8; |
12408 | DefaultPolicy = 2; |
12409 | |
12410 | { |
12411 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12412 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12413 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12414 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12415 | SmallVector<llvm::Value*, 12> Operands; |
12416 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12417 | for (unsigned I = 0; I < NF; ++I) |
12418 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12419 | Operands.push_back(Ops[NF + 1]); |
12420 | Operands.push_back(Ops[NF + 2]); |
12421 | Operands.push_back(Ops[NF]); |
12422 | Operands.push_back(Ops[NF + 3]); |
12423 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12424 | } else { |
12425 | for (unsigned I = 0; I < NF; ++I) |
12426 | Operands.push_back(Ops[NF + I + 1]); |
12427 | Operands.push_back(Ops[2 * NF + 1]); |
12428 | Operands.push_back(Ops[2 * NF + 2]); |
12429 | Operands.push_back(Ops[NF]); |
12430 | Operands.push_back(Ops[2 * NF + 3]); |
12431 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12432 | } |
12433 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12434 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12434, __extension__ __PRETTY_FUNCTION__)); |
12435 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12436 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12437 | clang::CharUnits Align = |
12438 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12439 | llvm::Value *V; |
12440 | for (unsigned I = 0; I < NF; ++I) { |
12441 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12442 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12443 | } |
12444 | return V; |
12445 | } |
12446 | break; |
12447 | case RISCVVector::BI__builtin_rvv_vluxseg8ei8_v_tama: |
12448 | case RISCVVector::BI__builtin_rvv_vluxseg8ei16_v_tama: |
12449 | case RISCVVector::BI__builtin_rvv_vluxseg8ei32_v_tama: |
12450 | case RISCVVector::BI__builtin_rvv_vluxseg8ei64_v_tama: |
12451 | ID = Intrinsic::riscv_vluxseg8_mask; |
12452 | NF = 8; |
12453 | DefaultPolicy = 3; |
12454 | |
12455 | { |
12456 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12457 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12458 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12459 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12460 | SmallVector<llvm::Value*, 12> Operands; |
12461 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12462 | for (unsigned I = 0; I < NF; ++I) |
12463 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12464 | Operands.push_back(Ops[NF + 1]); |
12465 | Operands.push_back(Ops[NF + 2]); |
12466 | Operands.push_back(Ops[NF]); |
12467 | Operands.push_back(Ops[NF + 3]); |
12468 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12469 | } else { |
12470 | for (unsigned I = 0; I < NF; ++I) |
12471 | Operands.push_back(Ops[NF + I + 1]); |
12472 | Operands.push_back(Ops[2 * NF + 1]); |
12473 | Operands.push_back(Ops[2 * NF + 2]); |
12474 | Operands.push_back(Ops[NF]); |
12475 | Operands.push_back(Ops[2 * NF + 3]); |
12476 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12477 | } |
12478 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12479 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12479, __extension__ __PRETTY_FUNCTION__)); |
12480 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12481 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12482 | clang::CharUnits Align = |
12483 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12484 | llvm::Value *V; |
12485 | for (unsigned I = 0; I < NF; ++I) { |
12486 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12487 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12488 | } |
12489 | return V; |
12490 | } |
12491 | break; |
12492 | case RISCVVector::BI__builtin_rvv_vluxseg8ei8_v_tumu: |
12493 | case RISCVVector::BI__builtin_rvv_vluxseg8ei16_v_tumu: |
12494 | case RISCVVector::BI__builtin_rvv_vluxseg8ei32_v_tumu: |
12495 | case RISCVVector::BI__builtin_rvv_vluxseg8ei64_v_tumu: |
12496 | ID = Intrinsic::riscv_vluxseg8_mask; |
12497 | NF = 8; |
12498 | DefaultPolicy = 0; |
12499 | |
12500 | { |
12501 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12502 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12503 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12504 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12505 | SmallVector<llvm::Value*, 12> Operands; |
12506 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12507 | for (unsigned I = 0; I < NF; ++I) |
12508 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12509 | Operands.push_back(Ops[NF + 1]); |
12510 | Operands.push_back(Ops[NF + 2]); |
12511 | Operands.push_back(Ops[NF]); |
12512 | Operands.push_back(Ops[NF + 3]); |
12513 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12514 | } else { |
12515 | for (unsigned I = 0; I < NF; ++I) |
12516 | Operands.push_back(Ops[NF + I + 1]); |
12517 | Operands.push_back(Ops[2 * NF + 1]); |
12518 | Operands.push_back(Ops[2 * NF + 2]); |
12519 | Operands.push_back(Ops[NF]); |
12520 | Operands.push_back(Ops[2 * NF + 3]); |
12521 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12522 | } |
12523 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12524 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12524, __extension__ __PRETTY_FUNCTION__)); |
12525 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12526 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12527 | clang::CharUnits Align = |
12528 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12529 | llvm::Value *V; |
12530 | for (unsigned I = 0; I < NF; ++I) { |
12531 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12532 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12533 | } |
12534 | return V; |
12535 | } |
12536 | break; |
12537 | case RISCVVector::BI__builtin_rvv_vluxseg8ei8_v_tamu: |
12538 | case RISCVVector::BI__builtin_rvv_vluxseg8ei16_v_tamu: |
12539 | case RISCVVector::BI__builtin_rvv_vluxseg8ei32_v_tamu: |
12540 | case RISCVVector::BI__builtin_rvv_vluxseg8ei64_v_tamu: |
12541 | ID = Intrinsic::riscv_vluxseg8_mask; |
12542 | NF = 8; |
12543 | DefaultPolicy = 1; |
12544 | |
12545 | { |
12546 | // TAMA builtin: (val0 address, ..., mask, ptr, index, vl) |
12547 | // builtin: (val0 address, ..., mask, maskedoff0, ..., ptr, index, vl) |
12548 | ResultType = ConvertType(E->getArg(0)->getType()->getPointeeType()); |
12549 | // intrinsic: (maskedoff0, ..., ptr, index, mask, vl) |
12550 | SmallVector<llvm::Value*, 12> Operands; |
12551 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) { |
12552 | for (unsigned I = 0; I < NF; ++I) |
12553 | Operands.push_back(llvm::PoisonValue::get(ResultType)); |
12554 | Operands.push_back(Ops[NF + 1]); |
12555 | Operands.push_back(Ops[NF + 2]); |
12556 | Operands.push_back(Ops[NF]); |
12557 | Operands.push_back(Ops[NF + 3]); |
12558 | IntrinsicTypes = {ResultType, Ops[NF + 2]->getType(), Ops.back()->getType()}; |
12559 | } else { |
12560 | for (unsigned I = 0; I < NF; ++I) |
12561 | Operands.push_back(Ops[NF + I + 1]); |
12562 | Operands.push_back(Ops[2 * NF + 1]); |
12563 | Operands.push_back(Ops[2 * NF + 2]); |
12564 | Operands.push_back(Ops[NF]); |
12565 | Operands.push_back(Ops[2 * NF + 3]); |
12566 | IntrinsicTypes = {ResultType, Ops[2 * NF + 2]->getType(), Ops.back()->getType()}; |
12567 | } |
12568 | Operands.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12569 | assert(Operands.size() == NF + 5)(static_cast <bool> (Operands.size() == NF + 5) ? void ( 0) : __assert_fail ("Operands.size() == NF + 5", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 12569, __extension__ __PRETTY_FUNCTION__)); |
12570 | llvm::Function *F = CGM.getIntrinsic(ID, IntrinsicTypes); |
12571 | llvm::Value *LoadValue = Builder.CreateCall(F, Operands, ""); |
12572 | clang::CharUnits Align = |
12573 | CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType()); |
12574 | llvm::Value *V; |
12575 | for (unsigned I = 0; I < NF; ++I) { |
12576 | llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I}); |
12577 | V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align)); |
12578 | } |
12579 | return V; |
12580 | } |
12581 | break; |
12582 | case RISCVVector::BI__builtin_rvv_vmacc_vv_tu: |
12583 | case RISCVVector::BI__builtin_rvv_vmacc_vx_tu: |
12584 | ID = Intrinsic::riscv_vmacc; |
12585 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12586 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12587 | break; |
12588 | case RISCVVector::BI__builtin_rvv_vmacc_vv_ta: |
12589 | case RISCVVector::BI__builtin_rvv_vmacc_vx_ta: |
12590 | ID = Intrinsic::riscv_vmacc; |
12591 | DefaultPolicy = 1; |
12592 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12593 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12594 | break; |
12595 | case RISCVVector::BI__builtin_rvv_vmacc_vv_tuma: |
12596 | case RISCVVector::BI__builtin_rvv_vmacc_vx_tuma: |
12597 | ID = Intrinsic::riscv_vmacc_mask; |
12598 | DefaultPolicy = 2; |
12599 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12600 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12601 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12602 | break; |
12603 | case RISCVVector::BI__builtin_rvv_vmacc_vv_tama: |
12604 | case RISCVVector::BI__builtin_rvv_vmacc_vx_tama: |
12605 | ID = Intrinsic::riscv_vmacc_mask; |
12606 | DefaultPolicy = 3; |
12607 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12608 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12609 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12610 | break; |
12611 | case RISCVVector::BI__builtin_rvv_vmacc_vv_tumu: |
12612 | case RISCVVector::BI__builtin_rvv_vmacc_vx_tumu: |
12613 | ID = Intrinsic::riscv_vmacc_mask; |
12614 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12615 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12616 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12617 | break; |
12618 | case RISCVVector::BI__builtin_rvv_vmacc_vv_tamu: |
12619 | case RISCVVector::BI__builtin_rvv_vmacc_vx_tamu: |
12620 | ID = Intrinsic::riscv_vmacc_mask; |
12621 | DefaultPolicy = 1; |
12622 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12623 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12624 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12625 | break; |
12626 | case RISCVVector::BI__builtin_rvv_vmadc_vv: |
12627 | case RISCVVector::BI__builtin_rvv_vmadc_vx: |
12628 | ID = Intrinsic::riscv_vmadc; |
12629 | DefaultPolicy = 1; |
12630 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
12631 | break; |
12632 | case RISCVVector::BI__builtin_rvv_vmadc_vvm: |
12633 | case RISCVVector::BI__builtin_rvv_vmadc_vxm: |
12634 | ID = Intrinsic::riscv_vmadc_carry_in; |
12635 | DefaultPolicy = 1; |
12636 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
12637 | break; |
12638 | case RISCVVector::BI__builtin_rvv_vmadd_vv_tu: |
12639 | case RISCVVector::BI__builtin_rvv_vmadd_vx_tu: |
12640 | ID = Intrinsic::riscv_vmadd; |
12641 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12642 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12643 | break; |
12644 | case RISCVVector::BI__builtin_rvv_vmadd_vv_ta: |
12645 | case RISCVVector::BI__builtin_rvv_vmadd_vx_ta: |
12646 | ID = Intrinsic::riscv_vmadd; |
12647 | DefaultPolicy = 1; |
12648 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12649 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12650 | break; |
12651 | case RISCVVector::BI__builtin_rvv_vmadd_vv_tuma: |
12652 | case RISCVVector::BI__builtin_rvv_vmadd_vx_tuma: |
12653 | ID = Intrinsic::riscv_vmadd_mask; |
12654 | DefaultPolicy = 2; |
12655 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12656 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12657 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12658 | break; |
12659 | case RISCVVector::BI__builtin_rvv_vmadd_vv_tama: |
12660 | case RISCVVector::BI__builtin_rvv_vmadd_vx_tama: |
12661 | ID = Intrinsic::riscv_vmadd_mask; |
12662 | DefaultPolicy = 3; |
12663 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12664 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12665 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12666 | break; |
12667 | case RISCVVector::BI__builtin_rvv_vmadd_vv_tumu: |
12668 | case RISCVVector::BI__builtin_rvv_vmadd_vx_tumu: |
12669 | ID = Intrinsic::riscv_vmadd_mask; |
12670 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12671 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12672 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12673 | break; |
12674 | case RISCVVector::BI__builtin_rvv_vmadd_vv_tamu: |
12675 | case RISCVVector::BI__builtin_rvv_vmadd_vx_tamu: |
12676 | ID = Intrinsic::riscv_vmadd_mask; |
12677 | DefaultPolicy = 1; |
12678 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12679 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12680 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
12681 | break; |
12682 | case RISCVVector::BI__builtin_rvv_vmmv_m: |
12683 | ID = Intrinsic::riscv_vmand; |
12684 | DefaultPolicy = 1; |
12685 | |
12686 | { |
12687 | // op1, vl |
12688 | IntrinsicTypes = {ResultType, |
12689 | Ops[1]->getType()}; |
12690 | Ops.insert(Ops.begin() + 1, Ops[0]); |
12691 | break; |
12692 | } |
12693 | break; |
12694 | case RISCVVector::BI__builtin_rvv_vmand_mm: |
12695 | ID = Intrinsic::riscv_vmand; |
12696 | DefaultPolicy = 1; |
12697 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
12698 | break; |
12699 | case RISCVVector::BI__builtin_rvv_vmandn_mm: |
12700 | ID = Intrinsic::riscv_vmandn; |
12701 | DefaultPolicy = 1; |
12702 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
12703 | break; |
12704 | case RISCVVector::BI__builtin_rvv_vmax_vv_tu: |
12705 | case RISCVVector::BI__builtin_rvv_vmax_vx_tu: |
12706 | ID = Intrinsic::riscv_vmax; |
12707 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12708 | break; |
12709 | case RISCVVector::BI__builtin_rvv_vmax_vv_ta: |
12710 | case RISCVVector::BI__builtin_rvv_vmax_vx_ta: |
12711 | ID = Intrinsic::riscv_vmax; |
12712 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12713 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12714 | break; |
12715 | case RISCVVector::BI__builtin_rvv_vmax_vv_tuma: |
12716 | case RISCVVector::BI__builtin_rvv_vmax_vx_tuma: |
12717 | ID = Intrinsic::riscv_vmax_mask; |
12718 | DefaultPolicy = 2; |
12719 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12720 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12721 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12722 | break; |
12723 | case RISCVVector::BI__builtin_rvv_vmax_vv_tama: |
12724 | case RISCVVector::BI__builtin_rvv_vmax_vx_tama: |
12725 | ID = Intrinsic::riscv_vmax_mask; |
12726 | DefaultPolicy = 3; |
12727 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12728 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12729 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12730 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12731 | break; |
12732 | case RISCVVector::BI__builtin_rvv_vmax_vv_tumu: |
12733 | case RISCVVector::BI__builtin_rvv_vmax_vx_tumu: |
12734 | ID = Intrinsic::riscv_vmax_mask; |
12735 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12736 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12737 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12738 | break; |
12739 | case RISCVVector::BI__builtin_rvv_vmax_vv_tamu: |
12740 | case RISCVVector::BI__builtin_rvv_vmax_vx_tamu: |
12741 | ID = Intrinsic::riscv_vmax_mask; |
12742 | DefaultPolicy = 1; |
12743 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12744 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12745 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12746 | break; |
12747 | case RISCVVector::BI__builtin_rvv_vmaxu_vv_tu: |
12748 | case RISCVVector::BI__builtin_rvv_vmaxu_vx_tu: |
12749 | ID = Intrinsic::riscv_vmaxu; |
12750 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12751 | break; |
12752 | case RISCVVector::BI__builtin_rvv_vmaxu_vv_ta: |
12753 | case RISCVVector::BI__builtin_rvv_vmaxu_vx_ta: |
12754 | ID = Intrinsic::riscv_vmaxu; |
12755 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12756 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12757 | break; |
12758 | case RISCVVector::BI__builtin_rvv_vmaxu_vv_tuma: |
12759 | case RISCVVector::BI__builtin_rvv_vmaxu_vx_tuma: |
12760 | ID = Intrinsic::riscv_vmaxu_mask; |
12761 | DefaultPolicy = 2; |
12762 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12763 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12764 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12765 | break; |
12766 | case RISCVVector::BI__builtin_rvv_vmaxu_vv_tama: |
12767 | case RISCVVector::BI__builtin_rvv_vmaxu_vx_tama: |
12768 | ID = Intrinsic::riscv_vmaxu_mask; |
12769 | DefaultPolicy = 3; |
12770 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12771 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12772 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12773 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12774 | break; |
12775 | case RISCVVector::BI__builtin_rvv_vmaxu_vv_tumu: |
12776 | case RISCVVector::BI__builtin_rvv_vmaxu_vx_tumu: |
12777 | ID = Intrinsic::riscv_vmaxu_mask; |
12778 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12779 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12780 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12781 | break; |
12782 | case RISCVVector::BI__builtin_rvv_vmaxu_vv_tamu: |
12783 | case RISCVVector::BI__builtin_rvv_vmaxu_vx_tamu: |
12784 | ID = Intrinsic::riscv_vmaxu_mask; |
12785 | DefaultPolicy = 1; |
12786 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12787 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12788 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12789 | break; |
12790 | case RISCVVector::BI__builtin_rvv_vmclr_m: |
12791 | ID = Intrinsic::riscv_vmclr; |
12792 | DefaultPolicy = 1; |
12793 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
12794 | break; |
12795 | case RISCVVector::BI__builtin_rvv_vmerge_vvm_tu: |
12796 | case RISCVVector::BI__builtin_rvv_vmerge_vxm_tu: |
12797 | ID = Intrinsic::riscv_vmerge; |
12798 | DefaultPolicy = 0; |
12799 | |
12800 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12801 | // insert poison passthru |
12802 | if (DefaultPolicy == TAIL_AGNOSTIC) |
12803 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
12804 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12805 | break; |
12806 | case RISCVVector::BI__builtin_rvv_vmerge_vvm_ta: |
12807 | case RISCVVector::BI__builtin_rvv_vmerge_vxm_ta: |
12808 | ID = Intrinsic::riscv_vmerge; |
12809 | DefaultPolicy = 1; |
12810 | |
12811 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12812 | // insert poison passthru |
12813 | if (DefaultPolicy == TAIL_AGNOSTIC) |
12814 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
12815 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12816 | break; |
12817 | case RISCVVector::BI__builtin_rvv_vmfeq_vv: |
12818 | case RISCVVector::BI__builtin_rvv_vmfeq_vf: |
12819 | ID = Intrinsic::riscv_vmfeq; |
12820 | DefaultPolicy = 1; |
12821 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
12822 | break; |
12823 | case RISCVVector::BI__builtin_rvv_vmfeq_vv_ma: |
12824 | case RISCVVector::BI__builtin_rvv_vmfeq_vf_ma: |
12825 | ID = Intrinsic::riscv_vmfeq_mask; |
12826 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12827 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12828 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12829 | break; |
12830 | case RISCVVector::BI__builtin_rvv_vmfeq_vv_tumu: |
12831 | case RISCVVector::BI__builtin_rvv_vmfeq_vf_tumu: |
12832 | ID = Intrinsic::riscv_vmfeq_mask; |
12833 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12834 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12835 | break; |
12836 | case RISCVVector::BI__builtin_rvv_vmfeq_vv_mu: |
12837 | case RISCVVector::BI__builtin_rvv_vmfeq_vf_mu: |
12838 | ID = Intrinsic::riscv_vmfeq_mask; |
12839 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12840 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12841 | break; |
12842 | case RISCVVector::BI__builtin_rvv_vmfge_vv: |
12843 | case RISCVVector::BI__builtin_rvv_vmfge_vf: |
12844 | ID = Intrinsic::riscv_vmfge; |
12845 | DefaultPolicy = 1; |
12846 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
12847 | break; |
12848 | case RISCVVector::BI__builtin_rvv_vmfge_vv_ma: |
12849 | case RISCVVector::BI__builtin_rvv_vmfge_vf_ma: |
12850 | ID = Intrinsic::riscv_vmfge_mask; |
12851 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12852 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12853 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12854 | break; |
12855 | case RISCVVector::BI__builtin_rvv_vmfge_vv_tumu: |
12856 | case RISCVVector::BI__builtin_rvv_vmfge_vf_tumu: |
12857 | ID = Intrinsic::riscv_vmfge_mask; |
12858 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12859 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12860 | break; |
12861 | case RISCVVector::BI__builtin_rvv_vmfge_vv_mu: |
12862 | case RISCVVector::BI__builtin_rvv_vmfge_vf_mu: |
12863 | ID = Intrinsic::riscv_vmfge_mask; |
12864 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12865 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12866 | break; |
12867 | case RISCVVector::BI__builtin_rvv_vmfgt_vv: |
12868 | case RISCVVector::BI__builtin_rvv_vmfgt_vf: |
12869 | ID = Intrinsic::riscv_vmfgt; |
12870 | DefaultPolicy = 1; |
Value stored to 'DefaultPolicy' is never read | |
12871 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
12872 | break; |
12873 | case RISCVVector::BI__builtin_rvv_vmfgt_vv_ma: |
12874 | case RISCVVector::BI__builtin_rvv_vmfgt_vf_ma: |
12875 | ID = Intrinsic::riscv_vmfgt_mask; |
12876 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12877 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12878 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12879 | break; |
12880 | case RISCVVector::BI__builtin_rvv_vmfgt_vv_tumu: |
12881 | case RISCVVector::BI__builtin_rvv_vmfgt_vf_tumu: |
12882 | ID = Intrinsic::riscv_vmfgt_mask; |
12883 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12884 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12885 | break; |
12886 | case RISCVVector::BI__builtin_rvv_vmfgt_vv_mu: |
12887 | case RISCVVector::BI__builtin_rvv_vmfgt_vf_mu: |
12888 | ID = Intrinsic::riscv_vmfgt_mask; |
12889 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12890 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12891 | break; |
12892 | case RISCVVector::BI__builtin_rvv_vmfle_vv: |
12893 | case RISCVVector::BI__builtin_rvv_vmfle_vf: |
12894 | ID = Intrinsic::riscv_vmfle; |
12895 | DefaultPolicy = 1; |
12896 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
12897 | break; |
12898 | case RISCVVector::BI__builtin_rvv_vmfle_vv_ma: |
12899 | case RISCVVector::BI__builtin_rvv_vmfle_vf_ma: |
12900 | ID = Intrinsic::riscv_vmfle_mask; |
12901 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12902 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12903 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12904 | break; |
12905 | case RISCVVector::BI__builtin_rvv_vmfle_vv_tumu: |
12906 | case RISCVVector::BI__builtin_rvv_vmfle_vf_tumu: |
12907 | ID = Intrinsic::riscv_vmfle_mask; |
12908 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12909 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12910 | break; |
12911 | case RISCVVector::BI__builtin_rvv_vmfle_vv_mu: |
12912 | case RISCVVector::BI__builtin_rvv_vmfle_vf_mu: |
12913 | ID = Intrinsic::riscv_vmfle_mask; |
12914 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12915 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12916 | break; |
12917 | case RISCVVector::BI__builtin_rvv_vmflt_vv: |
12918 | case RISCVVector::BI__builtin_rvv_vmflt_vf: |
12919 | ID = Intrinsic::riscv_vmflt; |
12920 | DefaultPolicy = 1; |
12921 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
12922 | break; |
12923 | case RISCVVector::BI__builtin_rvv_vmflt_vv_ma: |
12924 | case RISCVVector::BI__builtin_rvv_vmflt_vf_ma: |
12925 | ID = Intrinsic::riscv_vmflt_mask; |
12926 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12927 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12928 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12929 | break; |
12930 | case RISCVVector::BI__builtin_rvv_vmflt_vv_tumu: |
12931 | case RISCVVector::BI__builtin_rvv_vmflt_vf_tumu: |
12932 | ID = Intrinsic::riscv_vmflt_mask; |
12933 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12934 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12935 | break; |
12936 | case RISCVVector::BI__builtin_rvv_vmflt_vv_mu: |
12937 | case RISCVVector::BI__builtin_rvv_vmflt_vf_mu: |
12938 | ID = Intrinsic::riscv_vmflt_mask; |
12939 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12940 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12941 | break; |
12942 | case RISCVVector::BI__builtin_rvv_vmfne_vv: |
12943 | case RISCVVector::BI__builtin_rvv_vmfne_vf: |
12944 | ID = Intrinsic::riscv_vmfne; |
12945 | DefaultPolicy = 1; |
12946 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
12947 | break; |
12948 | case RISCVVector::BI__builtin_rvv_vmfne_vv_ma: |
12949 | case RISCVVector::BI__builtin_rvv_vmfne_vf_ma: |
12950 | ID = Intrinsic::riscv_vmfne_mask; |
12951 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12952 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12953 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12954 | break; |
12955 | case RISCVVector::BI__builtin_rvv_vmfne_vv_tumu: |
12956 | case RISCVVector::BI__builtin_rvv_vmfne_vf_tumu: |
12957 | ID = Intrinsic::riscv_vmfne_mask; |
12958 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12959 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12960 | break; |
12961 | case RISCVVector::BI__builtin_rvv_vmfne_vv_mu: |
12962 | case RISCVVector::BI__builtin_rvv_vmfne_vf_mu: |
12963 | ID = Intrinsic::riscv_vmfne_mask; |
12964 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12965 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
12966 | break; |
12967 | case RISCVVector::BI__builtin_rvv_vmin_vv_tu: |
12968 | case RISCVVector::BI__builtin_rvv_vmin_vx_tu: |
12969 | ID = Intrinsic::riscv_vmin; |
12970 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12971 | break; |
12972 | case RISCVVector::BI__builtin_rvv_vmin_vv_ta: |
12973 | case RISCVVector::BI__builtin_rvv_vmin_vx_ta: |
12974 | ID = Intrinsic::riscv_vmin; |
12975 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12976 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12977 | break; |
12978 | case RISCVVector::BI__builtin_rvv_vmin_vv_tuma: |
12979 | case RISCVVector::BI__builtin_rvv_vmin_vx_tuma: |
12980 | ID = Intrinsic::riscv_vmin_mask; |
12981 | DefaultPolicy = 2; |
12982 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12983 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12984 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12985 | break; |
12986 | case RISCVVector::BI__builtin_rvv_vmin_vv_tama: |
12987 | case RISCVVector::BI__builtin_rvv_vmin_vx_tama: |
12988 | ID = Intrinsic::riscv_vmin_mask; |
12989 | DefaultPolicy = 3; |
12990 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12991 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
12992 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
12993 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
12994 | break; |
12995 | case RISCVVector::BI__builtin_rvv_vmin_vv_tumu: |
12996 | case RISCVVector::BI__builtin_rvv_vmin_vx_tumu: |
12997 | ID = Intrinsic::riscv_vmin_mask; |
12998 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
12999 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13000 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13001 | break; |
13002 | case RISCVVector::BI__builtin_rvv_vmin_vv_tamu: |
13003 | case RISCVVector::BI__builtin_rvv_vmin_vx_tamu: |
13004 | ID = Intrinsic::riscv_vmin_mask; |
13005 | DefaultPolicy = 1; |
13006 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13007 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13008 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13009 | break; |
13010 | case RISCVVector::BI__builtin_rvv_vminu_vv_tu: |
13011 | case RISCVVector::BI__builtin_rvv_vminu_vx_tu: |
13012 | ID = Intrinsic::riscv_vminu; |
13013 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13014 | break; |
13015 | case RISCVVector::BI__builtin_rvv_vminu_vv_ta: |
13016 | case RISCVVector::BI__builtin_rvv_vminu_vx_ta: |
13017 | ID = Intrinsic::riscv_vminu; |
13018 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13019 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13020 | break; |
13021 | case RISCVVector::BI__builtin_rvv_vminu_vv_tuma: |
13022 | case RISCVVector::BI__builtin_rvv_vminu_vx_tuma: |
13023 | ID = Intrinsic::riscv_vminu_mask; |
13024 | DefaultPolicy = 2; |
13025 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13026 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13027 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13028 | break; |
13029 | case RISCVVector::BI__builtin_rvv_vminu_vv_tama: |
13030 | case RISCVVector::BI__builtin_rvv_vminu_vx_tama: |
13031 | ID = Intrinsic::riscv_vminu_mask; |
13032 | DefaultPolicy = 3; |
13033 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13034 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13035 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13036 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13037 | break; |
13038 | case RISCVVector::BI__builtin_rvv_vminu_vv_tumu: |
13039 | case RISCVVector::BI__builtin_rvv_vminu_vx_tumu: |
13040 | ID = Intrinsic::riscv_vminu_mask; |
13041 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13042 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13043 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13044 | break; |
13045 | case RISCVVector::BI__builtin_rvv_vminu_vv_tamu: |
13046 | case RISCVVector::BI__builtin_rvv_vminu_vx_tamu: |
13047 | ID = Intrinsic::riscv_vminu_mask; |
13048 | DefaultPolicy = 1; |
13049 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13050 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13051 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13052 | break; |
13053 | case RISCVVector::BI__builtin_rvv_vmnot_m: |
13054 | ID = Intrinsic::riscv_vmnand; |
13055 | DefaultPolicy = 1; |
13056 | |
13057 | { |
13058 | // op1, vl |
13059 | IntrinsicTypes = {ResultType, |
13060 | Ops[1]->getType()}; |
13061 | Ops.insert(Ops.begin() + 1, Ops[0]); |
13062 | break; |
13063 | } |
13064 | break; |
13065 | case RISCVVector::BI__builtin_rvv_vmnand_mm: |
13066 | ID = Intrinsic::riscv_vmnand; |
13067 | DefaultPolicy = 1; |
13068 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13069 | break; |
13070 | case RISCVVector::BI__builtin_rvv_vmnor_mm: |
13071 | ID = Intrinsic::riscv_vmnor; |
13072 | DefaultPolicy = 1; |
13073 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13074 | break; |
13075 | case RISCVVector::BI__builtin_rvv_vmor_mm: |
13076 | ID = Intrinsic::riscv_vmor; |
13077 | DefaultPolicy = 1; |
13078 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13079 | break; |
13080 | case RISCVVector::BI__builtin_rvv_vmorn_mm: |
13081 | ID = Intrinsic::riscv_vmorn; |
13082 | DefaultPolicy = 1; |
13083 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13084 | break; |
13085 | case RISCVVector::BI__builtin_rvv_vmsbc_vv: |
13086 | case RISCVVector::BI__builtin_rvv_vmsbc_vx: |
13087 | ID = Intrinsic::riscv_vmsbc; |
13088 | DefaultPolicy = 1; |
13089 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13090 | break; |
13091 | case RISCVVector::BI__builtin_rvv_vmsbc_vvm: |
13092 | case RISCVVector::BI__builtin_rvv_vmsbc_vxm: |
13093 | ID = Intrinsic::riscv_vmsbc_borrow_in; |
13094 | DefaultPolicy = 1; |
13095 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13096 | break; |
13097 | case RISCVVector::BI__builtin_rvv_vmsbf_m: |
13098 | ID = Intrinsic::riscv_vmsbf; |
13099 | DefaultPolicy = 1; |
13100 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13101 | break; |
13102 | case RISCVVector::BI__builtin_rvv_vmsbf_m_ma: |
13103 | ID = Intrinsic::riscv_vmsbf_mask; |
13104 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13105 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13106 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13107 | break; |
13108 | case RISCVVector::BI__builtin_rvv_vmsbf_m_tumu: |
13109 | ID = Intrinsic::riscv_vmsbf_mask; |
13110 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13111 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13112 | break; |
13113 | case RISCVVector::BI__builtin_rvv_vmsbf_m_mu: |
13114 | ID = Intrinsic::riscv_vmsbf_mask; |
13115 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13116 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13117 | break; |
13118 | case RISCVVector::BI__builtin_rvv_vmseq_vv: |
13119 | case RISCVVector::BI__builtin_rvv_vmseq_vx: |
13120 | ID = Intrinsic::riscv_vmseq; |
13121 | DefaultPolicy = 1; |
13122 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13123 | break; |
13124 | case RISCVVector::BI__builtin_rvv_vmseq_vv_ma: |
13125 | case RISCVVector::BI__builtin_rvv_vmseq_vx_ma: |
13126 | ID = Intrinsic::riscv_vmseq_mask; |
13127 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13128 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13129 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13130 | break; |
13131 | case RISCVVector::BI__builtin_rvv_vmseq_vv_tumu: |
13132 | case RISCVVector::BI__builtin_rvv_vmseq_vx_tumu: |
13133 | ID = Intrinsic::riscv_vmseq_mask; |
13134 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13135 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13136 | break; |
13137 | case RISCVVector::BI__builtin_rvv_vmseq_vv_mu: |
13138 | case RISCVVector::BI__builtin_rvv_vmseq_vx_mu: |
13139 | ID = Intrinsic::riscv_vmseq_mask; |
13140 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13141 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13142 | break; |
13143 | case RISCVVector::BI__builtin_rvv_vmset_m: |
13144 | ID = Intrinsic::riscv_vmset; |
13145 | DefaultPolicy = 1; |
13146 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13147 | break; |
13148 | case RISCVVector::BI__builtin_rvv_vmsge_vv: |
13149 | case RISCVVector::BI__builtin_rvv_vmsge_vx: |
13150 | ID = Intrinsic::riscv_vmsge; |
13151 | DefaultPolicy = 1; |
13152 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13153 | break; |
13154 | case RISCVVector::BI__builtin_rvv_vmsge_vv_ma: |
13155 | case RISCVVector::BI__builtin_rvv_vmsge_vx_ma: |
13156 | ID = Intrinsic::riscv_vmsge_mask; |
13157 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13158 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13159 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13160 | break; |
13161 | case RISCVVector::BI__builtin_rvv_vmsge_vv_tumu: |
13162 | case RISCVVector::BI__builtin_rvv_vmsge_vx_tumu: |
13163 | ID = Intrinsic::riscv_vmsge_mask; |
13164 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13165 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13166 | break; |
13167 | case RISCVVector::BI__builtin_rvv_vmsge_vv_mu: |
13168 | case RISCVVector::BI__builtin_rvv_vmsge_vx_mu: |
13169 | ID = Intrinsic::riscv_vmsge_mask; |
13170 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13171 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13172 | break; |
13173 | case RISCVVector::BI__builtin_rvv_vmsgeu_vv: |
13174 | case RISCVVector::BI__builtin_rvv_vmsgeu_vx: |
13175 | ID = Intrinsic::riscv_vmsgeu; |
13176 | DefaultPolicy = 1; |
13177 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13178 | break; |
13179 | case RISCVVector::BI__builtin_rvv_vmsgeu_vv_ma: |
13180 | case RISCVVector::BI__builtin_rvv_vmsgeu_vx_ma: |
13181 | ID = Intrinsic::riscv_vmsgeu_mask; |
13182 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13183 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13184 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13185 | break; |
13186 | case RISCVVector::BI__builtin_rvv_vmsgeu_vv_tumu: |
13187 | case RISCVVector::BI__builtin_rvv_vmsgeu_vx_tumu: |
13188 | ID = Intrinsic::riscv_vmsgeu_mask; |
13189 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13190 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13191 | break; |
13192 | case RISCVVector::BI__builtin_rvv_vmsgeu_vv_mu: |
13193 | case RISCVVector::BI__builtin_rvv_vmsgeu_vx_mu: |
13194 | ID = Intrinsic::riscv_vmsgeu_mask; |
13195 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13196 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13197 | break; |
13198 | case RISCVVector::BI__builtin_rvv_vmsgt_vv: |
13199 | case RISCVVector::BI__builtin_rvv_vmsgt_vx: |
13200 | ID = Intrinsic::riscv_vmsgt; |
13201 | DefaultPolicy = 1; |
13202 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13203 | break; |
13204 | case RISCVVector::BI__builtin_rvv_vmsgt_vv_ma: |
13205 | case RISCVVector::BI__builtin_rvv_vmsgt_vx_ma: |
13206 | ID = Intrinsic::riscv_vmsgt_mask; |
13207 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13208 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13209 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13210 | break; |
13211 | case RISCVVector::BI__builtin_rvv_vmsgt_vv_tumu: |
13212 | case RISCVVector::BI__builtin_rvv_vmsgt_vx_tumu: |
13213 | ID = Intrinsic::riscv_vmsgt_mask; |
13214 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13215 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13216 | break; |
13217 | case RISCVVector::BI__builtin_rvv_vmsgt_vv_mu: |
13218 | case RISCVVector::BI__builtin_rvv_vmsgt_vx_mu: |
13219 | ID = Intrinsic::riscv_vmsgt_mask; |
13220 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13221 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13222 | break; |
13223 | case RISCVVector::BI__builtin_rvv_vmsgtu_vv: |
13224 | case RISCVVector::BI__builtin_rvv_vmsgtu_vx: |
13225 | ID = Intrinsic::riscv_vmsgtu; |
13226 | DefaultPolicy = 1; |
13227 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13228 | break; |
13229 | case RISCVVector::BI__builtin_rvv_vmsgtu_vv_ma: |
13230 | case RISCVVector::BI__builtin_rvv_vmsgtu_vx_ma: |
13231 | ID = Intrinsic::riscv_vmsgtu_mask; |
13232 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13233 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13234 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13235 | break; |
13236 | case RISCVVector::BI__builtin_rvv_vmsgtu_vv_tumu: |
13237 | case RISCVVector::BI__builtin_rvv_vmsgtu_vx_tumu: |
13238 | ID = Intrinsic::riscv_vmsgtu_mask; |
13239 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13240 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13241 | break; |
13242 | case RISCVVector::BI__builtin_rvv_vmsgtu_vv_mu: |
13243 | case RISCVVector::BI__builtin_rvv_vmsgtu_vx_mu: |
13244 | ID = Intrinsic::riscv_vmsgtu_mask; |
13245 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13246 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13247 | break; |
13248 | case RISCVVector::BI__builtin_rvv_vmsif_m: |
13249 | ID = Intrinsic::riscv_vmsif; |
13250 | DefaultPolicy = 1; |
13251 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13252 | break; |
13253 | case RISCVVector::BI__builtin_rvv_vmsif_m_ma: |
13254 | ID = Intrinsic::riscv_vmsif_mask; |
13255 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13256 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13257 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13258 | break; |
13259 | case RISCVVector::BI__builtin_rvv_vmsif_m_tumu: |
13260 | ID = Intrinsic::riscv_vmsif_mask; |
13261 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13262 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13263 | break; |
13264 | case RISCVVector::BI__builtin_rvv_vmsif_m_mu: |
13265 | ID = Intrinsic::riscv_vmsif_mask; |
13266 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13267 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13268 | break; |
13269 | case RISCVVector::BI__builtin_rvv_vmsle_vv: |
13270 | case RISCVVector::BI__builtin_rvv_vmsle_vx: |
13271 | ID = Intrinsic::riscv_vmsle; |
13272 | DefaultPolicy = 1; |
13273 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13274 | break; |
13275 | case RISCVVector::BI__builtin_rvv_vmsle_vv_ma: |
13276 | case RISCVVector::BI__builtin_rvv_vmsle_vx_ma: |
13277 | ID = Intrinsic::riscv_vmsle_mask; |
13278 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13279 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13280 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13281 | break; |
13282 | case RISCVVector::BI__builtin_rvv_vmsle_vv_tumu: |
13283 | case RISCVVector::BI__builtin_rvv_vmsle_vx_tumu: |
13284 | ID = Intrinsic::riscv_vmsle_mask; |
13285 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13286 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13287 | break; |
13288 | case RISCVVector::BI__builtin_rvv_vmsle_vv_mu: |
13289 | case RISCVVector::BI__builtin_rvv_vmsle_vx_mu: |
13290 | ID = Intrinsic::riscv_vmsle_mask; |
13291 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13292 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13293 | break; |
13294 | case RISCVVector::BI__builtin_rvv_vmsleu_vv: |
13295 | case RISCVVector::BI__builtin_rvv_vmsleu_vx: |
13296 | ID = Intrinsic::riscv_vmsleu; |
13297 | DefaultPolicy = 1; |
13298 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13299 | break; |
13300 | case RISCVVector::BI__builtin_rvv_vmsleu_vv_ma: |
13301 | case RISCVVector::BI__builtin_rvv_vmsleu_vx_ma: |
13302 | ID = Intrinsic::riscv_vmsleu_mask; |
13303 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13304 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13305 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13306 | break; |
13307 | case RISCVVector::BI__builtin_rvv_vmsleu_vv_tumu: |
13308 | case RISCVVector::BI__builtin_rvv_vmsleu_vx_tumu: |
13309 | ID = Intrinsic::riscv_vmsleu_mask; |
13310 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13311 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13312 | break; |
13313 | case RISCVVector::BI__builtin_rvv_vmsleu_vv_mu: |
13314 | case RISCVVector::BI__builtin_rvv_vmsleu_vx_mu: |
13315 | ID = Intrinsic::riscv_vmsleu_mask; |
13316 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13317 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13318 | break; |
13319 | case RISCVVector::BI__builtin_rvv_vmslt_vv: |
13320 | case RISCVVector::BI__builtin_rvv_vmslt_vx: |
13321 | ID = Intrinsic::riscv_vmslt; |
13322 | DefaultPolicy = 1; |
13323 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13324 | break; |
13325 | case RISCVVector::BI__builtin_rvv_vmslt_vv_ma: |
13326 | case RISCVVector::BI__builtin_rvv_vmslt_vx_ma: |
13327 | ID = Intrinsic::riscv_vmslt_mask; |
13328 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13329 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13330 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13331 | break; |
13332 | case RISCVVector::BI__builtin_rvv_vmslt_vv_tumu: |
13333 | case RISCVVector::BI__builtin_rvv_vmslt_vx_tumu: |
13334 | ID = Intrinsic::riscv_vmslt_mask; |
13335 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13336 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13337 | break; |
13338 | case RISCVVector::BI__builtin_rvv_vmslt_vv_mu: |
13339 | case RISCVVector::BI__builtin_rvv_vmslt_vx_mu: |
13340 | ID = Intrinsic::riscv_vmslt_mask; |
13341 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13342 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13343 | break; |
13344 | case RISCVVector::BI__builtin_rvv_vmsltu_vv: |
13345 | case RISCVVector::BI__builtin_rvv_vmsltu_vx: |
13346 | ID = Intrinsic::riscv_vmsltu; |
13347 | DefaultPolicy = 1; |
13348 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13349 | break; |
13350 | case RISCVVector::BI__builtin_rvv_vmsltu_vv_ma: |
13351 | case RISCVVector::BI__builtin_rvv_vmsltu_vx_ma: |
13352 | ID = Intrinsic::riscv_vmsltu_mask; |
13353 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13354 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13355 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13356 | break; |
13357 | case RISCVVector::BI__builtin_rvv_vmsltu_vv_tumu: |
13358 | case RISCVVector::BI__builtin_rvv_vmsltu_vx_tumu: |
13359 | ID = Intrinsic::riscv_vmsltu_mask; |
13360 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13361 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13362 | break; |
13363 | case RISCVVector::BI__builtin_rvv_vmsltu_vv_mu: |
13364 | case RISCVVector::BI__builtin_rvv_vmsltu_vx_mu: |
13365 | ID = Intrinsic::riscv_vmsltu_mask; |
13366 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13367 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13368 | break; |
13369 | case RISCVVector::BI__builtin_rvv_vmsne_vv: |
13370 | case RISCVVector::BI__builtin_rvv_vmsne_vx: |
13371 | ID = Intrinsic::riscv_vmsne; |
13372 | DefaultPolicy = 1; |
13373 | IntrinsicTypes = {Ops[0]->getType(), Ops[1]->getType(), Ops.back()->getType()}; |
13374 | break; |
13375 | case RISCVVector::BI__builtin_rvv_vmsne_vv_ma: |
13376 | case RISCVVector::BI__builtin_rvv_vmsne_vx_ma: |
13377 | ID = Intrinsic::riscv_vmsne_mask; |
13378 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13379 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13380 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13381 | break; |
13382 | case RISCVVector::BI__builtin_rvv_vmsne_vv_tumu: |
13383 | case RISCVVector::BI__builtin_rvv_vmsne_vx_tumu: |
13384 | ID = Intrinsic::riscv_vmsne_mask; |
13385 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13386 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13387 | break; |
13388 | case RISCVVector::BI__builtin_rvv_vmsne_vv_mu: |
13389 | case RISCVVector::BI__builtin_rvv_vmsne_vx_mu: |
13390 | ID = Intrinsic::riscv_vmsne_mask; |
13391 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13392 | IntrinsicTypes = {Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13393 | break; |
13394 | case RISCVVector::BI__builtin_rvv_vmsof_m: |
13395 | ID = Intrinsic::riscv_vmsof; |
13396 | DefaultPolicy = 1; |
13397 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13398 | break; |
13399 | case RISCVVector::BI__builtin_rvv_vmsof_m_ma: |
13400 | ID = Intrinsic::riscv_vmsof_mask; |
13401 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13402 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13403 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13404 | break; |
13405 | case RISCVVector::BI__builtin_rvv_vmsof_m_tumu: |
13406 | ID = Intrinsic::riscv_vmsof_mask; |
13407 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13408 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13409 | break; |
13410 | case RISCVVector::BI__builtin_rvv_vmsof_m_mu: |
13411 | ID = Intrinsic::riscv_vmsof_mask; |
13412 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13413 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13414 | break; |
13415 | case RISCVVector::BI__builtin_rvv_vmul_vv_tu: |
13416 | case RISCVVector::BI__builtin_rvv_vmul_vx_tu: |
13417 | ID = Intrinsic::riscv_vmul; |
13418 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13419 | break; |
13420 | case RISCVVector::BI__builtin_rvv_vmul_vv_ta: |
13421 | case RISCVVector::BI__builtin_rvv_vmul_vx_ta: |
13422 | ID = Intrinsic::riscv_vmul; |
13423 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13424 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13425 | break; |
13426 | case RISCVVector::BI__builtin_rvv_vmul_vv_tuma: |
13427 | case RISCVVector::BI__builtin_rvv_vmul_vx_tuma: |
13428 | ID = Intrinsic::riscv_vmul_mask; |
13429 | DefaultPolicy = 2; |
13430 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13431 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13432 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13433 | break; |
13434 | case RISCVVector::BI__builtin_rvv_vmul_vv_tama: |
13435 | case RISCVVector::BI__builtin_rvv_vmul_vx_tama: |
13436 | ID = Intrinsic::riscv_vmul_mask; |
13437 | DefaultPolicy = 3; |
13438 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13439 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13440 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13441 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13442 | break; |
13443 | case RISCVVector::BI__builtin_rvv_vmul_vv_tumu: |
13444 | case RISCVVector::BI__builtin_rvv_vmul_vx_tumu: |
13445 | ID = Intrinsic::riscv_vmul_mask; |
13446 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13447 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13448 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13449 | break; |
13450 | case RISCVVector::BI__builtin_rvv_vmul_vv_tamu: |
13451 | case RISCVVector::BI__builtin_rvv_vmul_vx_tamu: |
13452 | ID = Intrinsic::riscv_vmul_mask; |
13453 | DefaultPolicy = 1; |
13454 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13455 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13456 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13457 | break; |
13458 | case RISCVVector::BI__builtin_rvv_vmulh_vv_tu: |
13459 | case RISCVVector::BI__builtin_rvv_vmulh_vx_tu: |
13460 | ID = Intrinsic::riscv_vmulh; |
13461 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13462 | break; |
13463 | case RISCVVector::BI__builtin_rvv_vmulh_vv_ta: |
13464 | case RISCVVector::BI__builtin_rvv_vmulh_vx_ta: |
13465 | ID = Intrinsic::riscv_vmulh; |
13466 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13467 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13468 | break; |
13469 | case RISCVVector::BI__builtin_rvv_vmulh_vv_tuma: |
13470 | case RISCVVector::BI__builtin_rvv_vmulh_vx_tuma: |
13471 | ID = Intrinsic::riscv_vmulh_mask; |
13472 | DefaultPolicy = 2; |
13473 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13474 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13475 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13476 | break; |
13477 | case RISCVVector::BI__builtin_rvv_vmulh_vv_tama: |
13478 | case RISCVVector::BI__builtin_rvv_vmulh_vx_tama: |
13479 | ID = Intrinsic::riscv_vmulh_mask; |
13480 | DefaultPolicy = 3; |
13481 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13482 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13483 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13484 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13485 | break; |
13486 | case RISCVVector::BI__builtin_rvv_vmulh_vv_tumu: |
13487 | case RISCVVector::BI__builtin_rvv_vmulh_vx_tumu: |
13488 | ID = Intrinsic::riscv_vmulh_mask; |
13489 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13490 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13491 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13492 | break; |
13493 | case RISCVVector::BI__builtin_rvv_vmulh_vv_tamu: |
13494 | case RISCVVector::BI__builtin_rvv_vmulh_vx_tamu: |
13495 | ID = Intrinsic::riscv_vmulh_mask; |
13496 | DefaultPolicy = 1; |
13497 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13498 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13499 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13500 | break; |
13501 | case RISCVVector::BI__builtin_rvv_vmulhsu_vv_tu: |
13502 | case RISCVVector::BI__builtin_rvv_vmulhsu_vx_tu: |
13503 | ID = Intrinsic::riscv_vmulhsu; |
13504 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13505 | break; |
13506 | case RISCVVector::BI__builtin_rvv_vmulhsu_vv_ta: |
13507 | case RISCVVector::BI__builtin_rvv_vmulhsu_vx_ta: |
13508 | ID = Intrinsic::riscv_vmulhsu; |
13509 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13510 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13511 | break; |
13512 | case RISCVVector::BI__builtin_rvv_vmulhsu_vv_tuma: |
13513 | case RISCVVector::BI__builtin_rvv_vmulhsu_vx_tuma: |
13514 | ID = Intrinsic::riscv_vmulhsu_mask; |
13515 | DefaultPolicy = 2; |
13516 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13517 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13518 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13519 | break; |
13520 | case RISCVVector::BI__builtin_rvv_vmulhsu_vv_tama: |
13521 | case RISCVVector::BI__builtin_rvv_vmulhsu_vx_tama: |
13522 | ID = Intrinsic::riscv_vmulhsu_mask; |
13523 | DefaultPolicy = 3; |
13524 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13525 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13526 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13527 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13528 | break; |
13529 | case RISCVVector::BI__builtin_rvv_vmulhsu_vv_tumu: |
13530 | case RISCVVector::BI__builtin_rvv_vmulhsu_vx_tumu: |
13531 | ID = Intrinsic::riscv_vmulhsu_mask; |
13532 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13533 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13534 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13535 | break; |
13536 | case RISCVVector::BI__builtin_rvv_vmulhsu_vv_tamu: |
13537 | case RISCVVector::BI__builtin_rvv_vmulhsu_vx_tamu: |
13538 | ID = Intrinsic::riscv_vmulhsu_mask; |
13539 | DefaultPolicy = 1; |
13540 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13541 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13542 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13543 | break; |
13544 | case RISCVVector::BI__builtin_rvv_vmulhu_vv_tu: |
13545 | case RISCVVector::BI__builtin_rvv_vmulhu_vx_tu: |
13546 | ID = Intrinsic::riscv_vmulhu; |
13547 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13548 | break; |
13549 | case RISCVVector::BI__builtin_rvv_vmulhu_vv_ta: |
13550 | case RISCVVector::BI__builtin_rvv_vmulhu_vx_ta: |
13551 | ID = Intrinsic::riscv_vmulhu; |
13552 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13553 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13554 | break; |
13555 | case RISCVVector::BI__builtin_rvv_vmulhu_vv_tuma: |
13556 | case RISCVVector::BI__builtin_rvv_vmulhu_vx_tuma: |
13557 | ID = Intrinsic::riscv_vmulhu_mask; |
13558 | DefaultPolicy = 2; |
13559 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13560 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13561 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13562 | break; |
13563 | case RISCVVector::BI__builtin_rvv_vmulhu_vv_tama: |
13564 | case RISCVVector::BI__builtin_rvv_vmulhu_vx_tama: |
13565 | ID = Intrinsic::riscv_vmulhu_mask; |
13566 | DefaultPolicy = 3; |
13567 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13568 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13569 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13570 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13571 | break; |
13572 | case RISCVVector::BI__builtin_rvv_vmulhu_vv_tumu: |
13573 | case RISCVVector::BI__builtin_rvv_vmulhu_vx_tumu: |
13574 | ID = Intrinsic::riscv_vmulhu_mask; |
13575 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13576 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13577 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13578 | break; |
13579 | case RISCVVector::BI__builtin_rvv_vmulhu_vv_tamu: |
13580 | case RISCVVector::BI__builtin_rvv_vmulhu_vx_tamu: |
13581 | ID = Intrinsic::riscv_vmulhu_mask; |
13582 | DefaultPolicy = 1; |
13583 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13584 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13585 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13586 | break; |
13587 | case RISCVVector::BI__builtin_rvv_vmv_s_x_tu: |
13588 | ID = Intrinsic::riscv_vmv_s_x; |
13589 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13590 | break; |
13591 | case RISCVVector::BI__builtin_rvv_vmv_s_x_ta: |
13592 | ID = Intrinsic::riscv_vmv_s_x; |
13593 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13594 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13595 | break; |
13596 | case RISCVVector::BI__builtin_rvv_vmv_v_v_tu: |
13597 | ID = Intrinsic::riscv_vmv_v_v; |
13598 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13599 | break; |
13600 | case RISCVVector::BI__builtin_rvv_vmv_v_v_ta: |
13601 | ID = Intrinsic::riscv_vmv_v_v; |
13602 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13603 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13604 | break; |
13605 | case RISCVVector::BI__builtin_rvv_vmv_v_x_tu: |
13606 | ID = Intrinsic::riscv_vmv_v_x; |
13607 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13608 | break; |
13609 | case RISCVVector::BI__builtin_rvv_vmv_v_x_ta: |
13610 | ID = Intrinsic::riscv_vmv_v_x; |
13611 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13612 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13613 | break; |
13614 | case RISCVVector::BI__builtin_rvv_vmv_x_s: |
13615 | ID = Intrinsic::riscv_vmv_x_s; |
13616 | IntrinsicTypes = {Ops[0]->getType()}; |
13617 | break; |
13618 | case RISCVVector::BI__builtin_rvv_vmxnor_mm: |
13619 | ID = Intrinsic::riscv_vmxnor; |
13620 | DefaultPolicy = 1; |
13621 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13622 | break; |
13623 | case RISCVVector::BI__builtin_rvv_vmxor_mm: |
13624 | ID = Intrinsic::riscv_vmxor; |
13625 | DefaultPolicy = 1; |
13626 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
13627 | break; |
13628 | case RISCVVector::BI__builtin_rvv_vnclip_wv_tu: |
13629 | case RISCVVector::BI__builtin_rvv_vnclip_wx_tu: |
13630 | ID = Intrinsic::riscv_vnclip; |
13631 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13632 | break; |
13633 | case RISCVVector::BI__builtin_rvv_vnclip_wv_ta: |
13634 | case RISCVVector::BI__builtin_rvv_vnclip_wx_ta: |
13635 | ID = Intrinsic::riscv_vnclip; |
13636 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13637 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13638 | break; |
13639 | case RISCVVector::BI__builtin_rvv_vnclip_wv_tuma: |
13640 | case RISCVVector::BI__builtin_rvv_vnclip_wx_tuma: |
13641 | ID = Intrinsic::riscv_vnclip_mask; |
13642 | DefaultPolicy = 2; |
13643 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13644 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13645 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13646 | break; |
13647 | case RISCVVector::BI__builtin_rvv_vnclip_wv_tama: |
13648 | case RISCVVector::BI__builtin_rvv_vnclip_wx_tama: |
13649 | ID = Intrinsic::riscv_vnclip_mask; |
13650 | DefaultPolicy = 3; |
13651 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13652 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13653 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13654 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13655 | break; |
13656 | case RISCVVector::BI__builtin_rvv_vnclip_wv_tumu: |
13657 | case RISCVVector::BI__builtin_rvv_vnclip_wx_tumu: |
13658 | ID = Intrinsic::riscv_vnclip_mask; |
13659 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13660 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13661 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13662 | break; |
13663 | case RISCVVector::BI__builtin_rvv_vnclip_wv_tamu: |
13664 | case RISCVVector::BI__builtin_rvv_vnclip_wx_tamu: |
13665 | ID = Intrinsic::riscv_vnclip_mask; |
13666 | DefaultPolicy = 1; |
13667 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13668 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13669 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13670 | break; |
13671 | case RISCVVector::BI__builtin_rvv_vnclipu_wv_tu: |
13672 | case RISCVVector::BI__builtin_rvv_vnclipu_wx_tu: |
13673 | ID = Intrinsic::riscv_vnclipu; |
13674 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13675 | break; |
13676 | case RISCVVector::BI__builtin_rvv_vnclipu_wv_ta: |
13677 | case RISCVVector::BI__builtin_rvv_vnclipu_wx_ta: |
13678 | ID = Intrinsic::riscv_vnclipu; |
13679 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13680 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13681 | break; |
13682 | case RISCVVector::BI__builtin_rvv_vnclipu_wv_tuma: |
13683 | case RISCVVector::BI__builtin_rvv_vnclipu_wx_tuma: |
13684 | ID = Intrinsic::riscv_vnclipu_mask; |
13685 | DefaultPolicy = 2; |
13686 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13687 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13688 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13689 | break; |
13690 | case RISCVVector::BI__builtin_rvv_vnclipu_wv_tama: |
13691 | case RISCVVector::BI__builtin_rvv_vnclipu_wx_tama: |
13692 | ID = Intrinsic::riscv_vnclipu_mask; |
13693 | DefaultPolicy = 3; |
13694 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13695 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13696 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13697 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13698 | break; |
13699 | case RISCVVector::BI__builtin_rvv_vnclipu_wv_tumu: |
13700 | case RISCVVector::BI__builtin_rvv_vnclipu_wx_tumu: |
13701 | ID = Intrinsic::riscv_vnclipu_mask; |
13702 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13703 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13704 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13705 | break; |
13706 | case RISCVVector::BI__builtin_rvv_vnclipu_wv_tamu: |
13707 | case RISCVVector::BI__builtin_rvv_vnclipu_wx_tamu: |
13708 | ID = Intrinsic::riscv_vnclipu_mask; |
13709 | DefaultPolicy = 1; |
13710 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13711 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13712 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13713 | break; |
13714 | case RISCVVector::BI__builtin_rvv_vnmsac_vv_tu: |
13715 | case RISCVVector::BI__builtin_rvv_vnmsac_vx_tu: |
13716 | ID = Intrinsic::riscv_vnmsac; |
13717 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13718 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13719 | break; |
13720 | case RISCVVector::BI__builtin_rvv_vnmsac_vv_ta: |
13721 | case RISCVVector::BI__builtin_rvv_vnmsac_vx_ta: |
13722 | ID = Intrinsic::riscv_vnmsac; |
13723 | DefaultPolicy = 1; |
13724 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13725 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13726 | break; |
13727 | case RISCVVector::BI__builtin_rvv_vnmsac_vv_tuma: |
13728 | case RISCVVector::BI__builtin_rvv_vnmsac_vx_tuma: |
13729 | ID = Intrinsic::riscv_vnmsac_mask; |
13730 | DefaultPolicy = 2; |
13731 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13732 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13733 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13734 | break; |
13735 | case RISCVVector::BI__builtin_rvv_vnmsac_vv_tama: |
13736 | case RISCVVector::BI__builtin_rvv_vnmsac_vx_tama: |
13737 | ID = Intrinsic::riscv_vnmsac_mask; |
13738 | DefaultPolicy = 3; |
13739 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13740 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13741 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13742 | break; |
13743 | case RISCVVector::BI__builtin_rvv_vnmsac_vv_tumu: |
13744 | case RISCVVector::BI__builtin_rvv_vnmsac_vx_tumu: |
13745 | ID = Intrinsic::riscv_vnmsac_mask; |
13746 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13747 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13748 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13749 | break; |
13750 | case RISCVVector::BI__builtin_rvv_vnmsac_vv_tamu: |
13751 | case RISCVVector::BI__builtin_rvv_vnmsac_vx_tamu: |
13752 | ID = Intrinsic::riscv_vnmsac_mask; |
13753 | DefaultPolicy = 1; |
13754 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13755 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13756 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13757 | break; |
13758 | case RISCVVector::BI__builtin_rvv_vnmsub_vv_tu: |
13759 | case RISCVVector::BI__builtin_rvv_vnmsub_vx_tu: |
13760 | ID = Intrinsic::riscv_vnmsub; |
13761 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13762 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13763 | break; |
13764 | case RISCVVector::BI__builtin_rvv_vnmsub_vv_ta: |
13765 | case RISCVVector::BI__builtin_rvv_vnmsub_vx_ta: |
13766 | ID = Intrinsic::riscv_vnmsub; |
13767 | DefaultPolicy = 1; |
13768 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13769 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13770 | break; |
13771 | case RISCVVector::BI__builtin_rvv_vnmsub_vv_tuma: |
13772 | case RISCVVector::BI__builtin_rvv_vnmsub_vx_tuma: |
13773 | ID = Intrinsic::riscv_vnmsub_mask; |
13774 | DefaultPolicy = 2; |
13775 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13776 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13777 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13778 | break; |
13779 | case RISCVVector::BI__builtin_rvv_vnmsub_vv_tama: |
13780 | case RISCVVector::BI__builtin_rvv_vnmsub_vx_tama: |
13781 | ID = Intrinsic::riscv_vnmsub_mask; |
13782 | DefaultPolicy = 3; |
13783 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13784 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13785 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13786 | break; |
13787 | case RISCVVector::BI__builtin_rvv_vnmsub_vv_tumu: |
13788 | case RISCVVector::BI__builtin_rvv_vnmsub_vx_tumu: |
13789 | ID = Intrinsic::riscv_vnmsub_mask; |
13790 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13791 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13792 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13793 | break; |
13794 | case RISCVVector::BI__builtin_rvv_vnmsub_vv_tamu: |
13795 | case RISCVVector::BI__builtin_rvv_vnmsub_vx_tamu: |
13796 | ID = Intrinsic::riscv_vnmsub_mask; |
13797 | DefaultPolicy = 1; |
13798 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13799 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13800 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
13801 | break; |
13802 | case RISCVVector::BI__builtin_rvv_vnsra_wv_tu: |
13803 | case RISCVVector::BI__builtin_rvv_vnsra_wx_tu: |
13804 | ID = Intrinsic::riscv_vnsra; |
13805 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13806 | break; |
13807 | case RISCVVector::BI__builtin_rvv_vnsra_wv_ta: |
13808 | case RISCVVector::BI__builtin_rvv_vnsra_wx_ta: |
13809 | ID = Intrinsic::riscv_vnsra; |
13810 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13811 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13812 | break; |
13813 | case RISCVVector::BI__builtin_rvv_vnsra_wv_tuma: |
13814 | case RISCVVector::BI__builtin_rvv_vnsra_wx_tuma: |
13815 | ID = Intrinsic::riscv_vnsra_mask; |
13816 | DefaultPolicy = 2; |
13817 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13818 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13819 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13820 | break; |
13821 | case RISCVVector::BI__builtin_rvv_vnsra_wv_tama: |
13822 | case RISCVVector::BI__builtin_rvv_vnsra_wx_tama: |
13823 | ID = Intrinsic::riscv_vnsra_mask; |
13824 | DefaultPolicy = 3; |
13825 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13826 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13827 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13828 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13829 | break; |
13830 | case RISCVVector::BI__builtin_rvv_vnsra_wv_tumu: |
13831 | case RISCVVector::BI__builtin_rvv_vnsra_wx_tumu: |
13832 | ID = Intrinsic::riscv_vnsra_mask; |
13833 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13834 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13835 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13836 | break; |
13837 | case RISCVVector::BI__builtin_rvv_vnsra_wv_tamu: |
13838 | case RISCVVector::BI__builtin_rvv_vnsra_wx_tamu: |
13839 | ID = Intrinsic::riscv_vnsra_mask; |
13840 | DefaultPolicy = 1; |
13841 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13842 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13843 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13844 | break; |
13845 | case RISCVVector::BI__builtin_rvv_vnsrl_wv_tu: |
13846 | case RISCVVector::BI__builtin_rvv_vnsrl_wx_tu: |
13847 | ID = Intrinsic::riscv_vnsrl; |
13848 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13849 | break; |
13850 | case RISCVVector::BI__builtin_rvv_vncvt_x_x_w_tu: |
13851 | ID = Intrinsic::riscv_vnsrl; |
13852 | DefaultPolicy = 0; |
13853 | |
13854 | { |
13855 | if (DefaultPolicy == TAIL_AGNOSTIC) |
13856 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
13857 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(Ops.back()->getType())); |
13858 | // passthru, op1, xlen, vl |
13859 | IntrinsicTypes = {ResultType, |
13860 | Ops[1]->getType(), |
13861 | Ops[3]->getType(), |
13862 | Ops[3]->getType()}; |
13863 | break; |
13864 | } |
13865 | break; |
13866 | case RISCVVector::BI__builtin_rvv_vnsrl_wv_ta: |
13867 | case RISCVVector::BI__builtin_rvv_vnsrl_wx_ta: |
13868 | ID = Intrinsic::riscv_vnsrl; |
13869 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13870 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13871 | break; |
13872 | case RISCVVector::BI__builtin_rvv_vncvt_x_x_w_ta: |
13873 | ID = Intrinsic::riscv_vnsrl; |
13874 | DefaultPolicy = 1; |
13875 | |
13876 | { |
13877 | if (DefaultPolicy == TAIL_AGNOSTIC) |
13878 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
13879 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(Ops.back()->getType())); |
13880 | // passthru, op1, xlen, vl |
13881 | IntrinsicTypes = {ResultType, |
13882 | Ops[1]->getType(), |
13883 | Ops[3]->getType(), |
13884 | Ops[3]->getType()}; |
13885 | break; |
13886 | } |
13887 | break; |
13888 | case RISCVVector::BI__builtin_rvv_vnsrl_wv_tuma: |
13889 | case RISCVVector::BI__builtin_rvv_vnsrl_wx_tuma: |
13890 | ID = Intrinsic::riscv_vnsrl_mask; |
13891 | DefaultPolicy = 2; |
13892 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13893 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13894 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13895 | break; |
13896 | case RISCVVector::BI__builtin_rvv_vncvt_x_x_w_tuma: |
13897 | ID = Intrinsic::riscv_vnsrl_mask; |
13898 | DefaultPolicy = 2; |
13899 | |
13900 | { |
13901 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13902 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
13903 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
13904 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(Ops.back()->getType())); |
13905 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13906 | // maskedoff, op1, xlen, mask, vl |
13907 | IntrinsicTypes = {ResultType, |
13908 | Ops[1]->getType(), |
13909 | Ops[4]->getType(), |
13910 | Ops[4]->getType()}; |
13911 | break; |
13912 | } |
13913 | break; |
13914 | case RISCVVector::BI__builtin_rvv_vnsrl_wv_tama: |
13915 | case RISCVVector::BI__builtin_rvv_vnsrl_wx_tama: |
13916 | ID = Intrinsic::riscv_vnsrl_mask; |
13917 | DefaultPolicy = 3; |
13918 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13919 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13920 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
13921 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13922 | break; |
13923 | case RISCVVector::BI__builtin_rvv_vncvt_x_x_w_tama: |
13924 | ID = Intrinsic::riscv_vnsrl_mask; |
13925 | DefaultPolicy = 3; |
13926 | |
13927 | { |
13928 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13929 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
13930 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
13931 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(Ops.back()->getType())); |
13932 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13933 | // maskedoff, op1, xlen, mask, vl |
13934 | IntrinsicTypes = {ResultType, |
13935 | Ops[1]->getType(), |
13936 | Ops[4]->getType(), |
13937 | Ops[4]->getType()}; |
13938 | break; |
13939 | } |
13940 | break; |
13941 | case RISCVVector::BI__builtin_rvv_vnsrl_wv_tumu: |
13942 | case RISCVVector::BI__builtin_rvv_vnsrl_wx_tumu: |
13943 | ID = Intrinsic::riscv_vnsrl_mask; |
13944 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13945 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13946 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13947 | break; |
13948 | case RISCVVector::BI__builtin_rvv_vncvt_x_x_w_tumu: |
13949 | ID = Intrinsic::riscv_vnsrl_mask; |
13950 | DefaultPolicy = 0; |
13951 | |
13952 | { |
13953 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13954 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
13955 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
13956 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(Ops.back()->getType())); |
13957 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13958 | // maskedoff, op1, xlen, mask, vl |
13959 | IntrinsicTypes = {ResultType, |
13960 | Ops[1]->getType(), |
13961 | Ops[4]->getType(), |
13962 | Ops[4]->getType()}; |
13963 | break; |
13964 | } |
13965 | break; |
13966 | case RISCVVector::BI__builtin_rvv_vnsrl_wv_tamu: |
13967 | case RISCVVector::BI__builtin_rvv_vnsrl_wx_tamu: |
13968 | ID = Intrinsic::riscv_vnsrl_mask; |
13969 | DefaultPolicy = 1; |
13970 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13971 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13972 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
13973 | break; |
13974 | case RISCVVector::BI__builtin_rvv_vncvt_x_x_w_tamu: |
13975 | ID = Intrinsic::riscv_vnsrl_mask; |
13976 | DefaultPolicy = 1; |
13977 | |
13978 | { |
13979 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
13980 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
13981 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
13982 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(Ops.back()->getType())); |
13983 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
13984 | // maskedoff, op1, xlen, mask, vl |
13985 | IntrinsicTypes = {ResultType, |
13986 | Ops[1]->getType(), |
13987 | Ops[4]->getType(), |
13988 | Ops[4]->getType()}; |
13989 | break; |
13990 | } |
13991 | break; |
13992 | case RISCVVector::BI__builtin_rvv_vor_vv_tu: |
13993 | case RISCVVector::BI__builtin_rvv_vor_vx_tu: |
13994 | ID = Intrinsic::riscv_vor; |
13995 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
13996 | break; |
13997 | case RISCVVector::BI__builtin_rvv_vor_vv_ta: |
13998 | case RISCVVector::BI__builtin_rvv_vor_vx_ta: |
13999 | ID = Intrinsic::riscv_vor; |
14000 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14001 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14002 | break; |
14003 | case RISCVVector::BI__builtin_rvv_vor_vv_tuma: |
14004 | case RISCVVector::BI__builtin_rvv_vor_vx_tuma: |
14005 | ID = Intrinsic::riscv_vor_mask; |
14006 | DefaultPolicy = 2; |
14007 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14008 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14009 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14010 | break; |
14011 | case RISCVVector::BI__builtin_rvv_vor_vv_tama: |
14012 | case RISCVVector::BI__builtin_rvv_vor_vx_tama: |
14013 | ID = Intrinsic::riscv_vor_mask; |
14014 | DefaultPolicy = 3; |
14015 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14016 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14017 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14018 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14019 | break; |
14020 | case RISCVVector::BI__builtin_rvv_vor_vv_tumu: |
14021 | case RISCVVector::BI__builtin_rvv_vor_vx_tumu: |
14022 | ID = Intrinsic::riscv_vor_mask; |
14023 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14024 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14025 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14026 | break; |
14027 | case RISCVVector::BI__builtin_rvv_vor_vv_tamu: |
14028 | case RISCVVector::BI__builtin_rvv_vor_vx_tamu: |
14029 | ID = Intrinsic::riscv_vor_mask; |
14030 | DefaultPolicy = 1; |
14031 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14032 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14033 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14034 | break; |
14035 | case RISCVVector::BI__builtin_rvv_vredand_vs_tu: |
14036 | ID = Intrinsic::riscv_vredand; |
14037 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14038 | break; |
14039 | case RISCVVector::BI__builtin_rvv_vredand_vs_ta: |
14040 | ID = Intrinsic::riscv_vredand; |
14041 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14042 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14043 | break; |
14044 | case RISCVVector::BI__builtin_rvv_vredand_vs_tum: |
14045 | ID = Intrinsic::riscv_vredand_mask; |
14046 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14047 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14048 | break; |
14049 | case RISCVVector::BI__builtin_rvv_vredand_vs_tam: |
14050 | ID = Intrinsic::riscv_vredand_mask; |
14051 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14052 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14053 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14054 | break; |
14055 | case RISCVVector::BI__builtin_rvv_vredand_vs_tumu: |
14056 | ID = Intrinsic::riscv_vredand_mask; |
14057 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14058 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14059 | break; |
14060 | case RISCVVector::BI__builtin_rvv_vredmax_vs_tu: |
14061 | ID = Intrinsic::riscv_vredmax; |
14062 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14063 | break; |
14064 | case RISCVVector::BI__builtin_rvv_vredmax_vs_ta: |
14065 | ID = Intrinsic::riscv_vredmax; |
14066 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14067 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14068 | break; |
14069 | case RISCVVector::BI__builtin_rvv_vredmax_vs_tum: |
14070 | ID = Intrinsic::riscv_vredmax_mask; |
14071 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14072 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14073 | break; |
14074 | case RISCVVector::BI__builtin_rvv_vredmax_vs_tam: |
14075 | ID = Intrinsic::riscv_vredmax_mask; |
14076 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14077 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14078 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14079 | break; |
14080 | case RISCVVector::BI__builtin_rvv_vredmax_vs_tumu: |
14081 | ID = Intrinsic::riscv_vredmax_mask; |
14082 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14083 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14084 | break; |
14085 | case RISCVVector::BI__builtin_rvv_vredmaxu_vs_tu: |
14086 | ID = Intrinsic::riscv_vredmaxu; |
14087 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14088 | break; |
14089 | case RISCVVector::BI__builtin_rvv_vredmaxu_vs_ta: |
14090 | ID = Intrinsic::riscv_vredmaxu; |
14091 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14092 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14093 | break; |
14094 | case RISCVVector::BI__builtin_rvv_vredmaxu_vs_tum: |
14095 | ID = Intrinsic::riscv_vredmaxu_mask; |
14096 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14097 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14098 | break; |
14099 | case RISCVVector::BI__builtin_rvv_vredmaxu_vs_tam: |
14100 | ID = Intrinsic::riscv_vredmaxu_mask; |
14101 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14102 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14103 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14104 | break; |
14105 | case RISCVVector::BI__builtin_rvv_vredmaxu_vs_tumu: |
14106 | ID = Intrinsic::riscv_vredmaxu_mask; |
14107 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14108 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14109 | break; |
14110 | case RISCVVector::BI__builtin_rvv_vredmin_vs_tu: |
14111 | ID = Intrinsic::riscv_vredmin; |
14112 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14113 | break; |
14114 | case RISCVVector::BI__builtin_rvv_vredmin_vs_ta: |
14115 | ID = Intrinsic::riscv_vredmin; |
14116 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14117 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14118 | break; |
14119 | case RISCVVector::BI__builtin_rvv_vredmin_vs_tum: |
14120 | ID = Intrinsic::riscv_vredmin_mask; |
14121 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14122 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14123 | break; |
14124 | case RISCVVector::BI__builtin_rvv_vredmin_vs_tam: |
14125 | ID = Intrinsic::riscv_vredmin_mask; |
14126 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14127 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14128 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14129 | break; |
14130 | case RISCVVector::BI__builtin_rvv_vredmin_vs_tumu: |
14131 | ID = Intrinsic::riscv_vredmin_mask; |
14132 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14133 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14134 | break; |
14135 | case RISCVVector::BI__builtin_rvv_vredminu_vs_tu: |
14136 | ID = Intrinsic::riscv_vredminu; |
14137 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14138 | break; |
14139 | case RISCVVector::BI__builtin_rvv_vredminu_vs_ta: |
14140 | ID = Intrinsic::riscv_vredminu; |
14141 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14142 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14143 | break; |
14144 | case RISCVVector::BI__builtin_rvv_vredminu_vs_tum: |
14145 | ID = Intrinsic::riscv_vredminu_mask; |
14146 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14147 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14148 | break; |
14149 | case RISCVVector::BI__builtin_rvv_vredminu_vs_tam: |
14150 | ID = Intrinsic::riscv_vredminu_mask; |
14151 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14152 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14153 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14154 | break; |
14155 | case RISCVVector::BI__builtin_rvv_vredminu_vs_tumu: |
14156 | ID = Intrinsic::riscv_vredminu_mask; |
14157 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14158 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14159 | break; |
14160 | case RISCVVector::BI__builtin_rvv_vredor_vs_tu: |
14161 | ID = Intrinsic::riscv_vredor; |
14162 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14163 | break; |
14164 | case RISCVVector::BI__builtin_rvv_vredor_vs_ta: |
14165 | ID = Intrinsic::riscv_vredor; |
14166 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14167 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14168 | break; |
14169 | case RISCVVector::BI__builtin_rvv_vredor_vs_tum: |
14170 | ID = Intrinsic::riscv_vredor_mask; |
14171 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14172 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14173 | break; |
14174 | case RISCVVector::BI__builtin_rvv_vredor_vs_tam: |
14175 | ID = Intrinsic::riscv_vredor_mask; |
14176 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14177 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14178 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14179 | break; |
14180 | case RISCVVector::BI__builtin_rvv_vredor_vs_tumu: |
14181 | ID = Intrinsic::riscv_vredor_mask; |
14182 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14183 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14184 | break; |
14185 | case RISCVVector::BI__builtin_rvv_vredsum_vs_tu: |
14186 | ID = Intrinsic::riscv_vredsum; |
14187 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14188 | break; |
14189 | case RISCVVector::BI__builtin_rvv_vredsum_vs_ta: |
14190 | ID = Intrinsic::riscv_vredsum; |
14191 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14192 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14193 | break; |
14194 | case RISCVVector::BI__builtin_rvv_vredsum_vs_tum: |
14195 | ID = Intrinsic::riscv_vredsum_mask; |
14196 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14197 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14198 | break; |
14199 | case RISCVVector::BI__builtin_rvv_vredsum_vs_tam: |
14200 | ID = Intrinsic::riscv_vredsum_mask; |
14201 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14202 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14203 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14204 | break; |
14205 | case RISCVVector::BI__builtin_rvv_vredsum_vs_tumu: |
14206 | ID = Intrinsic::riscv_vredsum_mask; |
14207 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14208 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14209 | break; |
14210 | case RISCVVector::BI__builtin_rvv_vredxor_vs_tu: |
14211 | ID = Intrinsic::riscv_vredxor; |
14212 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14213 | break; |
14214 | case RISCVVector::BI__builtin_rvv_vredxor_vs_ta: |
14215 | ID = Intrinsic::riscv_vredxor; |
14216 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14217 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14218 | break; |
14219 | case RISCVVector::BI__builtin_rvv_vredxor_vs_tum: |
14220 | ID = Intrinsic::riscv_vredxor_mask; |
14221 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14222 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14223 | break; |
14224 | case RISCVVector::BI__builtin_rvv_vredxor_vs_tam: |
14225 | ID = Intrinsic::riscv_vredxor_mask; |
14226 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14227 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14228 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14229 | break; |
14230 | case RISCVVector::BI__builtin_rvv_vredxor_vs_tumu: |
14231 | ID = Intrinsic::riscv_vredxor_mask; |
14232 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14233 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14234 | break; |
14235 | case RISCVVector::BI__builtin_rvv_vrem_vv_tu: |
14236 | case RISCVVector::BI__builtin_rvv_vrem_vx_tu: |
14237 | ID = Intrinsic::riscv_vrem; |
14238 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14239 | break; |
14240 | case RISCVVector::BI__builtin_rvv_vrem_vv_ta: |
14241 | case RISCVVector::BI__builtin_rvv_vrem_vx_ta: |
14242 | ID = Intrinsic::riscv_vrem; |
14243 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14244 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14245 | break; |
14246 | case RISCVVector::BI__builtin_rvv_vrem_vv_tuma: |
14247 | case RISCVVector::BI__builtin_rvv_vrem_vx_tuma: |
14248 | ID = Intrinsic::riscv_vrem_mask; |
14249 | DefaultPolicy = 2; |
14250 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14251 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14252 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14253 | break; |
14254 | case RISCVVector::BI__builtin_rvv_vrem_vv_tama: |
14255 | case RISCVVector::BI__builtin_rvv_vrem_vx_tama: |
14256 | ID = Intrinsic::riscv_vrem_mask; |
14257 | DefaultPolicy = 3; |
14258 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14259 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14260 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14261 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14262 | break; |
14263 | case RISCVVector::BI__builtin_rvv_vrem_vv_tumu: |
14264 | case RISCVVector::BI__builtin_rvv_vrem_vx_tumu: |
14265 | ID = Intrinsic::riscv_vrem_mask; |
14266 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14267 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14268 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14269 | break; |
14270 | case RISCVVector::BI__builtin_rvv_vrem_vv_tamu: |
14271 | case RISCVVector::BI__builtin_rvv_vrem_vx_tamu: |
14272 | ID = Intrinsic::riscv_vrem_mask; |
14273 | DefaultPolicy = 1; |
14274 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14275 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14276 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14277 | break; |
14278 | case RISCVVector::BI__builtin_rvv_vremu_vv_tu: |
14279 | case RISCVVector::BI__builtin_rvv_vremu_vx_tu: |
14280 | ID = Intrinsic::riscv_vremu; |
14281 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14282 | break; |
14283 | case RISCVVector::BI__builtin_rvv_vremu_vv_ta: |
14284 | case RISCVVector::BI__builtin_rvv_vremu_vx_ta: |
14285 | ID = Intrinsic::riscv_vremu; |
14286 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14287 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14288 | break; |
14289 | case RISCVVector::BI__builtin_rvv_vremu_vv_tuma: |
14290 | case RISCVVector::BI__builtin_rvv_vremu_vx_tuma: |
14291 | ID = Intrinsic::riscv_vremu_mask; |
14292 | DefaultPolicy = 2; |
14293 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14294 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14295 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14296 | break; |
14297 | case RISCVVector::BI__builtin_rvv_vremu_vv_tama: |
14298 | case RISCVVector::BI__builtin_rvv_vremu_vx_tama: |
14299 | ID = Intrinsic::riscv_vremu_mask; |
14300 | DefaultPolicy = 3; |
14301 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14302 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14303 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14304 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14305 | break; |
14306 | case RISCVVector::BI__builtin_rvv_vremu_vv_tumu: |
14307 | case RISCVVector::BI__builtin_rvv_vremu_vx_tumu: |
14308 | ID = Intrinsic::riscv_vremu_mask; |
14309 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14310 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14311 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14312 | break; |
14313 | case RISCVVector::BI__builtin_rvv_vremu_vv_tamu: |
14314 | case RISCVVector::BI__builtin_rvv_vremu_vx_tamu: |
14315 | ID = Intrinsic::riscv_vremu_mask; |
14316 | DefaultPolicy = 1; |
14317 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14318 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14319 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14320 | break; |
14321 | case RISCVVector::BI__builtin_rvv_vrgather_vv_tu: |
14322 | ID = Intrinsic::riscv_vrgather_vv; |
14323 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14324 | break; |
14325 | case RISCVVector::BI__builtin_rvv_vrgather_vv_ta: |
14326 | ID = Intrinsic::riscv_vrgather_vv; |
14327 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14328 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14329 | break; |
14330 | case RISCVVector::BI__builtin_rvv_vrgather_vv_tuma: |
14331 | ID = Intrinsic::riscv_vrgather_vv_mask; |
14332 | DefaultPolicy = 2; |
14333 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14334 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14335 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14336 | break; |
14337 | case RISCVVector::BI__builtin_rvv_vrgather_vv_tama: |
14338 | ID = Intrinsic::riscv_vrgather_vv_mask; |
14339 | DefaultPolicy = 3; |
14340 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14341 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14342 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14343 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14344 | break; |
14345 | case RISCVVector::BI__builtin_rvv_vrgather_vv_tumu: |
14346 | ID = Intrinsic::riscv_vrgather_vv_mask; |
14347 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14348 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14349 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14350 | break; |
14351 | case RISCVVector::BI__builtin_rvv_vrgather_vv_tamu: |
14352 | ID = Intrinsic::riscv_vrgather_vv_mask; |
14353 | DefaultPolicy = 1; |
14354 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14355 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14356 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14357 | break; |
14358 | case RISCVVector::BI__builtin_rvv_vrgather_vx_tu: |
14359 | ID = Intrinsic::riscv_vrgather_vx; |
14360 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14361 | break; |
14362 | case RISCVVector::BI__builtin_rvv_vrgather_vx_ta: |
14363 | ID = Intrinsic::riscv_vrgather_vx; |
14364 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14365 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14366 | break; |
14367 | case RISCVVector::BI__builtin_rvv_vrgather_vx_tuma: |
14368 | ID = Intrinsic::riscv_vrgather_vx_mask; |
14369 | DefaultPolicy = 2; |
14370 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14371 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14372 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14373 | break; |
14374 | case RISCVVector::BI__builtin_rvv_vrgather_vx_tama: |
14375 | ID = Intrinsic::riscv_vrgather_vx_mask; |
14376 | DefaultPolicy = 3; |
14377 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14378 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14379 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14380 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14381 | break; |
14382 | case RISCVVector::BI__builtin_rvv_vrgather_vx_tumu: |
14383 | ID = Intrinsic::riscv_vrgather_vx_mask; |
14384 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14385 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14386 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14387 | break; |
14388 | case RISCVVector::BI__builtin_rvv_vrgather_vx_tamu: |
14389 | ID = Intrinsic::riscv_vrgather_vx_mask; |
14390 | DefaultPolicy = 1; |
14391 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14392 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14393 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14394 | break; |
14395 | case RISCVVector::BI__builtin_rvv_vrgatherei16_vv_tu: |
14396 | ID = Intrinsic::riscv_vrgatherei16_vv; |
14397 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14398 | break; |
14399 | case RISCVVector::BI__builtin_rvv_vrgatherei16_vv_ta: |
14400 | ID = Intrinsic::riscv_vrgatherei16_vv; |
14401 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14402 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14403 | break; |
14404 | case RISCVVector::BI__builtin_rvv_vrgatherei16_vv_tuma: |
14405 | ID = Intrinsic::riscv_vrgatherei16_vv_mask; |
14406 | DefaultPolicy = 2; |
14407 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14408 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14409 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14410 | break; |
14411 | case RISCVVector::BI__builtin_rvv_vrgatherei16_vv_tama: |
14412 | ID = Intrinsic::riscv_vrgatherei16_vv_mask; |
14413 | DefaultPolicy = 3; |
14414 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14415 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14416 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14417 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14418 | break; |
14419 | case RISCVVector::BI__builtin_rvv_vrgatherei16_vv_tumu: |
14420 | ID = Intrinsic::riscv_vrgatherei16_vv_mask; |
14421 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14422 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14423 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14424 | break; |
14425 | case RISCVVector::BI__builtin_rvv_vrgatherei16_vv_tamu: |
14426 | ID = Intrinsic::riscv_vrgatherei16_vv_mask; |
14427 | DefaultPolicy = 1; |
14428 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14429 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14430 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14431 | break; |
14432 | case RISCVVector::BI__builtin_rvv_vrsub_vx_tu: |
14433 | ID = Intrinsic::riscv_vrsub; |
14434 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14435 | break; |
14436 | case RISCVVector::BI__builtin_rvv_vneg_v_tu: |
14437 | ID = Intrinsic::riscv_vrsub; |
14438 | DefaultPolicy = 0; |
14439 | |
14440 | { |
14441 | if (DefaultPolicy == TAIL_AGNOSTIC) |
14442 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
14443 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
14444 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
14445 | // passthru, op1, op2, vl |
14446 | IntrinsicTypes = {ResultType, ElemTy, Ops[3]->getType()}; |
14447 | break; |
14448 | } |
14449 | break; |
14450 | case RISCVVector::BI__builtin_rvv_vrsub_vx_ta: |
14451 | ID = Intrinsic::riscv_vrsub; |
14452 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14453 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14454 | break; |
14455 | case RISCVVector::BI__builtin_rvv_vneg_v_ta: |
14456 | ID = Intrinsic::riscv_vrsub; |
14457 | DefaultPolicy = 1; |
14458 | |
14459 | { |
14460 | if (DefaultPolicy == TAIL_AGNOSTIC) |
14461 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
14462 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
14463 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
14464 | // passthru, op1, op2, vl |
14465 | IntrinsicTypes = {ResultType, ElemTy, Ops[3]->getType()}; |
14466 | break; |
14467 | } |
14468 | break; |
14469 | case RISCVVector::BI__builtin_rvv_vrsub_vx_tuma: |
14470 | ID = Intrinsic::riscv_vrsub_mask; |
14471 | DefaultPolicy = 2; |
14472 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14473 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14474 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14475 | break; |
14476 | case RISCVVector::BI__builtin_rvv_vneg_v_tuma: |
14477 | ID = Intrinsic::riscv_vrsub_mask; |
14478 | DefaultPolicy = 2; |
14479 | |
14480 | { |
14481 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14482 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
14483 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
14484 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
14485 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
14486 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14487 | // maskedoff, op1, op2, mask, vl, policy |
14488 | IntrinsicTypes = {ResultType, ElemTy, Ops[4]->getType()}; |
14489 | break; |
14490 | } |
14491 | break; |
14492 | case RISCVVector::BI__builtin_rvv_vrsub_vx_tama: |
14493 | ID = Intrinsic::riscv_vrsub_mask; |
14494 | DefaultPolicy = 3; |
14495 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14496 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14497 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14498 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14499 | break; |
14500 | case RISCVVector::BI__builtin_rvv_vneg_v_tama: |
14501 | ID = Intrinsic::riscv_vrsub_mask; |
14502 | DefaultPolicy = 3; |
14503 | |
14504 | { |
14505 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14506 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
14507 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
14508 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
14509 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
14510 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14511 | // maskedoff, op1, op2, mask, vl, policy |
14512 | IntrinsicTypes = {ResultType, ElemTy, Ops[4]->getType()}; |
14513 | break; |
14514 | } |
14515 | break; |
14516 | case RISCVVector::BI__builtin_rvv_vrsub_vx_tumu: |
14517 | ID = Intrinsic::riscv_vrsub_mask; |
14518 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14519 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14520 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14521 | break; |
14522 | case RISCVVector::BI__builtin_rvv_vneg_v_tumu: |
14523 | ID = Intrinsic::riscv_vrsub_mask; |
14524 | DefaultPolicy = 0; |
14525 | |
14526 | { |
14527 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14528 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
14529 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
14530 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
14531 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
14532 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14533 | // maskedoff, op1, op2, mask, vl, policy |
14534 | IntrinsicTypes = {ResultType, ElemTy, Ops[4]->getType()}; |
14535 | break; |
14536 | } |
14537 | break; |
14538 | case RISCVVector::BI__builtin_rvv_vrsub_vx_tamu: |
14539 | ID = Intrinsic::riscv_vrsub_mask; |
14540 | DefaultPolicy = 1; |
14541 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14542 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14543 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14544 | break; |
14545 | case RISCVVector::BI__builtin_rvv_vneg_v_tamu: |
14546 | ID = Intrinsic::riscv_vrsub_mask; |
14547 | DefaultPolicy = 1; |
14548 | |
14549 | { |
14550 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14551 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
14552 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
14553 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
14554 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
14555 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14556 | // maskedoff, op1, op2, mask, vl, policy |
14557 | IntrinsicTypes = {ResultType, ElemTy, Ops[4]->getType()}; |
14558 | break; |
14559 | } |
14560 | break; |
14561 | case RISCVVector::BI__builtin_rvv_vsadd_vv_tu: |
14562 | case RISCVVector::BI__builtin_rvv_vsadd_vx_tu: |
14563 | ID = Intrinsic::riscv_vsadd; |
14564 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14565 | break; |
14566 | case RISCVVector::BI__builtin_rvv_vsadd_vv_ta: |
14567 | case RISCVVector::BI__builtin_rvv_vsadd_vx_ta: |
14568 | ID = Intrinsic::riscv_vsadd; |
14569 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14570 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14571 | break; |
14572 | case RISCVVector::BI__builtin_rvv_vsadd_vv_tuma: |
14573 | case RISCVVector::BI__builtin_rvv_vsadd_vx_tuma: |
14574 | ID = Intrinsic::riscv_vsadd_mask; |
14575 | DefaultPolicy = 2; |
14576 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14577 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14578 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14579 | break; |
14580 | case RISCVVector::BI__builtin_rvv_vsadd_vv_tama: |
14581 | case RISCVVector::BI__builtin_rvv_vsadd_vx_tama: |
14582 | ID = Intrinsic::riscv_vsadd_mask; |
14583 | DefaultPolicy = 3; |
14584 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14585 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14586 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14587 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14588 | break; |
14589 | case RISCVVector::BI__builtin_rvv_vsadd_vv_tumu: |
14590 | case RISCVVector::BI__builtin_rvv_vsadd_vx_tumu: |
14591 | ID = Intrinsic::riscv_vsadd_mask; |
14592 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14593 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14594 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14595 | break; |
14596 | case RISCVVector::BI__builtin_rvv_vsadd_vv_tamu: |
14597 | case RISCVVector::BI__builtin_rvv_vsadd_vx_tamu: |
14598 | ID = Intrinsic::riscv_vsadd_mask; |
14599 | DefaultPolicy = 1; |
14600 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14601 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14602 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14603 | break; |
14604 | case RISCVVector::BI__builtin_rvv_vsaddu_vv_tu: |
14605 | case RISCVVector::BI__builtin_rvv_vsaddu_vx_tu: |
14606 | ID = Intrinsic::riscv_vsaddu; |
14607 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14608 | break; |
14609 | case RISCVVector::BI__builtin_rvv_vsaddu_vv_ta: |
14610 | case RISCVVector::BI__builtin_rvv_vsaddu_vx_ta: |
14611 | ID = Intrinsic::riscv_vsaddu; |
14612 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14613 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14614 | break; |
14615 | case RISCVVector::BI__builtin_rvv_vsaddu_vv_tuma: |
14616 | case RISCVVector::BI__builtin_rvv_vsaddu_vx_tuma: |
14617 | ID = Intrinsic::riscv_vsaddu_mask; |
14618 | DefaultPolicy = 2; |
14619 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14620 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14621 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14622 | break; |
14623 | case RISCVVector::BI__builtin_rvv_vsaddu_vv_tama: |
14624 | case RISCVVector::BI__builtin_rvv_vsaddu_vx_tama: |
14625 | ID = Intrinsic::riscv_vsaddu_mask; |
14626 | DefaultPolicy = 3; |
14627 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14628 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14629 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14630 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14631 | break; |
14632 | case RISCVVector::BI__builtin_rvv_vsaddu_vv_tumu: |
14633 | case RISCVVector::BI__builtin_rvv_vsaddu_vx_tumu: |
14634 | ID = Intrinsic::riscv_vsaddu_mask; |
14635 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14636 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14637 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14638 | break; |
14639 | case RISCVVector::BI__builtin_rvv_vsaddu_vv_tamu: |
14640 | case RISCVVector::BI__builtin_rvv_vsaddu_vx_tamu: |
14641 | ID = Intrinsic::riscv_vsaddu_mask; |
14642 | DefaultPolicy = 1; |
14643 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14644 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14645 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14646 | break; |
14647 | case RISCVVector::BI__builtin_rvv_vsbc_vvm_tu: |
14648 | case RISCVVector::BI__builtin_rvv_vsbc_vxm_tu: |
14649 | ID = Intrinsic::riscv_vsbc; |
14650 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14651 | break; |
14652 | case RISCVVector::BI__builtin_rvv_vsbc_vvm_ta: |
14653 | case RISCVVector::BI__builtin_rvv_vsbc_vxm_ta: |
14654 | ID = Intrinsic::riscv_vsbc; |
14655 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14656 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14657 | break; |
14658 | case RISCVVector::BI__builtin_rvv_vse8_v: |
14659 | case RISCVVector::BI__builtin_rvv_vse16_v: |
14660 | case RISCVVector::BI__builtin_rvv_vse32_v: |
14661 | case RISCVVector::BI__builtin_rvv_vse64_v: |
14662 | ID = Intrinsic::riscv_vse; |
14663 | DefaultPolicy = 1; |
14664 | |
14665 | // Builtin: (ptr, value, vl). Intrinsic: (value, ptr, vl) |
14666 | std::swap(Ops[0], Ops[1]); |
14667 | Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); |
14668 | IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType()}; |
14669 | break; |
14670 | case RISCVVector::BI__builtin_rvv_vse8_v_m: |
14671 | case RISCVVector::BI__builtin_rvv_vse16_v_m: |
14672 | case RISCVVector::BI__builtin_rvv_vse32_v_m: |
14673 | case RISCVVector::BI__builtin_rvv_vse64_v_m: |
14674 | ID = Intrinsic::riscv_vse_mask; |
14675 | DefaultPolicy = 0; |
14676 | |
14677 | // Builtin: (mask, ptr, value, vl). Intrinsic: (value, ptr, mask, vl) |
14678 | std::swap(Ops[0], Ops[2]); |
14679 | Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); |
14680 | IntrinsicTypes = {Ops[0]->getType(), Ops[3]->getType()}; |
14681 | break; |
14682 | case RISCVVector::BI__builtin_rvv_vsetvli: |
14683 | ID = Intrinsic::riscv_vsetvli; |
14684 | DefaultPolicy = 1; |
14685 | IntrinsicTypes = {ResultType};break; |
14686 | case RISCVVector::BI__builtin_rvv_vsetvlimax: |
14687 | ID = Intrinsic::riscv_vsetvlimax; |
14688 | DefaultPolicy = 1; |
14689 | IntrinsicTypes = {ResultType};break; |
14690 | case RISCVVector::BI__builtin_rvv_vsext_vf2_tu: |
14691 | case RISCVVector::BI__builtin_rvv_vsext_vf4_tu: |
14692 | case RISCVVector::BI__builtin_rvv_vsext_vf8_tu: |
14693 | ID = Intrinsic::riscv_vsext; |
14694 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14695 | break; |
14696 | case RISCVVector::BI__builtin_rvv_vsext_vf2_ta: |
14697 | case RISCVVector::BI__builtin_rvv_vsext_vf4_ta: |
14698 | case RISCVVector::BI__builtin_rvv_vsext_vf8_ta: |
14699 | ID = Intrinsic::riscv_vsext; |
14700 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14701 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14702 | break; |
14703 | case RISCVVector::BI__builtin_rvv_vsext_vf2_tuma: |
14704 | case RISCVVector::BI__builtin_rvv_vsext_vf4_tuma: |
14705 | case RISCVVector::BI__builtin_rvv_vsext_vf8_tuma: |
14706 | ID = Intrinsic::riscv_vsext_mask; |
14707 | DefaultPolicy = 2; |
14708 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14709 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14710 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14711 | break; |
14712 | case RISCVVector::BI__builtin_rvv_vsext_vf2_tama: |
14713 | case RISCVVector::BI__builtin_rvv_vsext_vf4_tama: |
14714 | case RISCVVector::BI__builtin_rvv_vsext_vf8_tama: |
14715 | ID = Intrinsic::riscv_vsext_mask; |
14716 | DefaultPolicy = 3; |
14717 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14718 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14719 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14720 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14721 | break; |
14722 | case RISCVVector::BI__builtin_rvv_vsext_vf2_tumu: |
14723 | case RISCVVector::BI__builtin_rvv_vsext_vf4_tumu: |
14724 | case RISCVVector::BI__builtin_rvv_vsext_vf8_tumu: |
14725 | ID = Intrinsic::riscv_vsext_mask; |
14726 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14727 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14728 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14729 | break; |
14730 | case RISCVVector::BI__builtin_rvv_vsext_vf2_tamu: |
14731 | case RISCVVector::BI__builtin_rvv_vsext_vf4_tamu: |
14732 | case RISCVVector::BI__builtin_rvv_vsext_vf8_tamu: |
14733 | ID = Intrinsic::riscv_vsext_mask; |
14734 | DefaultPolicy = 1; |
14735 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14736 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14737 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
14738 | break; |
14739 | case RISCVVector::BI__builtin_rvv_vslide1down_vx_tu: |
14740 | ID = Intrinsic::riscv_vslide1down; |
14741 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14742 | break; |
14743 | case RISCVVector::BI__builtin_rvv_vslide1down_vx_ta: |
14744 | ID = Intrinsic::riscv_vslide1down; |
14745 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14746 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14747 | break; |
14748 | case RISCVVector::BI__builtin_rvv_vslide1down_vx_tuma: |
14749 | ID = Intrinsic::riscv_vslide1down_mask; |
14750 | DefaultPolicy = 2; |
14751 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14752 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14753 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14754 | break; |
14755 | case RISCVVector::BI__builtin_rvv_vslide1down_vx_tama: |
14756 | ID = Intrinsic::riscv_vslide1down_mask; |
14757 | DefaultPolicy = 3; |
14758 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14759 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14760 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14761 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14762 | break; |
14763 | case RISCVVector::BI__builtin_rvv_vslide1down_vx_tumu: |
14764 | ID = Intrinsic::riscv_vslide1down_mask; |
14765 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14766 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14767 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14768 | break; |
14769 | case RISCVVector::BI__builtin_rvv_vslide1down_vx_tamu: |
14770 | ID = Intrinsic::riscv_vslide1down_mask; |
14771 | DefaultPolicy = 1; |
14772 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14773 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14774 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14775 | break; |
14776 | case RISCVVector::BI__builtin_rvv_vslide1up_vx_tu: |
14777 | ID = Intrinsic::riscv_vslide1up; |
14778 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14779 | break; |
14780 | case RISCVVector::BI__builtin_rvv_vslide1up_vx_ta: |
14781 | ID = Intrinsic::riscv_vslide1up; |
14782 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14783 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14784 | break; |
14785 | case RISCVVector::BI__builtin_rvv_vslide1up_vx_tuma: |
14786 | ID = Intrinsic::riscv_vslide1up_mask; |
14787 | DefaultPolicy = 2; |
14788 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14789 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14790 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14791 | break; |
14792 | case RISCVVector::BI__builtin_rvv_vslide1up_vx_tama: |
14793 | ID = Intrinsic::riscv_vslide1up_mask; |
14794 | DefaultPolicy = 3; |
14795 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14796 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14797 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14798 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14799 | break; |
14800 | case RISCVVector::BI__builtin_rvv_vslide1up_vx_tumu: |
14801 | ID = Intrinsic::riscv_vslide1up_mask; |
14802 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14803 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14804 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14805 | break; |
14806 | case RISCVVector::BI__builtin_rvv_vslide1up_vx_tamu: |
14807 | ID = Intrinsic::riscv_vslide1up_mask; |
14808 | DefaultPolicy = 1; |
14809 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14810 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14811 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14812 | break; |
14813 | case RISCVVector::BI__builtin_rvv_vslidedown_vx_tu: |
14814 | ID = Intrinsic::riscv_vslidedown; |
14815 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14816 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14817 | break; |
14818 | case RISCVVector::BI__builtin_rvv_vslidedown_vx_ta: |
14819 | ID = Intrinsic::riscv_vslidedown; |
14820 | DefaultPolicy = 1; |
14821 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14822 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14823 | break; |
14824 | case RISCVVector::BI__builtin_rvv_vslidedown_vx_tuma: |
14825 | ID = Intrinsic::riscv_vslidedown_mask; |
14826 | DefaultPolicy = 2; |
14827 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14828 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14829 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14830 | break; |
14831 | case RISCVVector::BI__builtin_rvv_vslidedown_vx_tama: |
14832 | ID = Intrinsic::riscv_vslidedown_mask; |
14833 | DefaultPolicy = 3; |
14834 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14835 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14836 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14837 | break; |
14838 | case RISCVVector::BI__builtin_rvv_vslidedown_vx_tumu: |
14839 | ID = Intrinsic::riscv_vslidedown_mask; |
14840 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14841 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14842 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14843 | break; |
14844 | case RISCVVector::BI__builtin_rvv_vslidedown_vx_tamu: |
14845 | ID = Intrinsic::riscv_vslidedown_mask; |
14846 | DefaultPolicy = 1; |
14847 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14848 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14849 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14850 | break; |
14851 | case RISCVVector::BI__builtin_rvv_vslideup_vx_tu: |
14852 | ID = Intrinsic::riscv_vslideup; |
14853 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14854 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14855 | break; |
14856 | case RISCVVector::BI__builtin_rvv_vslideup_vx_ta: |
14857 | ID = Intrinsic::riscv_vslideup; |
14858 | DefaultPolicy = 1; |
14859 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14860 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14861 | break; |
14862 | case RISCVVector::BI__builtin_rvv_vslideup_vx_tuma: |
14863 | ID = Intrinsic::riscv_vslideup_mask; |
14864 | DefaultPolicy = 2; |
14865 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14866 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14867 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14868 | break; |
14869 | case RISCVVector::BI__builtin_rvv_vslideup_vx_tama: |
14870 | ID = Intrinsic::riscv_vslideup_mask; |
14871 | DefaultPolicy = 3; |
14872 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14873 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14874 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14875 | break; |
14876 | case RISCVVector::BI__builtin_rvv_vslideup_vx_tumu: |
14877 | ID = Intrinsic::riscv_vslideup_mask; |
14878 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14879 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14880 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14881 | break; |
14882 | case RISCVVector::BI__builtin_rvv_vslideup_vx_tamu: |
14883 | ID = Intrinsic::riscv_vslideup_mask; |
14884 | DefaultPolicy = 1; |
14885 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14886 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14887 | IntrinsicTypes = {ResultType, Ops.back()->getType()}; |
14888 | break; |
14889 | case RISCVVector::BI__builtin_rvv_vsll_vv_tu: |
14890 | case RISCVVector::BI__builtin_rvv_vsll_vx_tu: |
14891 | ID = Intrinsic::riscv_vsll; |
14892 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14893 | break; |
14894 | case RISCVVector::BI__builtin_rvv_vsll_vv_ta: |
14895 | case RISCVVector::BI__builtin_rvv_vsll_vx_ta: |
14896 | ID = Intrinsic::riscv_vsll; |
14897 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14898 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14899 | break; |
14900 | case RISCVVector::BI__builtin_rvv_vsll_vv_tuma: |
14901 | case RISCVVector::BI__builtin_rvv_vsll_vx_tuma: |
14902 | ID = Intrinsic::riscv_vsll_mask; |
14903 | DefaultPolicy = 2; |
14904 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14905 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14906 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14907 | break; |
14908 | case RISCVVector::BI__builtin_rvv_vsll_vv_tama: |
14909 | case RISCVVector::BI__builtin_rvv_vsll_vx_tama: |
14910 | ID = Intrinsic::riscv_vsll_mask; |
14911 | DefaultPolicy = 3; |
14912 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14913 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14914 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14915 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14916 | break; |
14917 | case RISCVVector::BI__builtin_rvv_vsll_vv_tumu: |
14918 | case RISCVVector::BI__builtin_rvv_vsll_vx_tumu: |
14919 | ID = Intrinsic::riscv_vsll_mask; |
14920 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14921 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14922 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14923 | break; |
14924 | case RISCVVector::BI__builtin_rvv_vsll_vv_tamu: |
14925 | case RISCVVector::BI__builtin_rvv_vsll_vx_tamu: |
14926 | ID = Intrinsic::riscv_vsll_mask; |
14927 | DefaultPolicy = 1; |
14928 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14929 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14930 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14931 | break; |
14932 | case RISCVVector::BI__builtin_rvv_vsm_v: |
14933 | ID = Intrinsic::riscv_vsm; |
14934 | DefaultPolicy = 1; |
14935 | |
14936 | // Builtin: (ptr, value, vl). Intrinsic: (value, ptr, vl) |
14937 | std::swap(Ops[0], Ops[1]); |
14938 | Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); |
14939 | IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType()}; |
14940 | break; |
14941 | case RISCVVector::BI__builtin_rvv_vsmul_vv_tu: |
14942 | case RISCVVector::BI__builtin_rvv_vsmul_vx_tu: |
14943 | ID = Intrinsic::riscv_vsmul; |
14944 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14945 | break; |
14946 | case RISCVVector::BI__builtin_rvv_vsmul_vv_ta: |
14947 | case RISCVVector::BI__builtin_rvv_vsmul_vx_ta: |
14948 | ID = Intrinsic::riscv_vsmul; |
14949 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14950 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14951 | break; |
14952 | case RISCVVector::BI__builtin_rvv_vsmul_vv_tuma: |
14953 | case RISCVVector::BI__builtin_rvv_vsmul_vx_tuma: |
14954 | ID = Intrinsic::riscv_vsmul_mask; |
14955 | DefaultPolicy = 2; |
14956 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14957 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14958 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14959 | break; |
14960 | case RISCVVector::BI__builtin_rvv_vsmul_vv_tama: |
14961 | case RISCVVector::BI__builtin_rvv_vsmul_vx_tama: |
14962 | ID = Intrinsic::riscv_vsmul_mask; |
14963 | DefaultPolicy = 3; |
14964 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14965 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14966 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
14967 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14968 | break; |
14969 | case RISCVVector::BI__builtin_rvv_vsmul_vv_tumu: |
14970 | case RISCVVector::BI__builtin_rvv_vsmul_vx_tumu: |
14971 | ID = Intrinsic::riscv_vsmul_mask; |
14972 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14973 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14974 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14975 | break; |
14976 | case RISCVVector::BI__builtin_rvv_vsmul_vv_tamu: |
14977 | case RISCVVector::BI__builtin_rvv_vsmul_vx_tamu: |
14978 | ID = Intrinsic::riscv_vsmul_mask; |
14979 | DefaultPolicy = 1; |
14980 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
14981 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
14982 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
14983 | break; |
14984 | case RISCVVector::BI__builtin_rvv_vsoxei8_v: |
14985 | case RISCVVector::BI__builtin_rvv_vsoxei16_v: |
14986 | case RISCVVector::BI__builtin_rvv_vsoxei32_v: |
14987 | case RISCVVector::BI__builtin_rvv_vsoxei64_v: |
14988 | ID = Intrinsic::riscv_vsoxei; |
14989 | DefaultPolicy = 1; |
14990 | |
14991 | // Builtin: (ptr, index, value, vl). Intrinsic: (value, ptr, index, vl) |
14992 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3); |
14993 | Ops[1] = Builder.CreateBitCast(Ops[1],Ops[0]->getType()->getPointerTo()); |
14994 | IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType(), Ops[3]->getType()}; |
14995 | break; |
14996 | case RISCVVector::BI__builtin_rvv_vsoxei8_v_m: |
14997 | case RISCVVector::BI__builtin_rvv_vsoxei16_v_m: |
14998 | case RISCVVector::BI__builtin_rvv_vsoxei32_v_m: |
14999 | case RISCVVector::BI__builtin_rvv_vsoxei64_v_m: |
15000 | ID = Intrinsic::riscv_vsoxei_mask; |
15001 | DefaultPolicy = 0; |
15002 | |
15003 | // Builtin: (mask, ptr, index, value, vl). Intrinsic: (value, ptr, index, mask, vl) |
15004 | std::swap(Ops[0], Ops[3]); |
15005 | Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); |
15006 | IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType(), Ops[4]->getType()}; |
15007 | break; |
15008 | case RISCVVector::BI__builtin_rvv_vsoxseg2ei8_v: |
15009 | case RISCVVector::BI__builtin_rvv_vsoxseg2ei16_v: |
15010 | case RISCVVector::BI__builtin_rvv_vsoxseg2ei32_v: |
15011 | case RISCVVector::BI__builtin_rvv_vsoxseg2ei64_v: |
15012 | ID = Intrinsic::riscv_vsoxseg2; |
15013 | NF = 2; |
15014 | DefaultPolicy = 1; |
15015 | |
15016 | { |
15017 | // Builtin: (ptr, index, val0, val1, ..., vl) |
15018 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
15019 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15020 | IntrinsicTypes = {Ops[0]->getType(), |
15021 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
15022 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15022, __extension__ __PRETTY_FUNCTION__)); |
15023 | } |
15024 | break; |
15025 | case RISCVVector::BI__builtin_rvv_vsoxseg2ei8_v_m: |
15026 | case RISCVVector::BI__builtin_rvv_vsoxseg2ei16_v_m: |
15027 | case RISCVVector::BI__builtin_rvv_vsoxseg2ei32_v_m: |
15028 | case RISCVVector::BI__builtin_rvv_vsoxseg2ei64_v_m: |
15029 | ID = Intrinsic::riscv_vsoxseg2_mask; |
15030 | NF = 2; |
15031 | DefaultPolicy = 0; |
15032 | |
15033 | { |
15034 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
15035 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
15036 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15037 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15038 | IntrinsicTypes = {Ops[0]->getType(), |
15039 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
15040 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15040, __extension__ __PRETTY_FUNCTION__)); |
15041 | } |
15042 | break; |
15043 | case RISCVVector::BI__builtin_rvv_vsoxseg3ei8_v: |
15044 | case RISCVVector::BI__builtin_rvv_vsoxseg3ei16_v: |
15045 | case RISCVVector::BI__builtin_rvv_vsoxseg3ei32_v: |
15046 | case RISCVVector::BI__builtin_rvv_vsoxseg3ei64_v: |
15047 | ID = Intrinsic::riscv_vsoxseg3; |
15048 | NF = 3; |
15049 | DefaultPolicy = 1; |
15050 | |
15051 | { |
15052 | // Builtin: (ptr, index, val0, val1, ..., vl) |
15053 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
15054 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15055 | IntrinsicTypes = {Ops[0]->getType(), |
15056 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
15057 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15057, __extension__ __PRETTY_FUNCTION__)); |
15058 | } |
15059 | break; |
15060 | case RISCVVector::BI__builtin_rvv_vsoxseg3ei8_v_m: |
15061 | case RISCVVector::BI__builtin_rvv_vsoxseg3ei16_v_m: |
15062 | case RISCVVector::BI__builtin_rvv_vsoxseg3ei32_v_m: |
15063 | case RISCVVector::BI__builtin_rvv_vsoxseg3ei64_v_m: |
15064 | ID = Intrinsic::riscv_vsoxseg3_mask; |
15065 | NF = 3; |
15066 | DefaultPolicy = 0; |
15067 | |
15068 | { |
15069 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
15070 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
15071 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15072 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15073 | IntrinsicTypes = {Ops[0]->getType(), |
15074 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
15075 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15075, __extension__ __PRETTY_FUNCTION__)); |
15076 | } |
15077 | break; |
15078 | case RISCVVector::BI__builtin_rvv_vsoxseg4ei8_v: |
15079 | case RISCVVector::BI__builtin_rvv_vsoxseg4ei16_v: |
15080 | case RISCVVector::BI__builtin_rvv_vsoxseg4ei32_v: |
15081 | case RISCVVector::BI__builtin_rvv_vsoxseg4ei64_v: |
15082 | ID = Intrinsic::riscv_vsoxseg4; |
15083 | NF = 4; |
15084 | DefaultPolicy = 1; |
15085 | |
15086 | { |
15087 | // Builtin: (ptr, index, val0, val1, ..., vl) |
15088 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
15089 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15090 | IntrinsicTypes = {Ops[0]->getType(), |
15091 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
15092 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15092, __extension__ __PRETTY_FUNCTION__)); |
15093 | } |
15094 | break; |
15095 | case RISCVVector::BI__builtin_rvv_vsoxseg4ei8_v_m: |
15096 | case RISCVVector::BI__builtin_rvv_vsoxseg4ei16_v_m: |
15097 | case RISCVVector::BI__builtin_rvv_vsoxseg4ei32_v_m: |
15098 | case RISCVVector::BI__builtin_rvv_vsoxseg4ei64_v_m: |
15099 | ID = Intrinsic::riscv_vsoxseg4_mask; |
15100 | NF = 4; |
15101 | DefaultPolicy = 0; |
15102 | |
15103 | { |
15104 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
15105 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
15106 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15107 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15108 | IntrinsicTypes = {Ops[0]->getType(), |
15109 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
15110 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15110, __extension__ __PRETTY_FUNCTION__)); |
15111 | } |
15112 | break; |
15113 | case RISCVVector::BI__builtin_rvv_vsoxseg5ei8_v: |
15114 | case RISCVVector::BI__builtin_rvv_vsoxseg5ei16_v: |
15115 | case RISCVVector::BI__builtin_rvv_vsoxseg5ei32_v: |
15116 | case RISCVVector::BI__builtin_rvv_vsoxseg5ei64_v: |
15117 | ID = Intrinsic::riscv_vsoxseg5; |
15118 | NF = 5; |
15119 | DefaultPolicy = 1; |
15120 | |
15121 | { |
15122 | // Builtin: (ptr, index, val0, val1, ..., vl) |
15123 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
15124 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15125 | IntrinsicTypes = {Ops[0]->getType(), |
15126 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
15127 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15127, __extension__ __PRETTY_FUNCTION__)); |
15128 | } |
15129 | break; |
15130 | case RISCVVector::BI__builtin_rvv_vsoxseg5ei8_v_m: |
15131 | case RISCVVector::BI__builtin_rvv_vsoxseg5ei16_v_m: |
15132 | case RISCVVector::BI__builtin_rvv_vsoxseg5ei32_v_m: |
15133 | case RISCVVector::BI__builtin_rvv_vsoxseg5ei64_v_m: |
15134 | ID = Intrinsic::riscv_vsoxseg5_mask; |
15135 | NF = 5; |
15136 | DefaultPolicy = 0; |
15137 | |
15138 | { |
15139 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
15140 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
15141 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15142 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15143 | IntrinsicTypes = {Ops[0]->getType(), |
15144 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
15145 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15145, __extension__ __PRETTY_FUNCTION__)); |
15146 | } |
15147 | break; |
15148 | case RISCVVector::BI__builtin_rvv_vsoxseg6ei8_v: |
15149 | case RISCVVector::BI__builtin_rvv_vsoxseg6ei16_v: |
15150 | case RISCVVector::BI__builtin_rvv_vsoxseg6ei32_v: |
15151 | case RISCVVector::BI__builtin_rvv_vsoxseg6ei64_v: |
15152 | ID = Intrinsic::riscv_vsoxseg6; |
15153 | NF = 6; |
15154 | DefaultPolicy = 1; |
15155 | |
15156 | { |
15157 | // Builtin: (ptr, index, val0, val1, ..., vl) |
15158 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
15159 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15160 | IntrinsicTypes = {Ops[0]->getType(), |
15161 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
15162 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15162, __extension__ __PRETTY_FUNCTION__)); |
15163 | } |
15164 | break; |
15165 | case RISCVVector::BI__builtin_rvv_vsoxseg6ei8_v_m: |
15166 | case RISCVVector::BI__builtin_rvv_vsoxseg6ei16_v_m: |
15167 | case RISCVVector::BI__builtin_rvv_vsoxseg6ei32_v_m: |
15168 | case RISCVVector::BI__builtin_rvv_vsoxseg6ei64_v_m: |
15169 | ID = Intrinsic::riscv_vsoxseg6_mask; |
15170 | NF = 6; |
15171 | DefaultPolicy = 0; |
15172 | |
15173 | { |
15174 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
15175 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
15176 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15177 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15178 | IntrinsicTypes = {Ops[0]->getType(), |
15179 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
15180 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15180, __extension__ __PRETTY_FUNCTION__)); |
15181 | } |
15182 | break; |
15183 | case RISCVVector::BI__builtin_rvv_vsoxseg7ei8_v: |
15184 | case RISCVVector::BI__builtin_rvv_vsoxseg7ei16_v: |
15185 | case RISCVVector::BI__builtin_rvv_vsoxseg7ei32_v: |
15186 | case RISCVVector::BI__builtin_rvv_vsoxseg7ei64_v: |
15187 | ID = Intrinsic::riscv_vsoxseg7; |
15188 | NF = 7; |
15189 | DefaultPolicy = 1; |
15190 | |
15191 | { |
15192 | // Builtin: (ptr, index, val0, val1, ..., vl) |
15193 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
15194 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15195 | IntrinsicTypes = {Ops[0]->getType(), |
15196 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
15197 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15197, __extension__ __PRETTY_FUNCTION__)); |
15198 | } |
15199 | break; |
15200 | case RISCVVector::BI__builtin_rvv_vsoxseg7ei8_v_m: |
15201 | case RISCVVector::BI__builtin_rvv_vsoxseg7ei16_v_m: |
15202 | case RISCVVector::BI__builtin_rvv_vsoxseg7ei32_v_m: |
15203 | case RISCVVector::BI__builtin_rvv_vsoxseg7ei64_v_m: |
15204 | ID = Intrinsic::riscv_vsoxseg7_mask; |
15205 | NF = 7; |
15206 | DefaultPolicy = 0; |
15207 | |
15208 | { |
15209 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
15210 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
15211 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15212 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15213 | IntrinsicTypes = {Ops[0]->getType(), |
15214 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
15215 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15215, __extension__ __PRETTY_FUNCTION__)); |
15216 | } |
15217 | break; |
15218 | case RISCVVector::BI__builtin_rvv_vsoxseg8ei8_v: |
15219 | case RISCVVector::BI__builtin_rvv_vsoxseg8ei16_v: |
15220 | case RISCVVector::BI__builtin_rvv_vsoxseg8ei32_v: |
15221 | case RISCVVector::BI__builtin_rvv_vsoxseg8ei64_v: |
15222 | ID = Intrinsic::riscv_vsoxseg8; |
15223 | NF = 8; |
15224 | DefaultPolicy = 1; |
15225 | |
15226 | { |
15227 | // Builtin: (ptr, index, val0, val1, ..., vl) |
15228 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
15229 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15230 | IntrinsicTypes = {Ops[0]->getType(), |
15231 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
15232 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15232, __extension__ __PRETTY_FUNCTION__)); |
15233 | } |
15234 | break; |
15235 | case RISCVVector::BI__builtin_rvv_vsoxseg8ei8_v_m: |
15236 | case RISCVVector::BI__builtin_rvv_vsoxseg8ei16_v_m: |
15237 | case RISCVVector::BI__builtin_rvv_vsoxseg8ei32_v_m: |
15238 | case RISCVVector::BI__builtin_rvv_vsoxseg8ei64_v_m: |
15239 | ID = Intrinsic::riscv_vsoxseg8_mask; |
15240 | NF = 8; |
15241 | DefaultPolicy = 0; |
15242 | |
15243 | { |
15244 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
15245 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
15246 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15247 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15248 | IntrinsicTypes = {Ops[0]->getType(), |
15249 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
15250 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15250, __extension__ __PRETTY_FUNCTION__)); |
15251 | } |
15252 | break; |
15253 | case RISCVVector::BI__builtin_rvv_vsra_vv_tu: |
15254 | case RISCVVector::BI__builtin_rvv_vsra_vx_tu: |
15255 | ID = Intrinsic::riscv_vsra; |
15256 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15257 | break; |
15258 | case RISCVVector::BI__builtin_rvv_vsra_vv_ta: |
15259 | case RISCVVector::BI__builtin_rvv_vsra_vx_ta: |
15260 | ID = Intrinsic::riscv_vsra; |
15261 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15262 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15263 | break; |
15264 | case RISCVVector::BI__builtin_rvv_vsra_vv_tuma: |
15265 | case RISCVVector::BI__builtin_rvv_vsra_vx_tuma: |
15266 | ID = Intrinsic::riscv_vsra_mask; |
15267 | DefaultPolicy = 2; |
15268 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15269 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15270 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15271 | break; |
15272 | case RISCVVector::BI__builtin_rvv_vsra_vv_tama: |
15273 | case RISCVVector::BI__builtin_rvv_vsra_vx_tama: |
15274 | ID = Intrinsic::riscv_vsra_mask; |
15275 | DefaultPolicy = 3; |
15276 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15277 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15278 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15279 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15280 | break; |
15281 | case RISCVVector::BI__builtin_rvv_vsra_vv_tumu: |
15282 | case RISCVVector::BI__builtin_rvv_vsra_vx_tumu: |
15283 | ID = Intrinsic::riscv_vsra_mask; |
15284 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15285 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15286 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15287 | break; |
15288 | case RISCVVector::BI__builtin_rvv_vsra_vv_tamu: |
15289 | case RISCVVector::BI__builtin_rvv_vsra_vx_tamu: |
15290 | ID = Intrinsic::riscv_vsra_mask; |
15291 | DefaultPolicy = 1; |
15292 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15293 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15294 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15295 | break; |
15296 | case RISCVVector::BI__builtin_rvv_vsrl_vv_tu: |
15297 | case RISCVVector::BI__builtin_rvv_vsrl_vx_tu: |
15298 | ID = Intrinsic::riscv_vsrl; |
15299 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15300 | break; |
15301 | case RISCVVector::BI__builtin_rvv_vsrl_vv_ta: |
15302 | case RISCVVector::BI__builtin_rvv_vsrl_vx_ta: |
15303 | ID = Intrinsic::riscv_vsrl; |
15304 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15305 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15306 | break; |
15307 | case RISCVVector::BI__builtin_rvv_vsrl_vv_tuma: |
15308 | case RISCVVector::BI__builtin_rvv_vsrl_vx_tuma: |
15309 | ID = Intrinsic::riscv_vsrl_mask; |
15310 | DefaultPolicy = 2; |
15311 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15312 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15313 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15314 | break; |
15315 | case RISCVVector::BI__builtin_rvv_vsrl_vv_tama: |
15316 | case RISCVVector::BI__builtin_rvv_vsrl_vx_tama: |
15317 | ID = Intrinsic::riscv_vsrl_mask; |
15318 | DefaultPolicy = 3; |
15319 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15320 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15321 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15322 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15323 | break; |
15324 | case RISCVVector::BI__builtin_rvv_vsrl_vv_tumu: |
15325 | case RISCVVector::BI__builtin_rvv_vsrl_vx_tumu: |
15326 | ID = Intrinsic::riscv_vsrl_mask; |
15327 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15328 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15329 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15330 | break; |
15331 | case RISCVVector::BI__builtin_rvv_vsrl_vv_tamu: |
15332 | case RISCVVector::BI__builtin_rvv_vsrl_vx_tamu: |
15333 | ID = Intrinsic::riscv_vsrl_mask; |
15334 | DefaultPolicy = 1; |
15335 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15336 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15337 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15338 | break; |
15339 | case RISCVVector::BI__builtin_rvv_vsse16_v: |
15340 | case RISCVVector::BI__builtin_rvv_vsse32_v: |
15341 | case RISCVVector::BI__builtin_rvv_vsse64_v: |
15342 | case RISCVVector::BI__builtin_rvv_vsse8_v: |
15343 | ID = Intrinsic::riscv_vsse; |
15344 | DefaultPolicy = 1; |
15345 | |
15346 | // Builtin: (ptr, stride, value, vl). Intrinsic: (value, ptr, stride, vl) |
15347 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3); |
15348 | Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); |
15349 | IntrinsicTypes = {Ops[0]->getType(), Ops[3]->getType()}; |
15350 | break; |
15351 | case RISCVVector::BI__builtin_rvv_vsse16_v_m: |
15352 | case RISCVVector::BI__builtin_rvv_vsse32_v_m: |
15353 | case RISCVVector::BI__builtin_rvv_vsse64_v_m: |
15354 | case RISCVVector::BI__builtin_rvv_vsse8_v_m: |
15355 | ID = Intrinsic::riscv_vsse_mask; |
15356 | DefaultPolicy = 0; |
15357 | |
15358 | // Builtin: (mask, ptr, stride, value, vl). Intrinsic: (value, ptr, stride, mask, vl) |
15359 | std::swap(Ops[0], Ops[3]); |
15360 | Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); |
15361 | IntrinsicTypes = {Ops[0]->getType(), Ops[4]->getType()}; |
15362 | break; |
15363 | case RISCVVector::BI__builtin_rvv_vsseg2e16_v: |
15364 | case RISCVVector::BI__builtin_rvv_vsseg2e32_v: |
15365 | case RISCVVector::BI__builtin_rvv_vsseg2e64_v: |
15366 | case RISCVVector::BI__builtin_rvv_vsseg2e8_v: |
15367 | ID = Intrinsic::riscv_vsseg2; |
15368 | NF = 2; |
15369 | DefaultPolicy = 1; |
15370 | |
15371 | { |
15372 | // Builtin: (ptr, val0, val1, ..., vl) |
15373 | // Intrinsic: (val0, val1, ..., ptr, vl) |
15374 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15375 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15376 | assert(Ops.size() == NF + 2)(static_cast <bool> (Ops.size() == NF + 2) ? void (0) : __assert_fail ("Ops.size() == NF + 2", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15376, __extension__ __PRETTY_FUNCTION__)); |
15377 | } |
15378 | break; |
15379 | case RISCVVector::BI__builtin_rvv_vsseg2e16_v_m: |
15380 | case RISCVVector::BI__builtin_rvv_vsseg2e32_v_m: |
15381 | case RISCVVector::BI__builtin_rvv_vsseg2e64_v_m: |
15382 | case RISCVVector::BI__builtin_rvv_vsseg2e8_v_m: |
15383 | ID = Intrinsic::riscv_vsseg2_mask; |
15384 | NF = 2; |
15385 | DefaultPolicy = 0; |
15386 | |
15387 | { |
15388 | // Builtin: (mask, ptr, val0, val1, ..., vl) |
15389 | // Intrinsic: (val0, val1, ..., ptr, mask, vl) |
15390 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15391 | std::swap(Ops[NF], Ops[NF + 1]); |
15392 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 2]->getType()}; |
15393 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15393, __extension__ __PRETTY_FUNCTION__)); |
15394 | } |
15395 | break; |
15396 | case RISCVVector::BI__builtin_rvv_vsseg3e8_v: |
15397 | case RISCVVector::BI__builtin_rvv_vsseg3e16_v: |
15398 | case RISCVVector::BI__builtin_rvv_vsseg3e32_v: |
15399 | case RISCVVector::BI__builtin_rvv_vsseg3e64_v: |
15400 | ID = Intrinsic::riscv_vsseg3; |
15401 | NF = 3; |
15402 | DefaultPolicy = 1; |
15403 | |
15404 | { |
15405 | // Builtin: (ptr, val0, val1, ..., vl) |
15406 | // Intrinsic: (val0, val1, ..., ptr, vl) |
15407 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15408 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15409 | assert(Ops.size() == NF + 2)(static_cast <bool> (Ops.size() == NF + 2) ? void (0) : __assert_fail ("Ops.size() == NF + 2", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15409, __extension__ __PRETTY_FUNCTION__)); |
15410 | } |
15411 | break; |
15412 | case RISCVVector::BI__builtin_rvv_vsseg3e8_v_m: |
15413 | case RISCVVector::BI__builtin_rvv_vsseg3e16_v_m: |
15414 | case RISCVVector::BI__builtin_rvv_vsseg3e32_v_m: |
15415 | case RISCVVector::BI__builtin_rvv_vsseg3e64_v_m: |
15416 | ID = Intrinsic::riscv_vsseg3_mask; |
15417 | NF = 3; |
15418 | DefaultPolicy = 0; |
15419 | |
15420 | { |
15421 | // Builtin: (mask, ptr, val0, val1, ..., vl) |
15422 | // Intrinsic: (val0, val1, ..., ptr, mask, vl) |
15423 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15424 | std::swap(Ops[NF], Ops[NF + 1]); |
15425 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 2]->getType()}; |
15426 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15426, __extension__ __PRETTY_FUNCTION__)); |
15427 | } |
15428 | break; |
15429 | case RISCVVector::BI__builtin_rvv_vsseg4e8_v: |
15430 | case RISCVVector::BI__builtin_rvv_vsseg4e16_v: |
15431 | case RISCVVector::BI__builtin_rvv_vsseg4e32_v: |
15432 | case RISCVVector::BI__builtin_rvv_vsseg4e64_v: |
15433 | ID = Intrinsic::riscv_vsseg4; |
15434 | NF = 4; |
15435 | DefaultPolicy = 1; |
15436 | |
15437 | { |
15438 | // Builtin: (ptr, val0, val1, ..., vl) |
15439 | // Intrinsic: (val0, val1, ..., ptr, vl) |
15440 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15441 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15442 | assert(Ops.size() == NF + 2)(static_cast <bool> (Ops.size() == NF + 2) ? void (0) : __assert_fail ("Ops.size() == NF + 2", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15442, __extension__ __PRETTY_FUNCTION__)); |
15443 | } |
15444 | break; |
15445 | case RISCVVector::BI__builtin_rvv_vsseg4e8_v_m: |
15446 | case RISCVVector::BI__builtin_rvv_vsseg4e16_v_m: |
15447 | case RISCVVector::BI__builtin_rvv_vsseg4e32_v_m: |
15448 | case RISCVVector::BI__builtin_rvv_vsseg4e64_v_m: |
15449 | ID = Intrinsic::riscv_vsseg4_mask; |
15450 | NF = 4; |
15451 | DefaultPolicy = 0; |
15452 | |
15453 | { |
15454 | // Builtin: (mask, ptr, val0, val1, ..., vl) |
15455 | // Intrinsic: (val0, val1, ..., ptr, mask, vl) |
15456 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15457 | std::swap(Ops[NF], Ops[NF + 1]); |
15458 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 2]->getType()}; |
15459 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15459, __extension__ __PRETTY_FUNCTION__)); |
15460 | } |
15461 | break; |
15462 | case RISCVVector::BI__builtin_rvv_vsseg5e8_v: |
15463 | case RISCVVector::BI__builtin_rvv_vsseg5e16_v: |
15464 | case RISCVVector::BI__builtin_rvv_vsseg5e32_v: |
15465 | case RISCVVector::BI__builtin_rvv_vsseg5e64_v: |
15466 | ID = Intrinsic::riscv_vsseg5; |
15467 | NF = 5; |
15468 | DefaultPolicy = 1; |
15469 | |
15470 | { |
15471 | // Builtin: (ptr, val0, val1, ..., vl) |
15472 | // Intrinsic: (val0, val1, ..., ptr, vl) |
15473 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15474 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15475 | assert(Ops.size() == NF + 2)(static_cast <bool> (Ops.size() == NF + 2) ? void (0) : __assert_fail ("Ops.size() == NF + 2", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15475, __extension__ __PRETTY_FUNCTION__)); |
15476 | } |
15477 | break; |
15478 | case RISCVVector::BI__builtin_rvv_vsseg5e8_v_m: |
15479 | case RISCVVector::BI__builtin_rvv_vsseg5e16_v_m: |
15480 | case RISCVVector::BI__builtin_rvv_vsseg5e32_v_m: |
15481 | case RISCVVector::BI__builtin_rvv_vsseg5e64_v_m: |
15482 | ID = Intrinsic::riscv_vsseg5_mask; |
15483 | NF = 5; |
15484 | DefaultPolicy = 0; |
15485 | |
15486 | { |
15487 | // Builtin: (mask, ptr, val0, val1, ..., vl) |
15488 | // Intrinsic: (val0, val1, ..., ptr, mask, vl) |
15489 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15490 | std::swap(Ops[NF], Ops[NF + 1]); |
15491 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 2]->getType()}; |
15492 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15492, __extension__ __PRETTY_FUNCTION__)); |
15493 | } |
15494 | break; |
15495 | case RISCVVector::BI__builtin_rvv_vsseg6e8_v: |
15496 | case RISCVVector::BI__builtin_rvv_vsseg6e16_v: |
15497 | case RISCVVector::BI__builtin_rvv_vsseg6e32_v: |
15498 | case RISCVVector::BI__builtin_rvv_vsseg6e64_v: |
15499 | ID = Intrinsic::riscv_vsseg6; |
15500 | NF = 6; |
15501 | DefaultPolicy = 1; |
15502 | |
15503 | { |
15504 | // Builtin: (ptr, val0, val1, ..., vl) |
15505 | // Intrinsic: (val0, val1, ..., ptr, vl) |
15506 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15507 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15508 | assert(Ops.size() == NF + 2)(static_cast <bool> (Ops.size() == NF + 2) ? void (0) : __assert_fail ("Ops.size() == NF + 2", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15508, __extension__ __PRETTY_FUNCTION__)); |
15509 | } |
15510 | break; |
15511 | case RISCVVector::BI__builtin_rvv_vsseg6e8_v_m: |
15512 | case RISCVVector::BI__builtin_rvv_vsseg6e16_v_m: |
15513 | case RISCVVector::BI__builtin_rvv_vsseg6e32_v_m: |
15514 | case RISCVVector::BI__builtin_rvv_vsseg6e64_v_m: |
15515 | ID = Intrinsic::riscv_vsseg6_mask; |
15516 | NF = 6; |
15517 | DefaultPolicy = 0; |
15518 | |
15519 | { |
15520 | // Builtin: (mask, ptr, val0, val1, ..., vl) |
15521 | // Intrinsic: (val0, val1, ..., ptr, mask, vl) |
15522 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15523 | std::swap(Ops[NF], Ops[NF + 1]); |
15524 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 2]->getType()}; |
15525 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15525, __extension__ __PRETTY_FUNCTION__)); |
15526 | } |
15527 | break; |
15528 | case RISCVVector::BI__builtin_rvv_vsseg7e8_v: |
15529 | case RISCVVector::BI__builtin_rvv_vsseg7e16_v: |
15530 | case RISCVVector::BI__builtin_rvv_vsseg7e32_v: |
15531 | case RISCVVector::BI__builtin_rvv_vsseg7e64_v: |
15532 | ID = Intrinsic::riscv_vsseg7; |
15533 | NF = 7; |
15534 | DefaultPolicy = 1; |
15535 | |
15536 | { |
15537 | // Builtin: (ptr, val0, val1, ..., vl) |
15538 | // Intrinsic: (val0, val1, ..., ptr, vl) |
15539 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15540 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15541 | assert(Ops.size() == NF + 2)(static_cast <bool> (Ops.size() == NF + 2) ? void (0) : __assert_fail ("Ops.size() == NF + 2", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15541, __extension__ __PRETTY_FUNCTION__)); |
15542 | } |
15543 | break; |
15544 | case RISCVVector::BI__builtin_rvv_vsseg7e8_v_m: |
15545 | case RISCVVector::BI__builtin_rvv_vsseg7e16_v_m: |
15546 | case RISCVVector::BI__builtin_rvv_vsseg7e32_v_m: |
15547 | case RISCVVector::BI__builtin_rvv_vsseg7e64_v_m: |
15548 | ID = Intrinsic::riscv_vsseg7_mask; |
15549 | NF = 7; |
15550 | DefaultPolicy = 0; |
15551 | |
15552 | { |
15553 | // Builtin: (mask, ptr, val0, val1, ..., vl) |
15554 | // Intrinsic: (val0, val1, ..., ptr, mask, vl) |
15555 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15556 | std::swap(Ops[NF], Ops[NF + 1]); |
15557 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 2]->getType()}; |
15558 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15558, __extension__ __PRETTY_FUNCTION__)); |
15559 | } |
15560 | break; |
15561 | case RISCVVector::BI__builtin_rvv_vsseg8e8_v: |
15562 | case RISCVVector::BI__builtin_rvv_vsseg8e16_v: |
15563 | case RISCVVector::BI__builtin_rvv_vsseg8e32_v: |
15564 | case RISCVVector::BI__builtin_rvv_vsseg8e64_v: |
15565 | ID = Intrinsic::riscv_vsseg8; |
15566 | NF = 8; |
15567 | DefaultPolicy = 1; |
15568 | |
15569 | { |
15570 | // Builtin: (ptr, val0, val1, ..., vl) |
15571 | // Intrinsic: (val0, val1, ..., ptr, vl) |
15572 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15573 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15574 | assert(Ops.size() == NF + 2)(static_cast <bool> (Ops.size() == NF + 2) ? void (0) : __assert_fail ("Ops.size() == NF + 2", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15574, __extension__ __PRETTY_FUNCTION__)); |
15575 | } |
15576 | break; |
15577 | case RISCVVector::BI__builtin_rvv_vsseg8e8_v_m: |
15578 | case RISCVVector::BI__builtin_rvv_vsseg8e16_v_m: |
15579 | case RISCVVector::BI__builtin_rvv_vsseg8e32_v_m: |
15580 | case RISCVVector::BI__builtin_rvv_vsseg8e64_v_m: |
15581 | ID = Intrinsic::riscv_vsseg8_mask; |
15582 | NF = 8; |
15583 | DefaultPolicy = 0; |
15584 | |
15585 | { |
15586 | // Builtin: (mask, ptr, val0, val1, ..., vl) |
15587 | // Intrinsic: (val0, val1, ..., ptr, mask, vl) |
15588 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15589 | std::swap(Ops[NF], Ops[NF + 1]); |
15590 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 2]->getType()}; |
15591 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15591, __extension__ __PRETTY_FUNCTION__)); |
15592 | } |
15593 | break; |
15594 | case RISCVVector::BI__builtin_rvv_vssra_vv_tu: |
15595 | case RISCVVector::BI__builtin_rvv_vssra_vx_tu: |
15596 | ID = Intrinsic::riscv_vssra; |
15597 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15598 | break; |
15599 | case RISCVVector::BI__builtin_rvv_vssra_vv_ta: |
15600 | case RISCVVector::BI__builtin_rvv_vssra_vx_ta: |
15601 | ID = Intrinsic::riscv_vssra; |
15602 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15603 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15604 | break; |
15605 | case RISCVVector::BI__builtin_rvv_vssra_vv_tuma: |
15606 | case RISCVVector::BI__builtin_rvv_vssra_vx_tuma: |
15607 | ID = Intrinsic::riscv_vssra_mask; |
15608 | DefaultPolicy = 2; |
15609 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15610 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15611 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15612 | break; |
15613 | case RISCVVector::BI__builtin_rvv_vssra_vv_tama: |
15614 | case RISCVVector::BI__builtin_rvv_vssra_vx_tama: |
15615 | ID = Intrinsic::riscv_vssra_mask; |
15616 | DefaultPolicy = 3; |
15617 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15618 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15619 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15620 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15621 | break; |
15622 | case RISCVVector::BI__builtin_rvv_vssra_vv_tumu: |
15623 | case RISCVVector::BI__builtin_rvv_vssra_vx_tumu: |
15624 | ID = Intrinsic::riscv_vssra_mask; |
15625 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15626 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15627 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15628 | break; |
15629 | case RISCVVector::BI__builtin_rvv_vssra_vv_tamu: |
15630 | case RISCVVector::BI__builtin_rvv_vssra_vx_tamu: |
15631 | ID = Intrinsic::riscv_vssra_mask; |
15632 | DefaultPolicy = 1; |
15633 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15634 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15635 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15636 | break; |
15637 | case RISCVVector::BI__builtin_rvv_vssrl_vv_tu: |
15638 | case RISCVVector::BI__builtin_rvv_vssrl_vx_tu: |
15639 | ID = Intrinsic::riscv_vssrl; |
15640 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15641 | break; |
15642 | case RISCVVector::BI__builtin_rvv_vssrl_vv_ta: |
15643 | case RISCVVector::BI__builtin_rvv_vssrl_vx_ta: |
15644 | ID = Intrinsic::riscv_vssrl; |
15645 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15646 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15647 | break; |
15648 | case RISCVVector::BI__builtin_rvv_vssrl_vv_tuma: |
15649 | case RISCVVector::BI__builtin_rvv_vssrl_vx_tuma: |
15650 | ID = Intrinsic::riscv_vssrl_mask; |
15651 | DefaultPolicy = 2; |
15652 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15653 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15654 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15655 | break; |
15656 | case RISCVVector::BI__builtin_rvv_vssrl_vv_tama: |
15657 | case RISCVVector::BI__builtin_rvv_vssrl_vx_tama: |
15658 | ID = Intrinsic::riscv_vssrl_mask; |
15659 | DefaultPolicy = 3; |
15660 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15661 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15662 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15663 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15664 | break; |
15665 | case RISCVVector::BI__builtin_rvv_vssrl_vv_tumu: |
15666 | case RISCVVector::BI__builtin_rvv_vssrl_vx_tumu: |
15667 | ID = Intrinsic::riscv_vssrl_mask; |
15668 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15669 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15670 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15671 | break; |
15672 | case RISCVVector::BI__builtin_rvv_vssrl_vv_tamu: |
15673 | case RISCVVector::BI__builtin_rvv_vssrl_vx_tamu: |
15674 | ID = Intrinsic::riscv_vssrl_mask; |
15675 | DefaultPolicy = 1; |
15676 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15677 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15678 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15679 | break; |
15680 | case RISCVVector::BI__builtin_rvv_vssseg2e16_v: |
15681 | case RISCVVector::BI__builtin_rvv_vssseg2e32_v: |
15682 | case RISCVVector::BI__builtin_rvv_vssseg2e64_v: |
15683 | case RISCVVector::BI__builtin_rvv_vssseg2e8_v: |
15684 | ID = Intrinsic::riscv_vssseg2; |
15685 | NF = 2; |
15686 | DefaultPolicy = 1; |
15687 | |
15688 | { |
15689 | // Builtin: (ptr, stride, val0, val1, ..., vl). |
15690 | // Intrinsic: (val0, val1, ..., ptr, stride, vl) |
15691 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15692 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15693 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15693, __extension__ __PRETTY_FUNCTION__)); |
15694 | } |
15695 | break; |
15696 | case RISCVVector::BI__builtin_rvv_vssseg2e16_v_m: |
15697 | case RISCVVector::BI__builtin_rvv_vssseg2e32_v_m: |
15698 | case RISCVVector::BI__builtin_rvv_vssseg2e64_v_m: |
15699 | case RISCVVector::BI__builtin_rvv_vssseg2e8_v_m: |
15700 | ID = Intrinsic::riscv_vssseg2_mask; |
15701 | NF = 2; |
15702 | DefaultPolicy = 0; |
15703 | |
15704 | { |
15705 | // Builtin: (mask, ptr, stride, val0, val1, ..., vl). |
15706 | // Intrinsic: (val0, val1, ..., ptr, stride, mask, vl) |
15707 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15708 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15709 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15710 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15710, __extension__ __PRETTY_FUNCTION__)); |
15711 | } |
15712 | break; |
15713 | case RISCVVector::BI__builtin_rvv_vssseg3e8_v: |
15714 | case RISCVVector::BI__builtin_rvv_vssseg3e16_v: |
15715 | case RISCVVector::BI__builtin_rvv_vssseg3e32_v: |
15716 | case RISCVVector::BI__builtin_rvv_vssseg3e64_v: |
15717 | ID = Intrinsic::riscv_vssseg3; |
15718 | NF = 3; |
15719 | DefaultPolicy = 1; |
15720 | |
15721 | { |
15722 | // Builtin: (ptr, stride, val0, val1, ..., vl). |
15723 | // Intrinsic: (val0, val1, ..., ptr, stride, vl) |
15724 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15725 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15726 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15726, __extension__ __PRETTY_FUNCTION__)); |
15727 | } |
15728 | break; |
15729 | case RISCVVector::BI__builtin_rvv_vssseg3e8_v_m: |
15730 | case RISCVVector::BI__builtin_rvv_vssseg3e16_v_m: |
15731 | case RISCVVector::BI__builtin_rvv_vssseg3e32_v_m: |
15732 | case RISCVVector::BI__builtin_rvv_vssseg3e64_v_m: |
15733 | ID = Intrinsic::riscv_vssseg3_mask; |
15734 | NF = 3; |
15735 | DefaultPolicy = 0; |
15736 | |
15737 | { |
15738 | // Builtin: (mask, ptr, stride, val0, val1, ..., vl). |
15739 | // Intrinsic: (val0, val1, ..., ptr, stride, mask, vl) |
15740 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15741 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15742 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15743 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15743, __extension__ __PRETTY_FUNCTION__)); |
15744 | } |
15745 | break; |
15746 | case RISCVVector::BI__builtin_rvv_vssseg4e8_v: |
15747 | case RISCVVector::BI__builtin_rvv_vssseg4e16_v: |
15748 | case RISCVVector::BI__builtin_rvv_vssseg4e32_v: |
15749 | case RISCVVector::BI__builtin_rvv_vssseg4e64_v: |
15750 | ID = Intrinsic::riscv_vssseg4; |
15751 | NF = 4; |
15752 | DefaultPolicy = 1; |
15753 | |
15754 | { |
15755 | // Builtin: (ptr, stride, val0, val1, ..., vl). |
15756 | // Intrinsic: (val0, val1, ..., ptr, stride, vl) |
15757 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15758 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15759 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15759, __extension__ __PRETTY_FUNCTION__)); |
15760 | } |
15761 | break; |
15762 | case RISCVVector::BI__builtin_rvv_vssseg4e8_v_m: |
15763 | case RISCVVector::BI__builtin_rvv_vssseg4e16_v_m: |
15764 | case RISCVVector::BI__builtin_rvv_vssseg4e32_v_m: |
15765 | case RISCVVector::BI__builtin_rvv_vssseg4e64_v_m: |
15766 | ID = Intrinsic::riscv_vssseg4_mask; |
15767 | NF = 4; |
15768 | DefaultPolicy = 0; |
15769 | |
15770 | { |
15771 | // Builtin: (mask, ptr, stride, val0, val1, ..., vl). |
15772 | // Intrinsic: (val0, val1, ..., ptr, stride, mask, vl) |
15773 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15774 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15775 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15776 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15776, __extension__ __PRETTY_FUNCTION__)); |
15777 | } |
15778 | break; |
15779 | case RISCVVector::BI__builtin_rvv_vssseg5e8_v: |
15780 | case RISCVVector::BI__builtin_rvv_vssseg5e16_v: |
15781 | case RISCVVector::BI__builtin_rvv_vssseg5e32_v: |
15782 | case RISCVVector::BI__builtin_rvv_vssseg5e64_v: |
15783 | ID = Intrinsic::riscv_vssseg5; |
15784 | NF = 5; |
15785 | DefaultPolicy = 1; |
15786 | |
15787 | { |
15788 | // Builtin: (ptr, stride, val0, val1, ..., vl). |
15789 | // Intrinsic: (val0, val1, ..., ptr, stride, vl) |
15790 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15791 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15792 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15792, __extension__ __PRETTY_FUNCTION__)); |
15793 | } |
15794 | break; |
15795 | case RISCVVector::BI__builtin_rvv_vssseg5e8_v_m: |
15796 | case RISCVVector::BI__builtin_rvv_vssseg5e16_v_m: |
15797 | case RISCVVector::BI__builtin_rvv_vssseg5e32_v_m: |
15798 | case RISCVVector::BI__builtin_rvv_vssseg5e64_v_m: |
15799 | ID = Intrinsic::riscv_vssseg5_mask; |
15800 | NF = 5; |
15801 | DefaultPolicy = 0; |
15802 | |
15803 | { |
15804 | // Builtin: (mask, ptr, stride, val0, val1, ..., vl). |
15805 | // Intrinsic: (val0, val1, ..., ptr, stride, mask, vl) |
15806 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15807 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15808 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15809 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15809, __extension__ __PRETTY_FUNCTION__)); |
15810 | } |
15811 | break; |
15812 | case RISCVVector::BI__builtin_rvv_vssseg6e8_v: |
15813 | case RISCVVector::BI__builtin_rvv_vssseg6e16_v: |
15814 | case RISCVVector::BI__builtin_rvv_vssseg6e32_v: |
15815 | case RISCVVector::BI__builtin_rvv_vssseg6e64_v: |
15816 | ID = Intrinsic::riscv_vssseg6; |
15817 | NF = 6; |
15818 | DefaultPolicy = 1; |
15819 | |
15820 | { |
15821 | // Builtin: (ptr, stride, val0, val1, ..., vl). |
15822 | // Intrinsic: (val0, val1, ..., ptr, stride, vl) |
15823 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15824 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15825 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15825, __extension__ __PRETTY_FUNCTION__)); |
15826 | } |
15827 | break; |
15828 | case RISCVVector::BI__builtin_rvv_vssseg6e8_v_m: |
15829 | case RISCVVector::BI__builtin_rvv_vssseg6e16_v_m: |
15830 | case RISCVVector::BI__builtin_rvv_vssseg6e32_v_m: |
15831 | case RISCVVector::BI__builtin_rvv_vssseg6e64_v_m: |
15832 | ID = Intrinsic::riscv_vssseg6_mask; |
15833 | NF = 6; |
15834 | DefaultPolicy = 0; |
15835 | |
15836 | { |
15837 | // Builtin: (mask, ptr, stride, val0, val1, ..., vl). |
15838 | // Intrinsic: (val0, val1, ..., ptr, stride, mask, vl) |
15839 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15840 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15841 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15842 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15842, __extension__ __PRETTY_FUNCTION__)); |
15843 | } |
15844 | break; |
15845 | case RISCVVector::BI__builtin_rvv_vssseg7e8_v: |
15846 | case RISCVVector::BI__builtin_rvv_vssseg7e16_v: |
15847 | case RISCVVector::BI__builtin_rvv_vssseg7e32_v: |
15848 | case RISCVVector::BI__builtin_rvv_vssseg7e64_v: |
15849 | ID = Intrinsic::riscv_vssseg7; |
15850 | NF = 7; |
15851 | DefaultPolicy = 1; |
15852 | |
15853 | { |
15854 | // Builtin: (ptr, stride, val0, val1, ..., vl). |
15855 | // Intrinsic: (val0, val1, ..., ptr, stride, vl) |
15856 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15857 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15858 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15858, __extension__ __PRETTY_FUNCTION__)); |
15859 | } |
15860 | break; |
15861 | case RISCVVector::BI__builtin_rvv_vssseg7e8_v_m: |
15862 | case RISCVVector::BI__builtin_rvv_vssseg7e16_v_m: |
15863 | case RISCVVector::BI__builtin_rvv_vssseg7e32_v_m: |
15864 | case RISCVVector::BI__builtin_rvv_vssseg7e64_v_m: |
15865 | ID = Intrinsic::riscv_vssseg7_mask; |
15866 | NF = 7; |
15867 | DefaultPolicy = 0; |
15868 | |
15869 | { |
15870 | // Builtin: (mask, ptr, stride, val0, val1, ..., vl). |
15871 | // Intrinsic: (val0, val1, ..., ptr, stride, mask, vl) |
15872 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15873 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15874 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15875 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15875, __extension__ __PRETTY_FUNCTION__)); |
15876 | } |
15877 | break; |
15878 | case RISCVVector::BI__builtin_rvv_vssseg8e8_v: |
15879 | case RISCVVector::BI__builtin_rvv_vssseg8e16_v: |
15880 | case RISCVVector::BI__builtin_rvv_vssseg8e32_v: |
15881 | case RISCVVector::BI__builtin_rvv_vssseg8e64_v: |
15882 | ID = Intrinsic::riscv_vssseg8; |
15883 | NF = 8; |
15884 | DefaultPolicy = 1; |
15885 | |
15886 | { |
15887 | // Builtin: (ptr, stride, val0, val1, ..., vl). |
15888 | // Intrinsic: (val0, val1, ..., ptr, stride, vl) |
15889 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
15890 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15891 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15891, __extension__ __PRETTY_FUNCTION__)); |
15892 | } |
15893 | break; |
15894 | case RISCVVector::BI__builtin_rvv_vssseg8e8_v_m: |
15895 | case RISCVVector::BI__builtin_rvv_vssseg8e16_v_m: |
15896 | case RISCVVector::BI__builtin_rvv_vssseg8e32_v_m: |
15897 | case RISCVVector::BI__builtin_rvv_vssseg8e64_v_m: |
15898 | ID = Intrinsic::riscv_vssseg8_mask; |
15899 | NF = 8; |
15900 | DefaultPolicy = 0; |
15901 | |
15902 | { |
15903 | // Builtin: (mask, ptr, stride, val0, val1, ..., vl). |
15904 | // Intrinsic: (val0, val1, ..., ptr, stride, mask, vl) |
15905 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
15906 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
15907 | IntrinsicTypes = {Ops[0]->getType(), Ops[NF + 1]->getType()}; |
15908 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 15908, __extension__ __PRETTY_FUNCTION__)); |
15909 | } |
15910 | break; |
15911 | case RISCVVector::BI__builtin_rvv_vssub_vv_tu: |
15912 | case RISCVVector::BI__builtin_rvv_vssub_vx_tu: |
15913 | ID = Intrinsic::riscv_vssub; |
15914 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15915 | break; |
15916 | case RISCVVector::BI__builtin_rvv_vssub_vv_ta: |
15917 | case RISCVVector::BI__builtin_rvv_vssub_vx_ta: |
15918 | ID = Intrinsic::riscv_vssub; |
15919 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15920 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15921 | break; |
15922 | case RISCVVector::BI__builtin_rvv_vssub_vv_tuma: |
15923 | case RISCVVector::BI__builtin_rvv_vssub_vx_tuma: |
15924 | ID = Intrinsic::riscv_vssub_mask; |
15925 | DefaultPolicy = 2; |
15926 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15927 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15928 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15929 | break; |
15930 | case RISCVVector::BI__builtin_rvv_vssub_vv_tama: |
15931 | case RISCVVector::BI__builtin_rvv_vssub_vx_tama: |
15932 | ID = Intrinsic::riscv_vssub_mask; |
15933 | DefaultPolicy = 3; |
15934 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15935 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15936 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15937 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15938 | break; |
15939 | case RISCVVector::BI__builtin_rvv_vssub_vv_tumu: |
15940 | case RISCVVector::BI__builtin_rvv_vssub_vx_tumu: |
15941 | ID = Intrinsic::riscv_vssub_mask; |
15942 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15943 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15944 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15945 | break; |
15946 | case RISCVVector::BI__builtin_rvv_vssub_vv_tamu: |
15947 | case RISCVVector::BI__builtin_rvv_vssub_vx_tamu: |
15948 | ID = Intrinsic::riscv_vssub_mask; |
15949 | DefaultPolicy = 1; |
15950 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15951 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15952 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15953 | break; |
15954 | case RISCVVector::BI__builtin_rvv_vssubu_vv_tu: |
15955 | case RISCVVector::BI__builtin_rvv_vssubu_vx_tu: |
15956 | ID = Intrinsic::riscv_vssubu; |
15957 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15958 | break; |
15959 | case RISCVVector::BI__builtin_rvv_vssubu_vv_ta: |
15960 | case RISCVVector::BI__builtin_rvv_vssubu_vx_ta: |
15961 | ID = Intrinsic::riscv_vssubu; |
15962 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15963 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15964 | break; |
15965 | case RISCVVector::BI__builtin_rvv_vssubu_vv_tuma: |
15966 | case RISCVVector::BI__builtin_rvv_vssubu_vx_tuma: |
15967 | ID = Intrinsic::riscv_vssubu_mask; |
15968 | DefaultPolicy = 2; |
15969 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15970 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15971 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15972 | break; |
15973 | case RISCVVector::BI__builtin_rvv_vssubu_vv_tama: |
15974 | case RISCVVector::BI__builtin_rvv_vssubu_vx_tama: |
15975 | ID = Intrinsic::riscv_vssubu_mask; |
15976 | DefaultPolicy = 3; |
15977 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15978 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15979 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
15980 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15981 | break; |
15982 | case RISCVVector::BI__builtin_rvv_vssubu_vv_tumu: |
15983 | case RISCVVector::BI__builtin_rvv_vssubu_vx_tumu: |
15984 | ID = Intrinsic::riscv_vssubu_mask; |
15985 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15986 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15987 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15988 | break; |
15989 | case RISCVVector::BI__builtin_rvv_vssubu_vv_tamu: |
15990 | case RISCVVector::BI__builtin_rvv_vssubu_vx_tamu: |
15991 | ID = Intrinsic::riscv_vssubu_mask; |
15992 | DefaultPolicy = 1; |
15993 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
15994 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
15995 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
15996 | break; |
15997 | case RISCVVector::BI__builtin_rvv_vsub_vv_tu: |
15998 | case RISCVVector::BI__builtin_rvv_vsub_vx_tu: |
15999 | ID = Intrinsic::riscv_vsub; |
16000 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16001 | break; |
16002 | case RISCVVector::BI__builtin_rvv_vsub_vv_ta: |
16003 | case RISCVVector::BI__builtin_rvv_vsub_vx_ta: |
16004 | ID = Intrinsic::riscv_vsub; |
16005 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16006 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16007 | break; |
16008 | case RISCVVector::BI__builtin_rvv_vsub_vv_tuma: |
16009 | case RISCVVector::BI__builtin_rvv_vsub_vx_tuma: |
16010 | ID = Intrinsic::riscv_vsub_mask; |
16011 | DefaultPolicy = 2; |
16012 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16013 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16014 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16015 | break; |
16016 | case RISCVVector::BI__builtin_rvv_vsub_vv_tama: |
16017 | case RISCVVector::BI__builtin_rvv_vsub_vx_tama: |
16018 | ID = Intrinsic::riscv_vsub_mask; |
16019 | DefaultPolicy = 3; |
16020 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16021 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16022 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16023 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16024 | break; |
16025 | case RISCVVector::BI__builtin_rvv_vsub_vv_tumu: |
16026 | case RISCVVector::BI__builtin_rvv_vsub_vx_tumu: |
16027 | ID = Intrinsic::riscv_vsub_mask; |
16028 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16029 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16030 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16031 | break; |
16032 | case RISCVVector::BI__builtin_rvv_vsub_vv_tamu: |
16033 | case RISCVVector::BI__builtin_rvv_vsub_vx_tamu: |
16034 | ID = Intrinsic::riscv_vsub_mask; |
16035 | DefaultPolicy = 1; |
16036 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16037 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16038 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16039 | break; |
16040 | case RISCVVector::BI__builtin_rvv_vsuxei16_v: |
16041 | case RISCVVector::BI__builtin_rvv_vsuxei32_v: |
16042 | case RISCVVector::BI__builtin_rvv_vsuxei8_v: |
16043 | case RISCVVector::BI__builtin_rvv_vsuxei64_v: |
16044 | ID = Intrinsic::riscv_vsuxei; |
16045 | DefaultPolicy = 1; |
16046 | |
16047 | // Builtin: (ptr, index, value, vl). Intrinsic: (value, ptr, index, vl) |
16048 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.begin() + 3); |
16049 | Ops[1] = Builder.CreateBitCast(Ops[1],Ops[0]->getType()->getPointerTo()); |
16050 | IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType(), Ops[3]->getType()}; |
16051 | break; |
16052 | case RISCVVector::BI__builtin_rvv_vsuxei16_v_m: |
16053 | case RISCVVector::BI__builtin_rvv_vsuxei32_v_m: |
16054 | case RISCVVector::BI__builtin_rvv_vsuxei8_v_m: |
16055 | case RISCVVector::BI__builtin_rvv_vsuxei64_v_m: |
16056 | ID = Intrinsic::riscv_vsuxei_mask; |
16057 | DefaultPolicy = 0; |
16058 | |
16059 | // Builtin: (mask, ptr, index, value, vl). Intrinsic: (value, ptr, index, mask, vl) |
16060 | std::swap(Ops[0], Ops[3]); |
16061 | Ops[1] = Builder.CreateBitCast(Ops[1], Ops[0]->getType()->getPointerTo()); |
16062 | IntrinsicTypes = {Ops[0]->getType(), Ops[2]->getType(), Ops[4]->getType()}; |
16063 | break; |
16064 | case RISCVVector::BI__builtin_rvv_vsuxseg2ei16_v: |
16065 | case RISCVVector::BI__builtin_rvv_vsuxseg2ei32_v: |
16066 | case RISCVVector::BI__builtin_rvv_vsuxseg2ei64_v: |
16067 | case RISCVVector::BI__builtin_rvv_vsuxseg2ei8_v: |
16068 | ID = Intrinsic::riscv_vsuxseg2; |
16069 | NF = 2; |
16070 | DefaultPolicy = 1; |
16071 | |
16072 | { |
16073 | // Builtin: (ptr, index, val0, val1, ..., vl) |
16074 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
16075 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
16076 | IntrinsicTypes = {Ops[0]->getType(), |
16077 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
16078 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16078, __extension__ __PRETTY_FUNCTION__)); |
16079 | } |
16080 | break; |
16081 | case RISCVVector::BI__builtin_rvv_vsuxseg2ei16_v_m: |
16082 | case RISCVVector::BI__builtin_rvv_vsuxseg2ei32_v_m: |
16083 | case RISCVVector::BI__builtin_rvv_vsuxseg2ei64_v_m: |
16084 | case RISCVVector::BI__builtin_rvv_vsuxseg2ei8_v_m: |
16085 | ID = Intrinsic::riscv_vsuxseg2_mask; |
16086 | NF = 2; |
16087 | DefaultPolicy = 0; |
16088 | |
16089 | { |
16090 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
16091 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
16092 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
16093 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
16094 | IntrinsicTypes = {Ops[0]->getType(), |
16095 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
16096 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16096, __extension__ __PRETTY_FUNCTION__)); |
16097 | } |
16098 | break; |
16099 | case RISCVVector::BI__builtin_rvv_vsuxseg3ei8_v: |
16100 | case RISCVVector::BI__builtin_rvv_vsuxseg3ei16_v: |
16101 | case RISCVVector::BI__builtin_rvv_vsuxseg3ei32_v: |
16102 | case RISCVVector::BI__builtin_rvv_vsuxseg3ei64_v: |
16103 | ID = Intrinsic::riscv_vsuxseg3; |
16104 | NF = 3; |
16105 | DefaultPolicy = 1; |
16106 | |
16107 | { |
16108 | // Builtin: (ptr, index, val0, val1, ..., vl) |
16109 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
16110 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
16111 | IntrinsicTypes = {Ops[0]->getType(), |
16112 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
16113 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16113, __extension__ __PRETTY_FUNCTION__)); |
16114 | } |
16115 | break; |
16116 | case RISCVVector::BI__builtin_rvv_vsuxseg3ei8_v_m: |
16117 | case RISCVVector::BI__builtin_rvv_vsuxseg3ei16_v_m: |
16118 | case RISCVVector::BI__builtin_rvv_vsuxseg3ei32_v_m: |
16119 | case RISCVVector::BI__builtin_rvv_vsuxseg3ei64_v_m: |
16120 | ID = Intrinsic::riscv_vsuxseg3_mask; |
16121 | NF = 3; |
16122 | DefaultPolicy = 0; |
16123 | |
16124 | { |
16125 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
16126 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
16127 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
16128 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
16129 | IntrinsicTypes = {Ops[0]->getType(), |
16130 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
16131 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16131, __extension__ __PRETTY_FUNCTION__)); |
16132 | } |
16133 | break; |
16134 | case RISCVVector::BI__builtin_rvv_vsuxseg4ei8_v: |
16135 | case RISCVVector::BI__builtin_rvv_vsuxseg4ei16_v: |
16136 | case RISCVVector::BI__builtin_rvv_vsuxseg4ei32_v: |
16137 | case RISCVVector::BI__builtin_rvv_vsuxseg4ei64_v: |
16138 | ID = Intrinsic::riscv_vsuxseg4; |
16139 | NF = 4; |
16140 | DefaultPolicy = 1; |
16141 | |
16142 | { |
16143 | // Builtin: (ptr, index, val0, val1, ..., vl) |
16144 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
16145 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
16146 | IntrinsicTypes = {Ops[0]->getType(), |
16147 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
16148 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16148, __extension__ __PRETTY_FUNCTION__)); |
16149 | } |
16150 | break; |
16151 | case RISCVVector::BI__builtin_rvv_vsuxseg4ei8_v_m: |
16152 | case RISCVVector::BI__builtin_rvv_vsuxseg4ei16_v_m: |
16153 | case RISCVVector::BI__builtin_rvv_vsuxseg4ei32_v_m: |
16154 | case RISCVVector::BI__builtin_rvv_vsuxseg4ei64_v_m: |
16155 | ID = Intrinsic::riscv_vsuxseg4_mask; |
16156 | NF = 4; |
16157 | DefaultPolicy = 0; |
16158 | |
16159 | { |
16160 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
16161 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
16162 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
16163 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
16164 | IntrinsicTypes = {Ops[0]->getType(), |
16165 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
16166 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16166, __extension__ __PRETTY_FUNCTION__)); |
16167 | } |
16168 | break; |
16169 | case RISCVVector::BI__builtin_rvv_vsuxseg5ei8_v: |
16170 | case RISCVVector::BI__builtin_rvv_vsuxseg5ei16_v: |
16171 | case RISCVVector::BI__builtin_rvv_vsuxseg5ei32_v: |
16172 | case RISCVVector::BI__builtin_rvv_vsuxseg5ei64_v: |
16173 | ID = Intrinsic::riscv_vsuxseg5; |
16174 | NF = 5; |
16175 | DefaultPolicy = 1; |
16176 | |
16177 | { |
16178 | // Builtin: (ptr, index, val0, val1, ..., vl) |
16179 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
16180 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
16181 | IntrinsicTypes = {Ops[0]->getType(), |
16182 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
16183 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16183, __extension__ __PRETTY_FUNCTION__)); |
16184 | } |
16185 | break; |
16186 | case RISCVVector::BI__builtin_rvv_vsuxseg5ei8_v_m: |
16187 | case RISCVVector::BI__builtin_rvv_vsuxseg5ei16_v_m: |
16188 | case RISCVVector::BI__builtin_rvv_vsuxseg5ei32_v_m: |
16189 | case RISCVVector::BI__builtin_rvv_vsuxseg5ei64_v_m: |
16190 | ID = Intrinsic::riscv_vsuxseg5_mask; |
16191 | NF = 5; |
16192 | DefaultPolicy = 0; |
16193 | |
16194 | { |
16195 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
16196 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
16197 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
16198 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
16199 | IntrinsicTypes = {Ops[0]->getType(), |
16200 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
16201 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16201, __extension__ __PRETTY_FUNCTION__)); |
16202 | } |
16203 | break; |
16204 | case RISCVVector::BI__builtin_rvv_vsuxseg6ei8_v: |
16205 | case RISCVVector::BI__builtin_rvv_vsuxseg6ei16_v: |
16206 | case RISCVVector::BI__builtin_rvv_vsuxseg6ei32_v: |
16207 | case RISCVVector::BI__builtin_rvv_vsuxseg6ei64_v: |
16208 | ID = Intrinsic::riscv_vsuxseg6; |
16209 | NF = 6; |
16210 | DefaultPolicy = 1; |
16211 | |
16212 | { |
16213 | // Builtin: (ptr, index, val0, val1, ..., vl) |
16214 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
16215 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
16216 | IntrinsicTypes = {Ops[0]->getType(), |
16217 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
16218 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16218, __extension__ __PRETTY_FUNCTION__)); |
16219 | } |
16220 | break; |
16221 | case RISCVVector::BI__builtin_rvv_vsuxseg6ei8_v_m: |
16222 | case RISCVVector::BI__builtin_rvv_vsuxseg6ei16_v_m: |
16223 | case RISCVVector::BI__builtin_rvv_vsuxseg6ei32_v_m: |
16224 | case RISCVVector::BI__builtin_rvv_vsuxseg6ei64_v_m: |
16225 | ID = Intrinsic::riscv_vsuxseg6_mask; |
16226 | NF = 6; |
16227 | DefaultPolicy = 0; |
16228 | |
16229 | { |
16230 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
16231 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
16232 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
16233 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
16234 | IntrinsicTypes = {Ops[0]->getType(), |
16235 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
16236 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16236, __extension__ __PRETTY_FUNCTION__)); |
16237 | } |
16238 | break; |
16239 | case RISCVVector::BI__builtin_rvv_vsuxseg7ei8_v: |
16240 | case RISCVVector::BI__builtin_rvv_vsuxseg7ei16_v: |
16241 | case RISCVVector::BI__builtin_rvv_vsuxseg7ei32_v: |
16242 | case RISCVVector::BI__builtin_rvv_vsuxseg7ei64_v: |
16243 | ID = Intrinsic::riscv_vsuxseg7; |
16244 | NF = 7; |
16245 | DefaultPolicy = 1; |
16246 | |
16247 | { |
16248 | // Builtin: (ptr, index, val0, val1, ..., vl) |
16249 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
16250 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
16251 | IntrinsicTypes = {Ops[0]->getType(), |
16252 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
16253 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16253, __extension__ __PRETTY_FUNCTION__)); |
16254 | } |
16255 | break; |
16256 | case RISCVVector::BI__builtin_rvv_vsuxseg7ei8_v_m: |
16257 | case RISCVVector::BI__builtin_rvv_vsuxseg7ei16_v_m: |
16258 | case RISCVVector::BI__builtin_rvv_vsuxseg7ei32_v_m: |
16259 | case RISCVVector::BI__builtin_rvv_vsuxseg7ei64_v_m: |
16260 | ID = Intrinsic::riscv_vsuxseg7_mask; |
16261 | NF = 7; |
16262 | DefaultPolicy = 0; |
16263 | |
16264 | { |
16265 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
16266 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
16267 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
16268 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
16269 | IntrinsicTypes = {Ops[0]->getType(), |
16270 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
16271 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16271, __extension__ __PRETTY_FUNCTION__)); |
16272 | } |
16273 | break; |
16274 | case RISCVVector::BI__builtin_rvv_vsuxseg8ei8_v: |
16275 | case RISCVVector::BI__builtin_rvv_vsuxseg8ei16_v: |
16276 | case RISCVVector::BI__builtin_rvv_vsuxseg8ei32_v: |
16277 | case RISCVVector::BI__builtin_rvv_vsuxseg8ei64_v: |
16278 | ID = Intrinsic::riscv_vsuxseg8; |
16279 | NF = 8; |
16280 | DefaultPolicy = 1; |
16281 | |
16282 | { |
16283 | // Builtin: (ptr, index, val0, val1, ..., vl) |
16284 | // Intrinsic: (val0, val1, ..., ptr, index, vl) |
16285 | std::rotate(Ops.begin(), Ops.begin() + 2, Ops.end() - 1); |
16286 | IntrinsicTypes = {Ops[0]->getType(), |
16287 | Ops[NF + 1]->getType(), Ops[NF + 2]->getType()}; |
16288 | assert(Ops.size() == NF + 3)(static_cast <bool> (Ops.size() == NF + 3) ? void (0) : __assert_fail ("Ops.size() == NF + 3", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16288, __extension__ __PRETTY_FUNCTION__)); |
16289 | } |
16290 | break; |
16291 | case RISCVVector::BI__builtin_rvv_vsuxseg8ei8_v_m: |
16292 | case RISCVVector::BI__builtin_rvv_vsuxseg8ei16_v_m: |
16293 | case RISCVVector::BI__builtin_rvv_vsuxseg8ei32_v_m: |
16294 | case RISCVVector::BI__builtin_rvv_vsuxseg8ei64_v_m: |
16295 | ID = Intrinsic::riscv_vsuxseg8_mask; |
16296 | NF = 8; |
16297 | DefaultPolicy = 0; |
16298 | |
16299 | { |
16300 | // Builtin: (mask, ptr, index, val0, val1, ..., vl) |
16301 | // Intrinsic: (val0, val1, ..., ptr, index, mask, vl) |
16302 | std::rotate(Ops.begin(), Ops.begin() + 3, Ops.end() - 1); |
16303 | std::rotate(Ops.begin() + NF, Ops.begin() + NF + 1, Ops.begin() + NF + 3); |
16304 | IntrinsicTypes = {Ops[0]->getType(), |
16305 | Ops[NF + 1]->getType(), Ops[NF + 3]->getType()}; |
16306 | assert(Ops.size() == NF + 4)(static_cast <bool> (Ops.size() == NF + 4) ? void (0) : __assert_fail ("Ops.size() == NF + 4", "tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc" , 16306, __extension__ __PRETTY_FUNCTION__)); |
16307 | } |
16308 | break; |
16309 | case RISCVVector::BI__builtin_rvv_vwadd_vv_tu: |
16310 | case RISCVVector::BI__builtin_rvv_vwadd_vx_tu: |
16311 | ID = Intrinsic::riscv_vwadd; |
16312 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16313 | break; |
16314 | case RISCVVector::BI__builtin_rvv_vwcvt_x_x_v_tu: |
16315 | ID = Intrinsic::riscv_vwadd; |
16316 | DefaultPolicy = 0; |
16317 | |
16318 | { |
16319 | if (DefaultPolicy == TAIL_AGNOSTIC) |
16320 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16321 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16322 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16323 | // passtru, op1, op2, vl |
16324 | IntrinsicTypes = {ResultType, |
16325 | Ops[1]->getType(), |
16326 | ElemTy, |
16327 | Ops[3]->getType()}; |
16328 | break; |
16329 | } |
16330 | break; |
16331 | case RISCVVector::BI__builtin_rvv_vwadd_vv_ta: |
16332 | case RISCVVector::BI__builtin_rvv_vwadd_vx_ta: |
16333 | ID = Intrinsic::riscv_vwadd; |
16334 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16335 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16336 | break; |
16337 | case RISCVVector::BI__builtin_rvv_vwcvt_x_x_v_ta: |
16338 | ID = Intrinsic::riscv_vwadd; |
16339 | DefaultPolicy = 1; |
16340 | |
16341 | { |
16342 | if (DefaultPolicy == TAIL_AGNOSTIC) |
16343 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16344 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16345 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16346 | // passtru, op1, op2, vl |
16347 | IntrinsicTypes = {ResultType, |
16348 | Ops[1]->getType(), |
16349 | ElemTy, |
16350 | Ops[3]->getType()}; |
16351 | break; |
16352 | } |
16353 | break; |
16354 | case RISCVVector::BI__builtin_rvv_vwadd_vv_tuma: |
16355 | case RISCVVector::BI__builtin_rvv_vwadd_vx_tuma: |
16356 | ID = Intrinsic::riscv_vwadd_mask; |
16357 | DefaultPolicy = 2; |
16358 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16359 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16360 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16361 | break; |
16362 | case RISCVVector::BI__builtin_rvv_vwcvt_x_x_v_tuma: |
16363 | ID = Intrinsic::riscv_vwadd_mask; |
16364 | DefaultPolicy = 2; |
16365 | |
16366 | { |
16367 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16368 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
16369 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16370 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16371 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16372 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16373 | // maskedoff, op1, op2, mask, vl, policy |
16374 | IntrinsicTypes = {ResultType, |
16375 | Ops[1]->getType(), |
16376 | ElemTy, |
16377 | Ops[4]->getType()}; |
16378 | break; |
16379 | } |
16380 | break; |
16381 | case RISCVVector::BI__builtin_rvv_vwadd_vv_tama: |
16382 | case RISCVVector::BI__builtin_rvv_vwadd_vx_tama: |
16383 | ID = Intrinsic::riscv_vwadd_mask; |
16384 | DefaultPolicy = 3; |
16385 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16386 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16387 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16388 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16389 | break; |
16390 | case RISCVVector::BI__builtin_rvv_vwcvt_x_x_v_tama: |
16391 | ID = Intrinsic::riscv_vwadd_mask; |
16392 | DefaultPolicy = 3; |
16393 | |
16394 | { |
16395 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16396 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
16397 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16398 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16399 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16400 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16401 | // maskedoff, op1, op2, mask, vl, policy |
16402 | IntrinsicTypes = {ResultType, |
16403 | Ops[1]->getType(), |
16404 | ElemTy, |
16405 | Ops[4]->getType()}; |
16406 | break; |
16407 | } |
16408 | break; |
16409 | case RISCVVector::BI__builtin_rvv_vwadd_vv_tumu: |
16410 | case RISCVVector::BI__builtin_rvv_vwadd_vx_tumu: |
16411 | ID = Intrinsic::riscv_vwadd_mask; |
16412 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16413 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16414 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16415 | break; |
16416 | case RISCVVector::BI__builtin_rvv_vwcvt_x_x_v_tumu: |
16417 | ID = Intrinsic::riscv_vwadd_mask; |
16418 | DefaultPolicy = 0; |
16419 | |
16420 | { |
16421 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16422 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
16423 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16424 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16425 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16426 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16427 | // maskedoff, op1, op2, mask, vl, policy |
16428 | IntrinsicTypes = {ResultType, |
16429 | Ops[1]->getType(), |
16430 | ElemTy, |
16431 | Ops[4]->getType()}; |
16432 | break; |
16433 | } |
16434 | break; |
16435 | case RISCVVector::BI__builtin_rvv_vwadd_vv_tamu: |
16436 | case RISCVVector::BI__builtin_rvv_vwadd_vx_tamu: |
16437 | ID = Intrinsic::riscv_vwadd_mask; |
16438 | DefaultPolicy = 1; |
16439 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16440 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16441 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16442 | break; |
16443 | case RISCVVector::BI__builtin_rvv_vwcvt_x_x_v_tamu: |
16444 | ID = Intrinsic::riscv_vwadd_mask; |
16445 | DefaultPolicy = 1; |
16446 | |
16447 | { |
16448 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16449 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
16450 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16451 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16452 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16453 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16454 | // maskedoff, op1, op2, mask, vl, policy |
16455 | IntrinsicTypes = {ResultType, |
16456 | Ops[1]->getType(), |
16457 | ElemTy, |
16458 | Ops[4]->getType()}; |
16459 | break; |
16460 | } |
16461 | break; |
16462 | case RISCVVector::BI__builtin_rvv_vwadd_wv_tu: |
16463 | case RISCVVector::BI__builtin_rvv_vwadd_wx_tu: |
16464 | ID = Intrinsic::riscv_vwadd_w; |
16465 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16466 | break; |
16467 | case RISCVVector::BI__builtin_rvv_vwadd_wv_ta: |
16468 | case RISCVVector::BI__builtin_rvv_vwadd_wx_ta: |
16469 | ID = Intrinsic::riscv_vwadd_w; |
16470 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16471 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16472 | break; |
16473 | case RISCVVector::BI__builtin_rvv_vwadd_wv_tuma: |
16474 | case RISCVVector::BI__builtin_rvv_vwadd_wx_tuma: |
16475 | ID = Intrinsic::riscv_vwadd_w_mask; |
16476 | DefaultPolicy = 2; |
16477 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16478 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16479 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16480 | break; |
16481 | case RISCVVector::BI__builtin_rvv_vwadd_wv_tama: |
16482 | case RISCVVector::BI__builtin_rvv_vwadd_wx_tama: |
16483 | ID = Intrinsic::riscv_vwadd_w_mask; |
16484 | DefaultPolicy = 3; |
16485 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16486 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16487 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16488 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16489 | break; |
16490 | case RISCVVector::BI__builtin_rvv_vwadd_wv_tumu: |
16491 | case RISCVVector::BI__builtin_rvv_vwadd_wx_tumu: |
16492 | ID = Intrinsic::riscv_vwadd_w_mask; |
16493 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16494 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16495 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16496 | break; |
16497 | case RISCVVector::BI__builtin_rvv_vwadd_wv_tamu: |
16498 | case RISCVVector::BI__builtin_rvv_vwadd_wx_tamu: |
16499 | ID = Intrinsic::riscv_vwadd_w_mask; |
16500 | DefaultPolicy = 1; |
16501 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16502 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16503 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16504 | break; |
16505 | case RISCVVector::BI__builtin_rvv_vwaddu_vv_tu: |
16506 | case RISCVVector::BI__builtin_rvv_vwaddu_vx_tu: |
16507 | ID = Intrinsic::riscv_vwaddu; |
16508 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16509 | break; |
16510 | case RISCVVector::BI__builtin_rvv_vwcvtu_x_x_v_tu: |
16511 | ID = Intrinsic::riscv_vwaddu; |
16512 | DefaultPolicy = 0; |
16513 | |
16514 | { |
16515 | if (DefaultPolicy == TAIL_AGNOSTIC) |
16516 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16517 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16518 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16519 | // passtru, op1, op2, vl |
16520 | IntrinsicTypes = {ResultType, |
16521 | Ops[1]->getType(), |
16522 | ElemTy, |
16523 | Ops[3]->getType()}; |
16524 | break; |
16525 | } |
16526 | break; |
16527 | case RISCVVector::BI__builtin_rvv_vwaddu_vv_ta: |
16528 | case RISCVVector::BI__builtin_rvv_vwaddu_vx_ta: |
16529 | ID = Intrinsic::riscv_vwaddu; |
16530 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16531 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16532 | break; |
16533 | case RISCVVector::BI__builtin_rvv_vwcvtu_x_x_v_ta: |
16534 | ID = Intrinsic::riscv_vwaddu; |
16535 | DefaultPolicy = 1; |
16536 | |
16537 | { |
16538 | if (DefaultPolicy == TAIL_AGNOSTIC) |
16539 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16540 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16541 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16542 | // passtru, op1, op2, vl |
16543 | IntrinsicTypes = {ResultType, |
16544 | Ops[1]->getType(), |
16545 | ElemTy, |
16546 | Ops[3]->getType()}; |
16547 | break; |
16548 | } |
16549 | break; |
16550 | case RISCVVector::BI__builtin_rvv_vwaddu_vv_tuma: |
16551 | case RISCVVector::BI__builtin_rvv_vwaddu_vx_tuma: |
16552 | ID = Intrinsic::riscv_vwaddu_mask; |
16553 | DefaultPolicy = 2; |
16554 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16555 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16556 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16557 | break; |
16558 | case RISCVVector::BI__builtin_rvv_vwcvtu_x_x_v_tuma: |
16559 | ID = Intrinsic::riscv_vwaddu_mask; |
16560 | DefaultPolicy = 2; |
16561 | |
16562 | { |
16563 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16564 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
16565 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16566 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16567 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16568 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16569 | // maskedoff, op1, op2, mask, vl, policy |
16570 | IntrinsicTypes = {ResultType, |
16571 | Ops[1]->getType(), |
16572 | ElemTy, |
16573 | Ops[4]->getType()}; |
16574 | break; |
16575 | } |
16576 | break; |
16577 | case RISCVVector::BI__builtin_rvv_vwaddu_vv_tama: |
16578 | case RISCVVector::BI__builtin_rvv_vwaddu_vx_tama: |
16579 | ID = Intrinsic::riscv_vwaddu_mask; |
16580 | DefaultPolicy = 3; |
16581 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16582 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16583 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16584 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16585 | break; |
16586 | case RISCVVector::BI__builtin_rvv_vwcvtu_x_x_v_tama: |
16587 | ID = Intrinsic::riscv_vwaddu_mask; |
16588 | DefaultPolicy = 3; |
16589 | |
16590 | { |
16591 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16592 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
16593 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16594 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16595 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16596 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16597 | // maskedoff, op1, op2, mask, vl, policy |
16598 | IntrinsicTypes = {ResultType, |
16599 | Ops[1]->getType(), |
16600 | ElemTy, |
16601 | Ops[4]->getType()}; |
16602 | break; |
16603 | } |
16604 | break; |
16605 | case RISCVVector::BI__builtin_rvv_vwaddu_vv_tumu: |
16606 | case RISCVVector::BI__builtin_rvv_vwaddu_vx_tumu: |
16607 | ID = Intrinsic::riscv_vwaddu_mask; |
16608 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16609 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16610 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16611 | break; |
16612 | case RISCVVector::BI__builtin_rvv_vwcvtu_x_x_v_tumu: |
16613 | ID = Intrinsic::riscv_vwaddu_mask; |
16614 | DefaultPolicy = 0; |
16615 | |
16616 | { |
16617 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16618 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
16619 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16620 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16621 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16622 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16623 | // maskedoff, op1, op2, mask, vl, policy |
16624 | IntrinsicTypes = {ResultType, |
16625 | Ops[1]->getType(), |
16626 | ElemTy, |
16627 | Ops[4]->getType()}; |
16628 | break; |
16629 | } |
16630 | break; |
16631 | case RISCVVector::BI__builtin_rvv_vwaddu_vv_tamu: |
16632 | case RISCVVector::BI__builtin_rvv_vwaddu_vx_tamu: |
16633 | ID = Intrinsic::riscv_vwaddu_mask; |
16634 | DefaultPolicy = 1; |
16635 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16636 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16637 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16638 | break; |
16639 | case RISCVVector::BI__builtin_rvv_vwcvtu_x_x_v_tamu: |
16640 | ID = Intrinsic::riscv_vwaddu_mask; |
16641 | DefaultPolicy = 1; |
16642 | |
16643 | { |
16644 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16645 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
16646 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
16647 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
16648 | Ops.insert(Ops.begin() + 2, llvm::Constant::getNullValue(ElemTy)); |
16649 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16650 | // maskedoff, op1, op2, mask, vl, policy |
16651 | IntrinsicTypes = {ResultType, |
16652 | Ops[1]->getType(), |
16653 | ElemTy, |
16654 | Ops[4]->getType()}; |
16655 | break; |
16656 | } |
16657 | break; |
16658 | case RISCVVector::BI__builtin_rvv_vwaddu_wx_tu: |
16659 | case RISCVVector::BI__builtin_rvv_vwaddu_wv_tu: |
16660 | ID = Intrinsic::riscv_vwaddu_w; |
16661 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16662 | break; |
16663 | case RISCVVector::BI__builtin_rvv_vwaddu_wx_ta: |
16664 | case RISCVVector::BI__builtin_rvv_vwaddu_wv_ta: |
16665 | ID = Intrinsic::riscv_vwaddu_w; |
16666 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16667 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16668 | break; |
16669 | case RISCVVector::BI__builtin_rvv_vwaddu_wx_tuma: |
16670 | case RISCVVector::BI__builtin_rvv_vwaddu_wv_tuma: |
16671 | ID = Intrinsic::riscv_vwaddu_w_mask; |
16672 | DefaultPolicy = 2; |
16673 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16674 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16675 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16676 | break; |
16677 | case RISCVVector::BI__builtin_rvv_vwaddu_wx_tama: |
16678 | case RISCVVector::BI__builtin_rvv_vwaddu_wv_tama: |
16679 | ID = Intrinsic::riscv_vwaddu_w_mask; |
16680 | DefaultPolicy = 3; |
16681 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16682 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16683 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16684 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16685 | break; |
16686 | case RISCVVector::BI__builtin_rvv_vwaddu_wx_tumu: |
16687 | case RISCVVector::BI__builtin_rvv_vwaddu_wv_tumu: |
16688 | ID = Intrinsic::riscv_vwaddu_w_mask; |
16689 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16690 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16691 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16692 | break; |
16693 | case RISCVVector::BI__builtin_rvv_vwaddu_wx_tamu: |
16694 | case RISCVVector::BI__builtin_rvv_vwaddu_wv_tamu: |
16695 | ID = Intrinsic::riscv_vwaddu_w_mask; |
16696 | DefaultPolicy = 1; |
16697 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16698 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16699 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
16700 | break; |
16701 | case RISCVVector::BI__builtin_rvv_vwmacc_vv_tu: |
16702 | case RISCVVector::BI__builtin_rvv_vwmacc_vx_tu: |
16703 | ID = Intrinsic::riscv_vwmacc; |
16704 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16705 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16706 | break; |
16707 | case RISCVVector::BI__builtin_rvv_vwmacc_vv_ta: |
16708 | case RISCVVector::BI__builtin_rvv_vwmacc_vx_ta: |
16709 | ID = Intrinsic::riscv_vwmacc; |
16710 | DefaultPolicy = 1; |
16711 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16712 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16713 | break; |
16714 | case RISCVVector::BI__builtin_rvv_vwmacc_vv_tuma: |
16715 | case RISCVVector::BI__builtin_rvv_vwmacc_vx_tuma: |
16716 | ID = Intrinsic::riscv_vwmacc_mask; |
16717 | DefaultPolicy = 2; |
16718 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16719 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16720 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16721 | break; |
16722 | case RISCVVector::BI__builtin_rvv_vwmacc_vv_tama: |
16723 | case RISCVVector::BI__builtin_rvv_vwmacc_vx_tama: |
16724 | ID = Intrinsic::riscv_vwmacc_mask; |
16725 | DefaultPolicy = 3; |
16726 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16727 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16728 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16729 | break; |
16730 | case RISCVVector::BI__builtin_rvv_vwmacc_vv_tumu: |
16731 | case RISCVVector::BI__builtin_rvv_vwmacc_vx_tumu: |
16732 | ID = Intrinsic::riscv_vwmacc_mask; |
16733 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16734 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16735 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16736 | break; |
16737 | case RISCVVector::BI__builtin_rvv_vwmacc_vv_tamu: |
16738 | case RISCVVector::BI__builtin_rvv_vwmacc_vx_tamu: |
16739 | ID = Intrinsic::riscv_vwmacc_mask; |
16740 | DefaultPolicy = 1; |
16741 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16742 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16743 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16744 | break; |
16745 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vv_tu: |
16746 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vx_tu: |
16747 | ID = Intrinsic::riscv_vwmaccsu; |
16748 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16749 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16750 | break; |
16751 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vv_ta: |
16752 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vx_ta: |
16753 | ID = Intrinsic::riscv_vwmaccsu; |
16754 | DefaultPolicy = 1; |
16755 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16756 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16757 | break; |
16758 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vv_tuma: |
16759 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vx_tuma: |
16760 | ID = Intrinsic::riscv_vwmaccsu_mask; |
16761 | DefaultPolicy = 2; |
16762 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16763 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16764 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16765 | break; |
16766 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vv_tama: |
16767 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vx_tama: |
16768 | ID = Intrinsic::riscv_vwmaccsu_mask; |
16769 | DefaultPolicy = 3; |
16770 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16771 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16772 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16773 | break; |
16774 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vv_tumu: |
16775 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vx_tumu: |
16776 | ID = Intrinsic::riscv_vwmaccsu_mask; |
16777 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16778 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16779 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16780 | break; |
16781 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vv_tamu: |
16782 | case RISCVVector::BI__builtin_rvv_vwmaccsu_vx_tamu: |
16783 | ID = Intrinsic::riscv_vwmaccsu_mask; |
16784 | DefaultPolicy = 1; |
16785 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16786 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16787 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16788 | break; |
16789 | case RISCVVector::BI__builtin_rvv_vwmaccu_vv_tu: |
16790 | case RISCVVector::BI__builtin_rvv_vwmaccu_vx_tu: |
16791 | ID = Intrinsic::riscv_vwmaccu; |
16792 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16793 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16794 | break; |
16795 | case RISCVVector::BI__builtin_rvv_vwmaccu_vv_ta: |
16796 | case RISCVVector::BI__builtin_rvv_vwmaccu_vx_ta: |
16797 | ID = Intrinsic::riscv_vwmaccu; |
16798 | DefaultPolicy = 1; |
16799 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16800 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16801 | break; |
16802 | case RISCVVector::BI__builtin_rvv_vwmaccu_vv_tuma: |
16803 | case RISCVVector::BI__builtin_rvv_vwmaccu_vx_tuma: |
16804 | ID = Intrinsic::riscv_vwmaccu_mask; |
16805 | DefaultPolicy = 2; |
16806 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16807 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16808 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16809 | break; |
16810 | case RISCVVector::BI__builtin_rvv_vwmaccu_vv_tama: |
16811 | case RISCVVector::BI__builtin_rvv_vwmaccu_vx_tama: |
16812 | ID = Intrinsic::riscv_vwmaccu_mask; |
16813 | DefaultPolicy = 3; |
16814 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16815 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16816 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16817 | break; |
16818 | case RISCVVector::BI__builtin_rvv_vwmaccu_vv_tumu: |
16819 | case RISCVVector::BI__builtin_rvv_vwmaccu_vx_tumu: |
16820 | ID = Intrinsic::riscv_vwmaccu_mask; |
16821 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16822 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16823 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16824 | break; |
16825 | case RISCVVector::BI__builtin_rvv_vwmaccu_vv_tamu: |
16826 | case RISCVVector::BI__builtin_rvv_vwmaccu_vx_tamu: |
16827 | ID = Intrinsic::riscv_vwmaccu_mask; |
16828 | DefaultPolicy = 1; |
16829 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16830 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16831 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16832 | break; |
16833 | case RISCVVector::BI__builtin_rvv_vwmaccus_vx_tu: |
16834 | ID = Intrinsic::riscv_vwmaccus; |
16835 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16836 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16837 | break; |
16838 | case RISCVVector::BI__builtin_rvv_vwmaccus_vx_ta: |
16839 | ID = Intrinsic::riscv_vwmaccus; |
16840 | DefaultPolicy = 1; |
16841 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16842 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16843 | break; |
16844 | case RISCVVector::BI__builtin_rvv_vwmaccus_vx_tuma: |
16845 | ID = Intrinsic::riscv_vwmaccus_mask; |
16846 | DefaultPolicy = 2; |
16847 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16848 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16849 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16850 | break; |
16851 | case RISCVVector::BI__builtin_rvv_vwmaccus_vx_tama: |
16852 | ID = Intrinsic::riscv_vwmaccus_mask; |
16853 | DefaultPolicy = 3; |
16854 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16855 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16856 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16857 | break; |
16858 | case RISCVVector::BI__builtin_rvv_vwmaccus_vx_tumu: |
16859 | ID = Intrinsic::riscv_vwmaccus_mask; |
16860 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16861 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16862 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16863 | break; |
16864 | case RISCVVector::BI__builtin_rvv_vwmaccus_vx_tamu: |
16865 | ID = Intrinsic::riscv_vwmaccus_mask; |
16866 | DefaultPolicy = 1; |
16867 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16868 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16869 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16870 | break; |
16871 | case RISCVVector::BI__builtin_rvv_vwmul_vv_tu: |
16872 | case RISCVVector::BI__builtin_rvv_vwmul_vx_tu: |
16873 | ID = Intrinsic::riscv_vwmul; |
16874 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16875 | break; |
16876 | case RISCVVector::BI__builtin_rvv_vwmul_vv_ta: |
16877 | case RISCVVector::BI__builtin_rvv_vwmul_vx_ta: |
16878 | ID = Intrinsic::riscv_vwmul; |
16879 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16880 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16881 | break; |
16882 | case RISCVVector::BI__builtin_rvv_vwmul_vv_tuma: |
16883 | case RISCVVector::BI__builtin_rvv_vwmul_vx_tuma: |
16884 | ID = Intrinsic::riscv_vwmul_mask; |
16885 | DefaultPolicy = 2; |
16886 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16887 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16888 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16889 | break; |
16890 | case RISCVVector::BI__builtin_rvv_vwmul_vv_tama: |
16891 | case RISCVVector::BI__builtin_rvv_vwmul_vx_tama: |
16892 | ID = Intrinsic::riscv_vwmul_mask; |
16893 | DefaultPolicy = 3; |
16894 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16895 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16896 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16897 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16898 | break; |
16899 | case RISCVVector::BI__builtin_rvv_vwmul_vv_tumu: |
16900 | case RISCVVector::BI__builtin_rvv_vwmul_vx_tumu: |
16901 | ID = Intrinsic::riscv_vwmul_mask; |
16902 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16903 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16904 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16905 | break; |
16906 | case RISCVVector::BI__builtin_rvv_vwmul_vv_tamu: |
16907 | case RISCVVector::BI__builtin_rvv_vwmul_vx_tamu: |
16908 | ID = Intrinsic::riscv_vwmul_mask; |
16909 | DefaultPolicy = 1; |
16910 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16911 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16912 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16913 | break; |
16914 | case RISCVVector::BI__builtin_rvv_vwmulsu_vv_tu: |
16915 | case RISCVVector::BI__builtin_rvv_vwmulsu_vx_tu: |
16916 | ID = Intrinsic::riscv_vwmulsu; |
16917 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16918 | break; |
16919 | case RISCVVector::BI__builtin_rvv_vwmulsu_vv_ta: |
16920 | case RISCVVector::BI__builtin_rvv_vwmulsu_vx_ta: |
16921 | ID = Intrinsic::riscv_vwmulsu; |
16922 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16923 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16924 | break; |
16925 | case RISCVVector::BI__builtin_rvv_vwmulsu_vv_tuma: |
16926 | case RISCVVector::BI__builtin_rvv_vwmulsu_vx_tuma: |
16927 | ID = Intrinsic::riscv_vwmulsu_mask; |
16928 | DefaultPolicy = 2; |
16929 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16930 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16931 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16932 | break; |
16933 | case RISCVVector::BI__builtin_rvv_vwmulsu_vv_tama: |
16934 | case RISCVVector::BI__builtin_rvv_vwmulsu_vx_tama: |
16935 | ID = Intrinsic::riscv_vwmulsu_mask; |
16936 | DefaultPolicy = 3; |
16937 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16938 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16939 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16940 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16941 | break; |
16942 | case RISCVVector::BI__builtin_rvv_vwmulsu_vv_tumu: |
16943 | case RISCVVector::BI__builtin_rvv_vwmulsu_vx_tumu: |
16944 | ID = Intrinsic::riscv_vwmulsu_mask; |
16945 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16946 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16947 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16948 | break; |
16949 | case RISCVVector::BI__builtin_rvv_vwmulsu_vv_tamu: |
16950 | case RISCVVector::BI__builtin_rvv_vwmulsu_vx_tamu: |
16951 | ID = Intrinsic::riscv_vwmulsu_mask; |
16952 | DefaultPolicy = 1; |
16953 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16954 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16955 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16956 | break; |
16957 | case RISCVVector::BI__builtin_rvv_vwmulu_vv_tu: |
16958 | case RISCVVector::BI__builtin_rvv_vwmulu_vx_tu: |
16959 | ID = Intrinsic::riscv_vwmulu; |
16960 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16961 | break; |
16962 | case RISCVVector::BI__builtin_rvv_vwmulu_vv_ta: |
16963 | case RISCVVector::BI__builtin_rvv_vwmulu_vx_ta: |
16964 | ID = Intrinsic::riscv_vwmulu; |
16965 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16966 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16967 | break; |
16968 | case RISCVVector::BI__builtin_rvv_vwmulu_vv_tuma: |
16969 | case RISCVVector::BI__builtin_rvv_vwmulu_vx_tuma: |
16970 | ID = Intrinsic::riscv_vwmulu_mask; |
16971 | DefaultPolicy = 2; |
16972 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16973 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16974 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16975 | break; |
16976 | case RISCVVector::BI__builtin_rvv_vwmulu_vv_tama: |
16977 | case RISCVVector::BI__builtin_rvv_vwmulu_vx_tama: |
16978 | ID = Intrinsic::riscv_vwmulu_mask; |
16979 | DefaultPolicy = 3; |
16980 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16981 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16982 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
16983 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16984 | break; |
16985 | case RISCVVector::BI__builtin_rvv_vwmulu_vv_tumu: |
16986 | case RISCVVector::BI__builtin_rvv_vwmulu_vx_tumu: |
16987 | ID = Intrinsic::riscv_vwmulu_mask; |
16988 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16989 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16990 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16991 | break; |
16992 | case RISCVVector::BI__builtin_rvv_vwmulu_vv_tamu: |
16993 | case RISCVVector::BI__builtin_rvv_vwmulu_vx_tamu: |
16994 | ID = Intrinsic::riscv_vwmulu_mask; |
16995 | DefaultPolicy = 1; |
16996 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
16997 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
16998 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
16999 | break; |
17000 | case RISCVVector::BI__builtin_rvv_vwredsum_vs_tu: |
17001 | ID = Intrinsic::riscv_vwredsum; |
17002 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17003 | break; |
17004 | case RISCVVector::BI__builtin_rvv_vwredsum_vs_ta: |
17005 | ID = Intrinsic::riscv_vwredsum; |
17006 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17007 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17008 | break; |
17009 | case RISCVVector::BI__builtin_rvv_vwredsum_vs_tum: |
17010 | ID = Intrinsic::riscv_vwredsum_mask; |
17011 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17012 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17013 | break; |
17014 | case RISCVVector::BI__builtin_rvv_vwredsum_vs_tam: |
17015 | ID = Intrinsic::riscv_vwredsum_mask; |
17016 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17017 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17018 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17019 | break; |
17020 | case RISCVVector::BI__builtin_rvv_vwredsum_vs_tumu: |
17021 | ID = Intrinsic::riscv_vwredsum_mask; |
17022 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17023 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17024 | break; |
17025 | case RISCVVector::BI__builtin_rvv_vwredsumu_vs_tu: |
17026 | ID = Intrinsic::riscv_vwredsumu; |
17027 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17028 | break; |
17029 | case RISCVVector::BI__builtin_rvv_vwredsumu_vs_ta: |
17030 | ID = Intrinsic::riscv_vwredsumu; |
17031 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17032 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17033 | break; |
17034 | case RISCVVector::BI__builtin_rvv_vwredsumu_vs_tum: |
17035 | ID = Intrinsic::riscv_vwredsumu_mask; |
17036 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17037 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17038 | break; |
17039 | case RISCVVector::BI__builtin_rvv_vwredsumu_vs_tam: |
17040 | ID = Intrinsic::riscv_vwredsumu_mask; |
17041 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17042 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17043 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17044 | break; |
17045 | case RISCVVector::BI__builtin_rvv_vwredsumu_vs_tumu: |
17046 | ID = Intrinsic::riscv_vwredsumu_mask; |
17047 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17048 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17049 | break; |
17050 | case RISCVVector::BI__builtin_rvv_vwsub_vv_tu: |
17051 | case RISCVVector::BI__builtin_rvv_vwsub_vx_tu: |
17052 | ID = Intrinsic::riscv_vwsub; |
17053 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17054 | break; |
17055 | case RISCVVector::BI__builtin_rvv_vwsub_vv_ta: |
17056 | case RISCVVector::BI__builtin_rvv_vwsub_vx_ta: |
17057 | ID = Intrinsic::riscv_vwsub; |
17058 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17059 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17060 | break; |
17061 | case RISCVVector::BI__builtin_rvv_vwsub_vv_tuma: |
17062 | case RISCVVector::BI__builtin_rvv_vwsub_vx_tuma: |
17063 | ID = Intrinsic::riscv_vwsub_mask; |
17064 | DefaultPolicy = 2; |
17065 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17066 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17067 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17068 | break; |
17069 | case RISCVVector::BI__builtin_rvv_vwsub_vv_tama: |
17070 | case RISCVVector::BI__builtin_rvv_vwsub_vx_tama: |
17071 | ID = Intrinsic::riscv_vwsub_mask; |
17072 | DefaultPolicy = 3; |
17073 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17074 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17075 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17076 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17077 | break; |
17078 | case RISCVVector::BI__builtin_rvv_vwsub_vv_tumu: |
17079 | case RISCVVector::BI__builtin_rvv_vwsub_vx_tumu: |
17080 | ID = Intrinsic::riscv_vwsub_mask; |
17081 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17082 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17083 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17084 | break; |
17085 | case RISCVVector::BI__builtin_rvv_vwsub_vv_tamu: |
17086 | case RISCVVector::BI__builtin_rvv_vwsub_vx_tamu: |
17087 | ID = Intrinsic::riscv_vwsub_mask; |
17088 | DefaultPolicy = 1; |
17089 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17090 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17091 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17092 | break; |
17093 | case RISCVVector::BI__builtin_rvv_vwsub_wv_tu: |
17094 | case RISCVVector::BI__builtin_rvv_vwsub_wx_tu: |
17095 | ID = Intrinsic::riscv_vwsub_w; |
17096 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17097 | break; |
17098 | case RISCVVector::BI__builtin_rvv_vwsub_wv_ta: |
17099 | case RISCVVector::BI__builtin_rvv_vwsub_wx_ta: |
17100 | ID = Intrinsic::riscv_vwsub_w; |
17101 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17102 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17103 | break; |
17104 | case RISCVVector::BI__builtin_rvv_vwsub_wv_tuma: |
17105 | case RISCVVector::BI__builtin_rvv_vwsub_wx_tuma: |
17106 | ID = Intrinsic::riscv_vwsub_w_mask; |
17107 | DefaultPolicy = 2; |
17108 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17109 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17110 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17111 | break; |
17112 | case RISCVVector::BI__builtin_rvv_vwsub_wv_tama: |
17113 | case RISCVVector::BI__builtin_rvv_vwsub_wx_tama: |
17114 | ID = Intrinsic::riscv_vwsub_w_mask; |
17115 | DefaultPolicy = 3; |
17116 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17117 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17118 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17119 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17120 | break; |
17121 | case RISCVVector::BI__builtin_rvv_vwsub_wv_tumu: |
17122 | case RISCVVector::BI__builtin_rvv_vwsub_wx_tumu: |
17123 | ID = Intrinsic::riscv_vwsub_w_mask; |
17124 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17125 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17126 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17127 | break; |
17128 | case RISCVVector::BI__builtin_rvv_vwsub_wv_tamu: |
17129 | case RISCVVector::BI__builtin_rvv_vwsub_wx_tamu: |
17130 | ID = Intrinsic::riscv_vwsub_w_mask; |
17131 | DefaultPolicy = 1; |
17132 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17133 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17134 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17135 | break; |
17136 | case RISCVVector::BI__builtin_rvv_vwsubu_vv_tu: |
17137 | case RISCVVector::BI__builtin_rvv_vwsubu_vx_tu: |
17138 | ID = Intrinsic::riscv_vwsubu; |
17139 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17140 | break; |
17141 | case RISCVVector::BI__builtin_rvv_vwsubu_vv_ta: |
17142 | case RISCVVector::BI__builtin_rvv_vwsubu_vx_ta: |
17143 | ID = Intrinsic::riscv_vwsubu; |
17144 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17145 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17146 | break; |
17147 | case RISCVVector::BI__builtin_rvv_vwsubu_vv_tuma: |
17148 | case RISCVVector::BI__builtin_rvv_vwsubu_vx_tuma: |
17149 | ID = Intrinsic::riscv_vwsubu_mask; |
17150 | DefaultPolicy = 2; |
17151 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17152 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17153 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17154 | break; |
17155 | case RISCVVector::BI__builtin_rvv_vwsubu_vv_tama: |
17156 | case RISCVVector::BI__builtin_rvv_vwsubu_vx_tama: |
17157 | ID = Intrinsic::riscv_vwsubu_mask; |
17158 | DefaultPolicy = 3; |
17159 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17160 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17161 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17162 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17163 | break; |
17164 | case RISCVVector::BI__builtin_rvv_vwsubu_vv_tumu: |
17165 | case RISCVVector::BI__builtin_rvv_vwsubu_vx_tumu: |
17166 | ID = Intrinsic::riscv_vwsubu_mask; |
17167 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17168 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17169 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17170 | break; |
17171 | case RISCVVector::BI__builtin_rvv_vwsubu_vv_tamu: |
17172 | case RISCVVector::BI__builtin_rvv_vwsubu_vx_tamu: |
17173 | ID = Intrinsic::riscv_vwsubu_mask; |
17174 | DefaultPolicy = 1; |
17175 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17176 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17177 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops[2]->getType(), Ops.back()->getType()}; |
17178 | break; |
17179 | case RISCVVector::BI__builtin_rvv_vwsubu_wv_tu: |
17180 | case RISCVVector::BI__builtin_rvv_vwsubu_wx_tu: |
17181 | ID = Intrinsic::riscv_vwsubu_w; |
17182 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17183 | break; |
17184 | case RISCVVector::BI__builtin_rvv_vwsubu_wv_ta: |
17185 | case RISCVVector::BI__builtin_rvv_vwsubu_wx_ta: |
17186 | ID = Intrinsic::riscv_vwsubu_w; |
17187 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17188 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17189 | break; |
17190 | case RISCVVector::BI__builtin_rvv_vwsubu_wv_tuma: |
17191 | case RISCVVector::BI__builtin_rvv_vwsubu_wx_tuma: |
17192 | ID = Intrinsic::riscv_vwsubu_w_mask; |
17193 | DefaultPolicy = 2; |
17194 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17195 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17196 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17197 | break; |
17198 | case RISCVVector::BI__builtin_rvv_vwsubu_wv_tama: |
17199 | case RISCVVector::BI__builtin_rvv_vwsubu_wx_tama: |
17200 | ID = Intrinsic::riscv_vwsubu_w_mask; |
17201 | DefaultPolicy = 3; |
17202 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17203 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17204 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17205 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17206 | break; |
17207 | case RISCVVector::BI__builtin_rvv_vwsubu_wv_tumu: |
17208 | case RISCVVector::BI__builtin_rvv_vwsubu_wx_tumu: |
17209 | ID = Intrinsic::riscv_vwsubu_w_mask; |
17210 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17211 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17212 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17213 | break; |
17214 | case RISCVVector::BI__builtin_rvv_vwsubu_wv_tamu: |
17215 | case RISCVVector::BI__builtin_rvv_vwsubu_wx_tamu: |
17216 | ID = Intrinsic::riscv_vwsubu_w_mask; |
17217 | DefaultPolicy = 1; |
17218 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17219 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17220 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17221 | break; |
17222 | case RISCVVector::BI__builtin_rvv_vxor_vv_tu: |
17223 | case RISCVVector::BI__builtin_rvv_vxor_vx_tu: |
17224 | ID = Intrinsic::riscv_vxor; |
17225 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17226 | break; |
17227 | case RISCVVector::BI__builtin_rvv_vnot_v_tu: |
17228 | ID = Intrinsic::riscv_vxor; |
17229 | DefaultPolicy = 0; |
17230 | |
17231 | { |
17232 | if (DefaultPolicy == TAIL_AGNOSTIC) |
17233 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
17234 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
17235 | Ops.insert(Ops.begin() + 2, |
17236 | llvm::Constant::getAllOnesValue(ElemTy)); |
17237 | // passthru, op1, op2, vl |
17238 | IntrinsicTypes = {ResultType, |
17239 | ElemTy, |
17240 | Ops[3]->getType()}; |
17241 | break; |
17242 | } |
17243 | break; |
17244 | case RISCVVector::BI__builtin_rvv_vxor_vv_ta: |
17245 | case RISCVVector::BI__builtin_rvv_vxor_vx_ta: |
17246 | ID = Intrinsic::riscv_vxor; |
17247 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17248 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17249 | break; |
17250 | case RISCVVector::BI__builtin_rvv_vnot_v_ta: |
17251 | ID = Intrinsic::riscv_vxor; |
17252 | DefaultPolicy = 1; |
17253 | |
17254 | { |
17255 | if (DefaultPolicy == TAIL_AGNOSTIC) |
17256 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
17257 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
17258 | Ops.insert(Ops.begin() + 2, |
17259 | llvm::Constant::getAllOnesValue(ElemTy)); |
17260 | // passthru, op1, op2, vl |
17261 | IntrinsicTypes = {ResultType, |
17262 | ElemTy, |
17263 | Ops[3]->getType()}; |
17264 | break; |
17265 | } |
17266 | break; |
17267 | case RISCVVector::BI__builtin_rvv_vxor_vv_tuma: |
17268 | case RISCVVector::BI__builtin_rvv_vxor_vx_tuma: |
17269 | ID = Intrinsic::riscv_vxor_mask; |
17270 | DefaultPolicy = 2; |
17271 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17272 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17273 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17274 | break; |
17275 | case RISCVVector::BI__builtin_rvv_vnot_v_tuma: |
17276 | ID = Intrinsic::riscv_vxor_mask; |
17277 | DefaultPolicy = 2; |
17278 | |
17279 | { |
17280 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17281 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
17282 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
17283 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
17284 | Ops.insert(Ops.begin() + 2, |
17285 | llvm::Constant::getAllOnesValue(ElemTy)); |
17286 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17287 | // maskedoff, op1, po2, mask, vl, policy |
17288 | IntrinsicTypes = {ResultType, |
17289 | ElemTy, |
17290 | Ops[4]->getType()}; |
17291 | break; |
17292 | } |
17293 | break; |
17294 | case RISCVVector::BI__builtin_rvv_vxor_vv_tama: |
17295 | case RISCVVector::BI__builtin_rvv_vxor_vx_tama: |
17296 | ID = Intrinsic::riscv_vxor_mask; |
17297 | DefaultPolicy = 3; |
17298 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17299 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17300 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17301 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17302 | break; |
17303 | case RISCVVector::BI__builtin_rvv_vnot_v_tama: |
17304 | ID = Intrinsic::riscv_vxor_mask; |
17305 | DefaultPolicy = 3; |
17306 | |
17307 | { |
17308 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17309 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
17310 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
17311 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
17312 | Ops.insert(Ops.begin() + 2, |
17313 | llvm::Constant::getAllOnesValue(ElemTy)); |
17314 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17315 | // maskedoff, op1, po2, mask, vl, policy |
17316 | IntrinsicTypes = {ResultType, |
17317 | ElemTy, |
17318 | Ops[4]->getType()}; |
17319 | break; |
17320 | } |
17321 | break; |
17322 | case RISCVVector::BI__builtin_rvv_vxor_vv_tumu: |
17323 | case RISCVVector::BI__builtin_rvv_vxor_vx_tumu: |
17324 | ID = Intrinsic::riscv_vxor_mask; |
17325 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17326 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17327 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17328 | break; |
17329 | case RISCVVector::BI__builtin_rvv_vnot_v_tumu: |
17330 | ID = Intrinsic::riscv_vxor_mask; |
17331 | DefaultPolicy = 0; |
17332 | |
17333 | { |
17334 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17335 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
17336 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
17337 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
17338 | Ops.insert(Ops.begin() + 2, |
17339 | llvm::Constant::getAllOnesValue(ElemTy)); |
17340 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17341 | // maskedoff, op1, po2, mask, vl, policy |
17342 | IntrinsicTypes = {ResultType, |
17343 | ElemTy, |
17344 | Ops[4]->getType()}; |
17345 | break; |
17346 | } |
17347 | break; |
17348 | case RISCVVector::BI__builtin_rvv_vxor_vv_tamu: |
17349 | case RISCVVector::BI__builtin_rvv_vxor_vx_tamu: |
17350 | ID = Intrinsic::riscv_vxor_mask; |
17351 | DefaultPolicy = 1; |
17352 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17353 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17354 | IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()}; |
17355 | break; |
17356 | case RISCVVector::BI__builtin_rvv_vnot_v_tamu: |
17357 | ID = Intrinsic::riscv_vxor_mask; |
17358 | DefaultPolicy = 1; |
17359 | |
17360 | { |
17361 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17362 | if (DefaultPolicy == TAIL_AGNOSTIC_MASK_AGNOSTIC) |
17363 | Ops.insert(Ops.begin(), llvm::PoisonValue::get(ResultType)); |
17364 | auto ElemTy = cast<llvm::VectorType>(ResultType)->getElementType(); |
17365 | Ops.insert(Ops.begin() + 2, |
17366 | llvm::Constant::getAllOnesValue(ElemTy)); |
17367 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17368 | // maskedoff, op1, po2, mask, vl, policy |
17369 | IntrinsicTypes = {ResultType, |
17370 | ElemTy, |
17371 | Ops[4]->getType()}; |
17372 | break; |
17373 | } |
17374 | break; |
17375 | case RISCVVector::BI__builtin_rvv_vzext_vf2_tu: |
17376 | case RISCVVector::BI__builtin_rvv_vzext_vf4_tu: |
17377 | case RISCVVector::BI__builtin_rvv_vzext_vf8_tu: |
17378 | ID = Intrinsic::riscv_vzext; |
17379 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17380 | break; |
17381 | case RISCVVector::BI__builtin_rvv_vzext_vf2_ta: |
17382 | case RISCVVector::BI__builtin_rvv_vzext_vf4_ta: |
17383 | case RISCVVector::BI__builtin_rvv_vzext_vf8_ta: |
17384 | ID = Intrinsic::riscv_vzext; |
17385 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17386 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17387 | break; |
17388 | case RISCVVector::BI__builtin_rvv_vzext_vf2_tuma: |
17389 | case RISCVVector::BI__builtin_rvv_vzext_vf4_tuma: |
17390 | case RISCVVector::BI__builtin_rvv_vzext_vf8_tuma: |
17391 | ID = Intrinsic::riscv_vzext_mask; |
17392 | DefaultPolicy = 2; |
17393 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17394 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17395 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17396 | break; |
17397 | case RISCVVector::BI__builtin_rvv_vzext_vf2_tama: |
17398 | case RISCVVector::BI__builtin_rvv_vzext_vf4_tama: |
17399 | case RISCVVector::BI__builtin_rvv_vzext_vf8_tama: |
17400 | ID = Intrinsic::riscv_vzext_mask; |
17401 | DefaultPolicy = 3; |
17402 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17403 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17404 | Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType)); |
17405 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17406 | break; |
17407 | case RISCVVector::BI__builtin_rvv_vzext_vf2_tumu: |
17408 | case RISCVVector::BI__builtin_rvv_vzext_vf4_tumu: |
17409 | case RISCVVector::BI__builtin_rvv_vzext_vf8_tumu: |
17410 | ID = Intrinsic::riscv_vzext_mask; |
17411 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17412 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17413 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17414 | break; |
17415 | case RISCVVector::BI__builtin_rvv_vzext_vf2_tamu: |
17416 | case RISCVVector::BI__builtin_rvv_vzext_vf4_tamu: |
17417 | case RISCVVector::BI__builtin_rvv_vzext_vf8_tamu: |
17418 | ID = Intrinsic::riscv_vzext_mask; |
17419 | DefaultPolicy = 1; |
17420 | std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1); |
17421 | Ops.push_back(ConstantInt::get(Ops.back()->getType(), DefaultPolicy)); |
17422 | IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()}; |
17423 | break; |
17424 |