Bug Summary

File:build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/build-llvm/tools/clang/include/clang/Basic/riscv_vector_builtin_cg.inc
Warning:line 13151, column 3
Value stored to 'DefaultPolicy' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CGBuiltin.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -mframe-pointer=none -relaxed-aliasing -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -ffunction-sections -fdata-sections -fcoverage-compilation-dir=/build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/build-llvm -resource-dir /usr/lib/llvm-16/lib/clang/16.0.0 -D _DEBUG -D _GNU_SOURCE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I tools/clang/lib/CodeGen -I /build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/clang/lib/CodeGen -I /build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/clang/include -I tools/clang/include -I include -I /build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/llvm/include -D _FORTIFY_SOURCE=2 -D NDEBUG -U NDEBUG -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/x86_64-linux-gnu/c++/10 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/backward -internal-isystem /usr/lib/llvm-16/lib/clang/16.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fmacro-prefix-map=/build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/build-llvm=build-llvm -fmacro-prefix-map=/build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/= -fcoverage-prefix-map=/build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/build-llvm=build-llvm -fcoverage-prefix-map=/build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/= -O3 -Wno-unused-command-line-argument -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wno-comment -Wno-misleading-indentation -std=c++17 -fdeprecated-macro -fdebug-compilation-dir=/build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/build-llvm -fdebug-prefix-map=/build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/build-llvm=build-llvm -fdebug-prefix-map=/build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/= -ferror-limit 19 -fvisibility-inlines-hidden -stack-protector 2 -fgnuc-version=4.2.1 -fcolor-diagnostics -vectorize-loops -vectorize-slp -analyzer-output=html -analyzer-config stable-report-filename=true -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2022-09-04-125545-48738-1 -x c++ /build/llvm-toolchain-snapshot-16~++20220904122748+c444af1c20b3/clang/lib/CodeGen/CGBuiltin.cpp
1case 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;
20case 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;
40case 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::UndefValue::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;
50case 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;
58case RISCVVector::BI__builtin_rvv_vreinterpret_v:
59 DefaultPolicy = 1;
60
61 return Builder.CreateBitCast(Ops[0], ResultType);
62 break;
63case RISCVVector::BI__builtin_rvv_vundefined:
64 DefaultPolicy = 1;
65
66 return llvm::UndefValue::get(ResultType);
67 break;
68case RISCVVector::BI__builtin_rvv_vaadd_vv_tu:
69case RISCVVector::BI__builtin_rvv_vaadd_vx_tu:
70 ID = Intrinsic::riscv_vaadd;
71 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
72 break;
73case RISCVVector::BI__builtin_rvv_vaadd_vv_ta:
74case 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;
79case RISCVVector::BI__builtin_rvv_vaadd_vv_tuma:
80case 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;
87case RISCVVector::BI__builtin_rvv_vaadd_vv_tama:
88case 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;
96case RISCVVector::BI__builtin_rvv_vaadd_vv_tumu:
97case 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;
103case RISCVVector::BI__builtin_rvv_vaadd_vv_tamu:
104case 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;
111case RISCVVector::BI__builtin_rvv_vaaddu_vv_tu:
112case RISCVVector::BI__builtin_rvv_vaaddu_vx_tu:
113 ID = Intrinsic::riscv_vaaddu;
114 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
115 break;
116case RISCVVector::BI__builtin_rvv_vaaddu_vv_ta:
117case 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;
122case RISCVVector::BI__builtin_rvv_vaaddu_vv_tuma:
123case 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;
130case RISCVVector::BI__builtin_rvv_vaaddu_vv_tama:
131case 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;
139case RISCVVector::BI__builtin_rvv_vaaddu_vv_tumu:
140case 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;
146case RISCVVector::BI__builtin_rvv_vaaddu_vv_tamu:
147case 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;
154case RISCVVector::BI__builtin_rvv_vadc_vvm_tu:
155case RISCVVector::BI__builtin_rvv_vadc_vxm_tu:
156 ID = Intrinsic::riscv_vadc;
157 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
158 break;
159case RISCVVector::BI__builtin_rvv_vadc_vvm_ta:
160case 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;
165case RISCVVector::BI__builtin_rvv_vadd_vv_tu:
166case RISCVVector::BI__builtin_rvv_vadd_vx_tu:
167 ID = Intrinsic::riscv_vadd;
168 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
169 break;
170case RISCVVector::BI__builtin_rvv_vadd_vv_ta:
171case 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;
176case RISCVVector::BI__builtin_rvv_vadd_vv_tuma:
177case 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;
184case RISCVVector::BI__builtin_rvv_vadd_vv_tama:
185case 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;
193case RISCVVector::BI__builtin_rvv_vadd_vv_tumu:
194case 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;
200case RISCVVector::BI__builtin_rvv_vadd_vv_tamu:
201case 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;
208case RISCVVector::BI__builtin_rvv_vand_vv_tu:
209case RISCVVector::BI__builtin_rvv_vand_vx_tu:
210 ID = Intrinsic::riscv_vand;
211 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
212 break;
213case RISCVVector::BI__builtin_rvv_vand_vv_ta:
214case 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;
219case RISCVVector::BI__builtin_rvv_vand_vv_tuma:
220case 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;
227case RISCVVector::BI__builtin_rvv_vand_vv_tama:
228case 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;
236case RISCVVector::BI__builtin_rvv_vand_vv_tumu:
237case 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;
243case RISCVVector::BI__builtin_rvv_vand_vv_tamu:
244case 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;
251case RISCVVector::BI__builtin_rvv_vasub_vv_tu:
252case RISCVVector::BI__builtin_rvv_vasub_vx_tu:
253 ID = Intrinsic::riscv_vasub;
254 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
255 break;
256case RISCVVector::BI__builtin_rvv_vasub_vv_ta:
257case 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;
262case RISCVVector::BI__builtin_rvv_vasub_vv_tuma:
263case 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;
270case RISCVVector::BI__builtin_rvv_vasub_vv_tama:
271case 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;
279case RISCVVector::BI__builtin_rvv_vasub_vv_tumu:
280case 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;
286case RISCVVector::BI__builtin_rvv_vasub_vv_tamu:
287case 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;
294case RISCVVector::BI__builtin_rvv_vasubu_vv_tu:
295case RISCVVector::BI__builtin_rvv_vasubu_vx_tu:
296 ID = Intrinsic::riscv_vasubu;
297 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
298 break;
299case RISCVVector::BI__builtin_rvv_vasubu_vv_ta:
300case 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;
305case RISCVVector::BI__builtin_rvv_vasubu_vv_tuma:
306case 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;
313case RISCVVector::BI__builtin_rvv_vasubu_vv_tama:
314case 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;
322case RISCVVector::BI__builtin_rvv_vasubu_vv_tumu:
323case 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;
329case RISCVVector::BI__builtin_rvv_vasubu_vv_tamu:
330case 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;
337case 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 undef passthru
343 if (DefaultPolicy == TAIL_AGNOSTIC)
344 Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType));
345 IntrinsicTypes = {ResultType, Ops.back()->getType()};
346 break;
347case 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 undef passthru
353 if (DefaultPolicy == TAIL_AGNOSTIC)
354 Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType));
355 IntrinsicTypes = {ResultType, Ops.back()->getType()};
356 break;
357case RISCVVector::BI__builtin_rvv_vcpop_m:
358 ID = Intrinsic::riscv_vcpop;
359 DefaultPolicy = 1;
360 IntrinsicTypes = {Ops[0]->getType(), Ops.back()->getType()};
361 break;
362case 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;
367case RISCVVector::BI__builtin_rvv_vdiv_vv_tu:
368case RISCVVector::BI__builtin_rvv_vdiv_vx_tu:
369 ID = Intrinsic::riscv_vdiv;
370 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
371 break;
372case RISCVVector::BI__builtin_rvv_vdiv_vv_ta:
373case 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;
378case RISCVVector::BI__builtin_rvv_vdiv_vv_tuma:
379case 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;
386case RISCVVector::BI__builtin_rvv_vdiv_vv_tama:
387case 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;
395case RISCVVector::BI__builtin_rvv_vdiv_vv_tumu:
396case 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;
402case RISCVVector::BI__builtin_rvv_vdiv_vv_tamu:
403case 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;
410case RISCVVector::BI__builtin_rvv_vdivu_vv_tu:
411case RISCVVector::BI__builtin_rvv_vdivu_vx_tu:
412 ID = Intrinsic::riscv_vdivu;
413 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
414 break;
415case RISCVVector::BI__builtin_rvv_vdivu_vv_ta:
416case 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;
421case RISCVVector::BI__builtin_rvv_vdivu_vv_tuma:
422case 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;
429case RISCVVector::BI__builtin_rvv_vdivu_vv_tama:
430case 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;
438case RISCVVector::BI__builtin_rvv_vdivu_vv_tumu:
439case 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;
445case RISCVVector::BI__builtin_rvv_vdivu_vv_tamu:
446case 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;
453case RISCVVector::BI__builtin_rvv_vfadd_vv_tu:
454case RISCVVector::BI__builtin_rvv_vfadd_vf_tu:
455 ID = Intrinsic::riscv_vfadd;
456 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
457 break;
458case RISCVVector::BI__builtin_rvv_vfadd_vv_ta:
459case 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;
464case RISCVVector::BI__builtin_rvv_vfadd_vv_tuma:
465case 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;
472case RISCVVector::BI__builtin_rvv_vfadd_vv_tama:
473case 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;
481case RISCVVector::BI__builtin_rvv_vfadd_vv_tumu:
482case 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;
488case RISCVVector::BI__builtin_rvv_vfadd_vv_tamu:
489case 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;
496case RISCVVector::BI__builtin_rvv_vfclass_v_tu:
497 ID = Intrinsic::riscv_vfclass;
498 IntrinsicTypes = {Ops[1]->getType(), Ops.back()->getType()};
499 break;
500case 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;
505case 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;
512case 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;
520case 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;
526case 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;
533case 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;
537case 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;
542case 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;
549case 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;
557case 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;
563case 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;
570case 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;
574case 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;
579case 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;
586case 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;
594case 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;
600case 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;
607case 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;
611case 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;
616case 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;
623case 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;
631case 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;
637case 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;
644case 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;
648case 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;
653case 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;
660case 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;
668case 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;
674case 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;
681case 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;
685case 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;
690case 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;
697case 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;
705case 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;
711case 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;
718case 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;
722case 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;
727case 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;
734case 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;
742case 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;
748case 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;
755case RISCVVector::BI__builtin_rvv_vfdiv_vv_tu:
756case RISCVVector::BI__builtin_rvv_vfdiv_vf_tu:
757 ID = Intrinsic::riscv_vfdiv;
758 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
759 break;
760case RISCVVector::BI__builtin_rvv_vfdiv_vv_ta:
761case 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;
766case RISCVVector::BI__builtin_rvv_vfdiv_vv_tuma:
767case 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;
774case RISCVVector::BI__builtin_rvv_vfdiv_vv_tama:
775case 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;
783case RISCVVector::BI__builtin_rvv_vfdiv_vv_tumu:
784case 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;
790case RISCVVector::BI__builtin_rvv_vfdiv_vv_tamu:
791case 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;
798case RISCVVector::BI__builtin_rvv_vfirst_m:
799 ID = Intrinsic::riscv_vfirst;
800 DefaultPolicy = 1;
801 IntrinsicTypes = {Ops[0]->getType(), Ops.back()->getType()};
802 break;
803case 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;
808case RISCVVector::BI__builtin_rvv_vfmacc_vv_tu:
809case 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;
814case RISCVVector::BI__builtin_rvv_vfmacc_vv_ta:
815case 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;
821case RISCVVector::BI__builtin_rvv_vfmacc_vv_tuma:
822case 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;
829case RISCVVector::BI__builtin_rvv_vfmacc_vv_tama:
830case 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;
837case RISCVVector::BI__builtin_rvv_vfmacc_vv_tumu:
838case 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;
844case RISCVVector::BI__builtin_rvv_vfmacc_vv_tamu:
845case 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;
852case RISCVVector::BI__builtin_rvv_vfmadd_vv_tu:
853case 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;
858case RISCVVector::BI__builtin_rvv_vfmadd_vv_ta:
859case 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;
865case RISCVVector::BI__builtin_rvv_vfmadd_vv_tuma:
866case 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;
873case RISCVVector::BI__builtin_rvv_vfmadd_vv_tama:
874case 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;
881case RISCVVector::BI__builtin_rvv_vfmadd_vv_tumu:
882case 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;
888case RISCVVector::BI__builtin_rvv_vfmadd_vv_tamu:
889case 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;
896case RISCVVector::BI__builtin_rvv_vfmax_vv_tu:
897case RISCVVector::BI__builtin_rvv_vfmax_vf_tu:
898 ID = Intrinsic::riscv_vfmax;
899 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
900 break;
901case RISCVVector::BI__builtin_rvv_vfmax_vv_ta:
902case 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;
907case RISCVVector::BI__builtin_rvv_vfmax_vv_tuma:
908case 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;
915case RISCVVector::BI__builtin_rvv_vfmax_vv_tama:
916case 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;
924case RISCVVector::BI__builtin_rvv_vfmax_vv_tumu:
925case 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;
931case RISCVVector::BI__builtin_rvv_vfmax_vv_tamu:
932case 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;
939case 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 undef passthru
945 if (DefaultPolicy == TAIL_AGNOSTIC)
946 Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType));
947 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
948 break;
949case 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 undef passthru
955 if (DefaultPolicy == TAIL_AGNOSTIC)
956 Ops.insert(Ops.begin(), llvm::UndefValue::get(ResultType));
957 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
958 break;
959case RISCVVector::BI__builtin_rvv_vfmin_vv_tu:
960case RISCVVector::BI__builtin_rvv_vfmin_vf_tu:
961 ID = Intrinsic::riscv_vfmin;
962 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
963 break;
964case RISCVVector::BI__builtin_rvv_vfmin_vv_ta:
965case 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;
970case RISCVVector::BI__builtin_rvv_vfmin_vv_tuma:
971case 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;
978case RISCVVector::BI__builtin_rvv_vfmin_vv_tama:
979case 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;
987case RISCVVector::BI__builtin_rvv_vfmin_vv_tumu:
988case 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;
994case RISCVVector::BI__builtin_rvv_vfmin_vv_tamu:
995case 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;
1002case RISCVVector::BI__builtin_rvv_vfmsac_vv_tu:
1003case 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;
1008case RISCVVector::BI__builtin_rvv_vfmsac_vv_ta:
1009case 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;
1015case RISCVVector::BI__builtin_rvv_vfmsac_vv_tuma:
1016case 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;
1023case RISCVVector::BI__builtin_rvv_vfmsac_vv_tama:
1024case 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;
1031case RISCVVector::BI__builtin_rvv_vfmsac_vv_tumu:
1032case 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;
1038case RISCVVector::BI__builtin_rvv_vfmsac_vv_tamu:
1039case 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;
1046case RISCVVector::BI__builtin_rvv_vfmsub_vv_tu:
1047case 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;
1052case RISCVVector::BI__builtin_rvv_vfmsub_vv_ta:
1053case 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;
1059case RISCVVector::BI__builtin_rvv_vfmsub_vv_tuma:
1060case 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;
1067case RISCVVector::BI__builtin_rvv_vfmsub_vv_tama:
1068case 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;
1075case RISCVVector::BI__builtin_rvv_vfmsub_vv_tumu:
1076case 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;
1082case RISCVVector::BI__builtin_rvv_vfmsub_vv_tamu:
1083case 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;
1090case RISCVVector::BI__builtin_rvv_vfmul_vv_tu:
1091case RISCVVector::BI__builtin_rvv_vfmul_vf_tu:
1092 ID = Intrinsic::riscv_vfmul;
1093 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
1094 break;
1095case RISCVVector::BI__builtin_rvv_vfmul_vv_ta:
1096case 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;
1101case RISCVVector::BI__builtin_rvv_vfmul_vv_tuma:
1102case 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;
1109case RISCVVector::BI__builtin_rvv_vfmul_vv_tama:
1110case 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;
1118case RISCVVector::BI__builtin_rvv_vfmul_vv_tumu:
1119case 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;
1125case RISCVVector::BI__builtin_rvv_vfmul_vv_tamu:
1126case 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;
1133case RISCVVector::BI__builtin_rvv_vfmv_f_s:
1134 ID = Intrinsic::riscv_vfmv_f_s;
1135 IntrinsicTypes = {Ops[0]->getType()};
1136 break;
1137case RISCVVector::BI__builtin_rvv_vfmv_s_f_tu:
1138case RISCVVector::BI__builtin_rvv_vfmv_s_x_tu:
1139 ID = Intrinsic::riscv_vfmv_s_f;
1140 IntrinsicTypes = {ResultType, Ops.back()->getType()};
1141 break;
1142case RISCVVector::BI__builtin_rvv_vfmv_s_f_ta:
1143case 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;
1148case RISCVVector::BI__builtin_rvv_vfmv_v_f_tu:
1149 ID = Intrinsic::riscv_vfmv_v_f;
1150 IntrinsicTypes = {ResultType, Ops.back()->getType()};
1151 break;
1152case 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;
1157case 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;
1161case 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;
1166case 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;
1173case 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;
1181case 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;
1187case 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;
1194case 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;
1198case 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;
1203case 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;
1210case 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;
1218case 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;
1224case 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;
1231case 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;
1235case 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;
1240case 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;
1247case 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;
1255case 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;
1261case 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;
1268case 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;
1272case 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;
1277case 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;
1284case 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;
1292case 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;
1298case 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;
1305case 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;
1309case 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;
1314case 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;
1321case 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;
1329case 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;
1335case 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;
1342case 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;
1346case 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;
1351case 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;
1358case 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;
1366case 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;
1372case 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;
1379case 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;
1383case 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;
1388case 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;
1395case 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;
1403case 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;
1409case 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;
1416case 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;
1420case 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;
1425case 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;
1432case 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;
1440case 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;
1446case 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;
1453case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tu:
1454case 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;
1459case RISCVVector::BI__builtin_rvv_vfnmacc_vv_ta:
1460case 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;
1466case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tuma:
1467case 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;
1474case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tama:
1475case 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;
1482case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tumu:
1483case 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;
1489case RISCVVector::BI__builtin_rvv_vfnmacc_vv_tamu:
1490case 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;
1497case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tu:
1498case 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;
1503case RISCVVector::BI__builtin_rvv_vfnmadd_vv_ta:
1504case 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;
1510case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tuma:
1511case 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;
1518case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tama:
1519case 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;
1526case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tumu:
1527case 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;
1533case RISCVVector::BI__builtin_rvv_vfnmadd_vv_tamu:
1534case 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;
1541case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tu:
1542case 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;
1547case RISCVVector::BI__builtin_rvv_vfnmsac_vv_ta:
1548case 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;
1554case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tuma:
1555case 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;
1562case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tama:
1563case 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;
1570case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tumu:
1571case 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;
1577case RISCVVector::BI__builtin_rvv_vfnmsac_vv_tamu:
1578case 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;
1585case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tu:
1586case 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;
1591case RISCVVector::BI__builtin_rvv_vfnmsub_vv_ta:
1592case 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;
1598case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tuma:
1599case 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;
1606case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tama:
1607case 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;
1614case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tumu:
1615case 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;
1621case RISCVVector::BI__builtin_rvv_vfnmsub_vv_tamu:
1622case 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;
1629case RISCVVector::BI__builtin_rvv_vfrdiv_vf_tu:
1630 ID = Intrinsic::riscv_vfrdiv;
1631 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
1632 break;
1633case 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;
1638case 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;
1645case 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;
1653case 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;
1659case 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;
1666case RISCVVector::BI__builtin_rvv_vfrec7_v_tu:
1667 ID = Intrinsic::riscv_vfrec7;
1668 IntrinsicTypes = {ResultType, Ops.back()->getType()};
1669 break;
1670case 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;
1675case 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;
1682case 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;
1690case 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;
1696case 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;
1703case RISCVVector::BI__builtin_rvv_vfredmax_vs_tu:
1704 ID = Intrinsic::riscv_vfredmax;
1705 IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()};
1706 break;
1707case 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;
1712case 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;
1717case 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;
1723case 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;
1728case RISCVVector::BI__builtin_rvv_vfredmin_vs_tu:
1729 ID = Intrinsic::riscv_vfredmin;
1730 IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()};
1731 break;
1732case 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;
1737case 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;
1742case 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;
1748case 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;
1753case RISCVVector::BI__builtin_rvv_vfredosum_vs_tu:
1754 ID = Intrinsic::riscv_vfredosum;
1755 IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()};
1756 break;
1757case 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;
1762case 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;
1767case 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;
1773case 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;
1778case RISCVVector::BI__builtin_rvv_vfredusum_vs_tu:
1779 ID = Intrinsic::riscv_vfredusum;
1780 IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()};
1781 break;
1782case 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;
1787case 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;
1792case 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;
1798case 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;
1803case RISCVVector::BI__builtin_rvv_vfrsqrt7_v_tu:
1804 ID = Intrinsic::riscv_vfrsqrt7;
1805 IntrinsicTypes = {ResultType, Ops.back()->getType()};
1806 break;
1807case 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;
1812case 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;
1819case 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;
1827case 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;
1833case 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;
1840case RISCVVector::BI__builtin_rvv_vfrsub_vf_tu:
1841 ID = Intrinsic::riscv_vfrsub;
1842 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
1843 break;
1844case 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;
1849case 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;
1856case 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;
1864case 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;
1870case 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;
1877case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tu:
1878case RISCVVector::BI__builtin_rvv_vfsgnj_vf_tu:
1879 ID = Intrinsic::riscv_vfsgnj;
1880 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
1881 break;
1882case RISCVVector::BI__builtin_rvv_vfsgnj_vv_ta:
1883case 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;
1888case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tuma:
1889case 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;
1896case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tama:
1897case 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;
1905case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tumu:
1906case 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;
1912case RISCVVector::BI__builtin_rvv_vfsgnj_vv_tamu:
1913case 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;
1920case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tu:
1921case RISCVVector::BI__builtin_rvv_vfsgnjn_vf_tu:
1922 ID = Intrinsic::riscv_vfsgnjn;
1923 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
1924 break;
1925case 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::UndefValue::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;
1939case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_ta:
1940case 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;
1945case 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::UndefValue::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;
1959case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tuma:
1960case 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;
1967case 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::UndefValue::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;
1984case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tama:
1985case 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;
1993case 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::UndefValue::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;
2010case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tumu:
2011case 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;
2017case 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::UndefValue::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;
2034case RISCVVector::BI__builtin_rvv_vfsgnjn_vv_tamu:
2035case 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;
2042case 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::UndefValue::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;
2059case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tu:
2060case RISCVVector::BI__builtin_rvv_vfsgnjx_vf_tu:
2061 ID = Intrinsic::riscv_vfsgnjx;
2062 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
2063 break;
2064case 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::UndefValue::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;
2078case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_ta:
2079case 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;
2084case 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::UndefValue::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;
2098case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tuma:
2099case 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;
2106case 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::UndefValue::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;
2123case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tama:
2124case 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;
2132case 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::UndefValue::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;
2149case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tumu:
2150case 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;
2156case 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::UndefValue::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;
2173case RISCVVector::BI__builtin_rvv_vfsgnjx_vv_tamu:
2174case 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;
2181case 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::UndefValue::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;
2198case RISCVVector::BI__builtin_rvv_vfslide1down_vf_tu:
2199 ID = Intrinsic::riscv_vfslide1down;
2200 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
2201 break;
2202case 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;
2207case 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;
2214case 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;
2222case 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;
2228case 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;
2235case RISCVVector::BI__builtin_rvv_vfslide1up_vf_tu:
2236 ID = Intrinsic::riscv_vfslide1up;
2237 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
2238 break;
2239case 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;
2244case 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;
2251case 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;
2259case 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;
2265case 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;
2272case RISCVVector::BI__builtin_rvv_vfsqrt_v_tu:
2273 ID = Intrinsic::riscv_vfsqrt;
2274 IntrinsicTypes = {ResultType, Ops.back()->getType()};
2275 break;
2276case 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;
2281case 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;
2288case 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;
2296case 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;
2302case 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;
2309case RISCVVector::BI__builtin_rvv_vfsub_vv_tu:
2310case RISCVVector::BI__builtin_rvv_vfsub_vf_tu:
2311 ID = Intrinsic::riscv_vfsub;
2312 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
2313 break;
2314case RISCVVector::BI__builtin_rvv_vfsub_vv_ta:
2315case 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;
2320case RISCVVector::BI__builtin_rvv_vfsub_vv_tuma:
2321case 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;
2328case RISCVVector::BI__builtin_rvv_vfsub_vv_tama:
2329case 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;
2337case RISCVVector::BI__builtin_rvv_vfsub_vv_tumu:
2338case 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;
2344case RISCVVector::BI__builtin_rvv_vfsub_vv_tamu:
2345case 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;
2352case RISCVVector::BI__builtin_rvv_vfwadd_vv_tu:
2353case 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;
2357case RISCVVector::BI__builtin_rvv_vfwadd_vv_ta:
2358case 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;
2363case RISCVVector::BI__builtin_rvv_vfwadd_vv_tuma:
2364case 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;
2371case RISCVVector::BI__builtin_rvv_vfwadd_vv_tama:
2372case 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;
2380case RISCVVector::BI__builtin_rvv_vfwadd_vv_tumu:
2381case 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;
2387case RISCVVector::BI__builtin_rvv_vfwadd_vv_tamu:
2388case 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;
2395case RISCVVector::BI__builtin_rvv_vfwadd_wv_tu:
2396case RISCVVector::BI__builtin_rvv_vfwadd_wf_tu:
2397 ID = Intrinsic::riscv_vfwadd_w;
2398 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
2399 break;
2400case RISCVVector::BI__builtin_rvv_vfwadd_wv_ta:
2401case 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;
2406case RISCVVector::BI__builtin_rvv_vfwadd_wv_tuma:
2407case 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;
2414case RISCVVector::BI__builtin_rvv_vfwadd_wv_tama:
2415case 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;
2423case RISCVVector::BI__builtin_rvv_vfwadd_wv_tumu:
2424case 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;
2430case RISCVVector::BI__builtin_rvv_vfwadd_wv_tamu:
2431case 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;
2438case 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;
2442case 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;
2447case 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;
2454case 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;
2462case 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;
2468case 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;
2475case 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;
2479case 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;
2484case 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;
2491case 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;
2499case 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;
2505case 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;
2512case 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;
2516case 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;
2521case 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;
2528case 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;
2536case 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;
2542case 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;
2549case 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;
2553case 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;
2558case 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;
2565case 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;
2573case 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;
2579case 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;
2586case 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;
2590case 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;
2595case 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;
2602case 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;
2610case 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;
2616case 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;
2623case 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;
2627case 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;
2632case 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;
2639case 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;
2647case 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;
2653case 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;
2660case 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;
2664case 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;
2669case 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;
2676case 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;
2684case 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;
2690case 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;
2697case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tu:
2698case 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;
2703case RISCVVector::BI__builtin_rvv_vfwmacc_vv_ta:
2704case 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;
2710case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tuma:
2711case 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;
2718case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tama:
2719case 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;
2726case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tumu:
2727case 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;
2733case RISCVVector::BI__builtin_rvv_vfwmacc_vv_tamu:
2734case 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;
2741case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tu:
2742case 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;
2747case RISCVVector::BI__builtin_rvv_vfwmsac_vv_ta:
2748case 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;
2754case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tuma:
2755case 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;
2762case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tama:
2763case 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;
2770case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tumu:
2771case 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;
2777case RISCVVector::BI__builtin_rvv_vfwmsac_vv_tamu:
2778case 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;
2785case RISCVVector::BI__builtin_rvv_vfwmul_vv_tu:
2786case 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;
2790case RISCVVector::BI__builtin_rvv_vfwmul_vv_ta:
2791case 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;
2796case RISCVVector::BI__builtin_rvv_vfwmul_vv_tuma:
2797case 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;
2804case RISCVVector::BI__builtin_rvv_vfwmul_vv_tama:
2805case 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;
2813case RISCVVector::BI__builtin_rvv_vfwmul_vv_tumu:
2814case 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;
2820case RISCVVector::BI__builtin_rvv_vfwmul_vv_tamu:
2821case 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;
2828case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tu:
2829case 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;
2834case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_ta:
2835case 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;
2841case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tuma:
2842case 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;
2849case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tama:
2850case 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;
2857case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tumu:
2858case 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;
2864case RISCVVector::BI__builtin_rvv_vfwnmacc_vv_tamu:
2865case 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;
2872case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tu:
2873case 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;
2878case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_ta:
2879case 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;
2885case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tuma:
2886case 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;
2893case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tama:
2894case 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;
2901case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tumu:
2902case 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;
2908case RISCVVector::BI__builtin_rvv_vfwnmsac_vv_tamu:
2909case 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;
2916case RISCVVector::BI__builtin_rvv_vfwredosum_vs_tu:
2917 ID = Intrinsic::riscv_vfwredosum;
2918 IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()};
2919 break;
2920case 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;
2925case 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;
2930case 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;
2936case 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;
2941case RISCVVector::BI__builtin_rvv_vfwredusum_vs_tu:
2942 ID = Intrinsic::riscv_vfwredusum;
2943 IntrinsicTypes = {ResultType, Ops[1]->getType(), Ops.back()->getType()};
2944 break;
2945case 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;
2950case 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;
2955case 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;
2961case 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;
2966case RISCVVector::BI__builtin_rvv_vfwsub_vv_tu:
2967case 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;
2971case RISCVVector::BI__builtin_rvv_vfwsub_vv_ta:
2972case 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;
2977case RISCVVector::BI__builtin_rvv_vfwsub_vv_tuma:
2978case 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;
2985case RISCVVector::BI__builtin_rvv_vfwsub_vv_tama:
2986case 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;
2994case RISCVVector::BI__builtin_rvv_vfwsub_vv_tumu:
2995case 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;
3001case RISCVVector::BI__builtin_rvv_vfwsub_vv_tamu:
3002case 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;
3009case RISCVVector::BI__builtin_rvv_vfwsub_wv_tu:
3010case RISCVVector::BI__builtin_rvv_vfwsub_wf_tu:
3011 ID = Intrinsic::riscv_vfwsub_w;
3012 IntrinsicTypes = {ResultType, Ops[2]->getType(), Ops.back()->getType()};
3013 break;
3014case RISCVVector::BI__builtin_rvv_vfwsub_wv_ta:
3015case 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;
3020case RISCVVector::BI__builtin_rvv_vfwsub_wv_tuma:
3021case 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;
3028case RISCVVector::BI__builtin_rvv_vfwsub_wv_tama:
3029case 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;
3037case RISCVVector::BI__builtin_rvv_vfwsub_wv_tumu:
3038case 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;
3044case RISCVVector::BI__builtin_rvv_vfwsub_wv_tamu:
3045case 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;
3052case RISCVVector::BI__builtin_rvv_vid_v_tu:
3053 ID = Intrinsic::riscv_vid;
3054 IntrinsicTypes = {ResultType, Ops.back()->getType()};
3055 break;
3056case 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;
3061case 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;
3068case 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;
3076case 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;
3082case 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;
3089case RISCVVector::BI__builtin_rvv_viota_m_tu:
3090 ID = Intrinsic::riscv_viota;
3091 IntrinsicTypes = {ResultType, Ops.back()->getType()};
3092 break;
3093case 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;
3098case 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;
3105case 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;
3113case 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;
3119case 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;
3126case RISCVVector::BI__builtin_rvv_vle8_v_tu:
3127case RISCVVector::BI__builtin_rvv_vle16_v_tu:
3128case RISCVVector::BI__builtin_rvv_vle32_v_tu:
3129case 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;
3134case RISCVVector::BI__builtin_rvv_vle8_v_ta:
3135case RISCVVector::BI__builtin_rvv_vle16_v_ta:
3136case RISCVVector::BI__builtin_rvv_vle32_v_ta:
3137case 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;
3143case RISCVVector::BI__builtin_rvv_vle8_v_tuma:
3144case RISCVVector::BI__builtin_rvv_vle16_v_tuma:
3145case RISCVVector::BI__builtin_rvv_vle32_v_tuma:
3146case 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;
3154case RISCVVector::BI__builtin_rvv_vle8_v_tama:
3155case RISCVVector::BI__builtin_rvv_vle16_v_tama:
3156case RISCVVector::BI__builtin_rvv_vle32_v_tama:
3157case 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;
3166case RISCVVector::BI__builtin_rvv_vle8_v_tumu:
3167case RISCVVector::BI__builtin_rvv_vle16_v_tumu:
3168case RISCVVector::BI__builtin_rvv_vle32_v_tumu:
3169case 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;
3176case RISCVVector::BI__builtin_rvv_vle8_v_tamu:
3177case RISCVVector::BI__builtin_rvv_vle16_v_tamu:
3178case RISCVVector::BI__builtin_rvv_vle32_v_tamu:
3179case 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;
3187case RISCVVector::BI__builtin_rvv_vle16ff_v_tu:
3188case RISCVVector::BI__builtin_rvv_vle32ff_v_tu:
3189case RISCVVector::BI__builtin_rvv_vle64ff_v_tu:
3190case 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::UndefValue::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;
3212case RISCVVector::BI__builtin_rvv_vle16ff_v_ta:
3213case RISCVVector::BI__builtin_rvv_vle32ff_v_ta:
3214case RISCVVector::BI__builtin_rvv_vle64ff_v_ta:
3215case 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::UndefValue::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;
3237case RISCVVector::BI__builtin_rvv_vle16ff_v_tuma:
3238case RISCVVector::BI__builtin_rvv_vle32ff_v_tuma:
3239case RISCVVector::BI__builtin_rvv_vle64ff_v_tuma:
3240case 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::UndefValue::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;
3265case RISCVVector::BI__builtin_rvv_vle16ff_v_tama:
3266case RISCVVector::BI__builtin_rvv_vle32ff_v_tama:
3267case RISCVVector::BI__builtin_rvv_vle64ff_v_tama:
3268case 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::UndefValue::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;
3293case RISCVVector::BI__builtin_rvv_vle16ff_v_tumu:
3294case RISCVVector::BI__builtin_rvv_vle32ff_v_tumu:
3295case RISCVVector::BI__builtin_rvv_vle64ff_v_tumu:
3296case 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::UndefValue::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;
3321case RISCVVector::BI__builtin_rvv_vle16ff_v_tamu:
3322case RISCVVector::BI__builtin_rvv_vle32ff_v_tamu:
3323case RISCVVector::BI__builtin_rvv_vle64ff_v_tamu:
3324case 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::UndefValue::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;
3349case 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;
3355case RISCVVector::BI__builtin_rvv_vloxei8_v_tu:
3356case RISCVVector::BI__builtin_rvv_vloxei16_v_tu:
3357case RISCVVector::BI__builtin_rvv_vloxei32_v_tu:
3358case 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;
3363case RISCVVector::BI__builtin_rvv_vloxei8_v_ta:
3364case RISCVVector::BI__builtin_rvv_vloxei16_v_ta:
3365case RISCVVector::BI__builtin_rvv_vloxei32_v_ta:
3366case 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;
3372case RISCVVector::BI__builtin_rvv_vloxei8_v_tuma:
3373case RISCVVector::BI__builtin_rvv_vloxei16_v_tuma:
3374case RISCVVector::BI__builtin_rvv_vloxei32_v_tuma:
3375case 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;
3383case RISCVVector::BI__builtin_rvv_vloxei8_v_tama:
3384case RISCVVector::BI__builtin_rvv_vloxei16_v_tama:
3385case RISCVVector::BI__builtin_rvv_vloxei32_v_tama:
3386case 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;
3395case RISCVVector::BI__builtin_rvv_vloxei8_v_tumu:
3396case RISCVVector::BI__builtin_rvv_vloxei16_v_tumu:
3397case RISCVVector::BI__builtin_rvv_vloxei32_v_tumu:
3398case 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;
3405case RISCVVector::BI__builtin_rvv_vloxei8_v_tamu:
3406case RISCVVector::BI__builtin_rvv_vloxei16_v_tamu:
3407case RISCVVector::BI__builtin_rvv_vloxei32_v_tamu:
3408case 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;
3416case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tu:
3417case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tu:
3418case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tu:
3419case 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::UndefValue::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;
3457case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_ta:
3458case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_ta:
3459case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_ta:
3460case 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::UndefValue::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;
3498case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tuma:
3499case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tuma:
3500case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tuma:
3501case 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::UndefValue::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;
3543case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tama:
3544case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tama:
3545case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tama:
3546case 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::UndefValue::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;
3588case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tumu:
3589case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tumu:
3590case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tumu:
3591case 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::UndefValue::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;
3633case RISCVVector::BI__builtin_rvv_vloxseg2ei16_v_tamu:
3634case RISCVVector::BI__builtin_rvv_vloxseg2ei32_v_tamu:
3635case RISCVVector::BI__builtin_rvv_vloxseg2ei64_v_tamu:
3636case 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::UndefValue::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;
3678case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tu:
3679case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tu:
3680case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tu:
3681case 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::UndefValue::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;
3719case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_ta:
3720case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_ta:
3721case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_ta:
3722case 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::UndefValue::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;
3760case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tuma:
3761case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tuma:
3762case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tuma:
3763case 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::UndefValue::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;
3805case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tama:
3806case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tama:
3807case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tama:
3808case 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::UndefValue::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;
3850case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tumu:
3851case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tumu:
3852case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tumu:
3853case 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::UndefValue::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;
3895case RISCVVector::BI__builtin_rvv_vloxseg3ei8_v_tamu:
3896case RISCVVector::BI__builtin_rvv_vloxseg3ei16_v_tamu:
3897case RISCVVector::BI__builtin_rvv_vloxseg3ei32_v_tamu:
3898case 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::UndefValue::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;
3940case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tu:
3941case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tu:
3942case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tu:
3943case 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::UndefValue::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;
3981case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_ta:
3982case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_ta:
3983case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_ta:
3984case 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::UndefValue::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;
4022case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tuma:
4023case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tuma:
4024case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tuma:
4025case 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::UndefValue::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;
4067case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tama:
4068case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tama:
4069case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tama:
4070case 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::UndefValue::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;
4112case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tumu:
4113case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tumu:
4114case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tumu:
4115case 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::UndefValue::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;
4157case RISCVVector::BI__builtin_rvv_vloxseg4ei8_v_tamu:
4158case RISCVVector::BI__builtin_rvv_vloxseg4ei16_v_tamu:
4159case RISCVVector::BI__builtin_rvv_vloxseg4ei32_v_tamu:
4160case 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::UndefValue::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;
4202case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tu:
4203case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tu:
4204case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tu:
4205case 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::UndefValue::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;
4243case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_ta:
4244case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_ta:
4245case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_ta:
4246case 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::UndefValue::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;
4284case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tuma:
4285case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tuma:
4286case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tuma:
4287case 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::UndefValue::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;
4329case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tama:
4330case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tama:
4331case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tama:
4332case 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::UndefValue::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;
4374case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tumu:
4375case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tumu:
4376case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tumu:
4377case 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::UndefValue::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;
4419case RISCVVector::BI__builtin_rvv_vloxseg5ei8_v_tamu:
4420case RISCVVector::BI__builtin_rvv_vloxseg5ei16_v_tamu:
4421case RISCVVector::BI__builtin_rvv_vloxseg5ei32_v_tamu:
4422case 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::UndefValue::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;
4464case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tu:
4465case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tu:
4466case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tu:
4467case 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::UndefValue::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;
4505case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_ta:
4506case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_ta:
4507case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_ta:
4508case 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::UndefValue::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;
4546case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tuma:
4547case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tuma:
4548case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tuma:
4549case 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::UndefValue::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;
4591case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tama:
4592case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tama:
4593case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tama:
4594case 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::UndefValue::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;
4636case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tumu:
4637case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tumu:
4638case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tumu:
4639case 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::UndefValue::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;
4681case RISCVVector::BI__builtin_rvv_vloxseg6ei8_v_tamu:
4682case RISCVVector::BI__builtin_rvv_vloxseg6ei16_v_tamu:
4683case RISCVVector::BI__builtin_rvv_vloxseg6ei32_v_tamu:
4684case 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::UndefValue::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;
4726case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tu:
4727case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tu:
4728case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tu:
4729case 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::UndefValue::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;
4767case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_ta:
4768case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_ta:
4769case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_ta:
4770case 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::UndefValue::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;
4808case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tuma:
4809case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tuma:
4810case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tuma:
4811case 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::UndefValue::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;
4853case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tama:
4854case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tama:
4855case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tama:
4856case 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::UndefValue::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;
4898case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tumu:
4899case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tumu:
4900case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tumu:
4901case 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::UndefValue::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;
4943case RISCVVector::BI__builtin_rvv_vloxseg7ei8_v_tamu:
4944case RISCVVector::BI__builtin_rvv_vloxseg7ei16_v_tamu:
4945case RISCVVector::BI__builtin_rvv_vloxseg7ei32_v_tamu:
4946case 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::UndefValue::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;
4988case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tu:
4989case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tu:
4990case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tu:
4991case 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::UndefValue::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;
5029case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_ta:
5030case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_ta:
5031case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_ta:
5032case 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::UndefValue::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;
5070case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tuma:
5071case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tuma:
5072case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tuma:
5073case 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::UndefValue::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;
5115case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tama:
5116case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tama:
5117case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tama:
5118case 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::UndefValue::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;
5160case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tumu:
5161case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tumu:
5162case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tumu:
5163case 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::UndefValue::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;
5205case RISCVVector::BI__builtin_rvv_vloxseg8ei8_v_tamu:
5206case RISCVVector::BI__builtin_rvv_vloxseg8ei16_v_tamu:
5207case RISCVVector::BI__builtin_rvv_vloxseg8ei32_v_tamu:
5208case 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::UndefValue::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;
5250case RISCVVector::BI__builtin_rvv_vlse32_v_tu:
5251case RISCVVector::BI__builtin_rvv_vlse64_v_tu:
5252case RISCVVector::BI__builtin_rvv_vlse8_v_tu:
5253case 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;
5258case RISCVVector::BI__builtin_rvv_vlse32_v_ta:
5259case RISCVVector::BI__builtin_rvv_vlse64_v_ta:
5260case RISCVVector::BI__builtin_rvv_vlse8_v_ta:
5261case 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;
5267case RISCVVector::BI__builtin_rvv_vlse32_v_tuma:
5268case RISCVVector::BI__builtin_rvv_vlse64_v_tuma:
5269case RISCVVector::BI__builtin_rvv_vlse8_v_tuma:
5270case 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;
5278case RISCVVector::BI__builtin_rvv_vlse32_v_tama:
5279case RISCVVector::BI__builtin_rvv_vlse64_v_tama:
5280case RISCVVector::BI__builtin_rvv_vlse8_v_tama:
5281case 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;
5290case RISCVVector::BI__builtin_rvv_vlse32_v_tumu:
5291case RISCVVector::BI__builtin_rvv_vlse64_v_tumu:
5292case RISCVVector::BI__builtin_rvv_vlse8_v_tumu:
5293case 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;
5300case RISCVVector::BI__builtin_rvv_vlse32_v_tamu:
5301case RISCVVector::BI__builtin_rvv_vlse64_v_tamu:
5302case RISCVVector::BI__builtin_rvv_vlse8_v_tamu:
5303case 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;
5311case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tu:
5312case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tu:
5313case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tu:
5314case 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::UndefValue::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;
5349case RISCVVector::BI__builtin_rvv_vlseg2e8_v_ta:
5350case RISCVVector::BI__builtin_rvv_vlseg2e16_v_ta:
5351case RISCVVector::BI__builtin_rvv_vlseg2e32_v_ta:
5352case 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::UndefValue::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;
5387case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tuma:
5388case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tuma:
5389case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tuma:
5390case 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::UndefValue::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;
5429case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tama:
5430case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tama:
5431case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tama:
5432case 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::UndefValue::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;
5471case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tumu:
5472case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tumu:
5473case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tumu:
5474case 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::UndefValue::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;
5513case RISCVVector::BI__builtin_rvv_vlseg2e8_v_tamu:
5514case RISCVVector::BI__builtin_rvv_vlseg2e16_v_tamu:
5515case RISCVVector::BI__builtin_rvv_vlseg2e32_v_tamu:
5516case 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::UndefValue::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;
5555case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tu:
5556case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tu:
5557case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tu:
5558case 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::UndefValue::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;
5597case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_ta:
5598case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_ta:
5599case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_ta:
5600case 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::UndefValue::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;
5639case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tuma:
5640case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tuma:
5641case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tuma:
5642case 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::UndefValue::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;
5685case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tama:
5686case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tama:
5687case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tama:
5688case 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::UndefValue::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;
5731case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tumu:
5732case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tumu:
5733case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tumu:
5734case 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::UndefValue::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;
5777case RISCVVector::BI__builtin_rvv_vlseg2e16ff_v_tamu:
5778case RISCVVector::BI__builtin_rvv_vlseg2e32ff_v_tamu:
5779case RISCVVector::BI__builtin_rvv_vlseg2e64ff_v_tamu:
5780case 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::UndefValue::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;
5823case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tu:
5824case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tu:
5825case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tu:
5826case 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::UndefValue::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;
5861case RISCVVector::BI__builtin_rvv_vlseg3e8_v_ta:
5862case RISCVVector::BI__builtin_rvv_vlseg3e16_v_ta:
5863case RISCVVector::BI__builtin_rvv_vlseg3e32_v_ta:
5864case 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::UndefValue::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;
5899case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tuma:
5900case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tuma:
5901case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tuma:
5902case 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::UndefValue::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;
5941case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tama:
5942case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tama:
5943case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tama:
5944case 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::UndefValue::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;
5983case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tumu:
5984case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tumu:
5985case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tumu:
5986case 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::UndefValue::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;
6025case RISCVVector::BI__builtin_rvv_vlseg3e8_v_tamu:
6026case RISCVVector::BI__builtin_rvv_vlseg3e16_v_tamu:
6027case RISCVVector::BI__builtin_rvv_vlseg3e32_v_tamu:
6028case 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::UndefValue::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;
6067case RISCVVector::BI__builtin_rvv_vlseg3e8ff_v_tu:
6068case RISCVVector::BI__builtin_rvv_vlseg3e16ff_v_tu:
6069case RISCVVector::BI__builtin_rvv_vlseg3e32ff_v_tu:
6070case 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::UndefValue::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;
6109case RISCVVector::BI__builtin_rvv_vlseg3e8ff_v_ta:
6110case RISCVVector::BI__builtin_rvv_vlseg3e16ff_v_ta:
6111case RISCVVector::BI__builtin_rvv_vlseg3e32ff_v_ta:
6112case 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)</