Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
case ARM::BI__builtin_arm_mve_vldrdq_gather_base_wb_s64:
2
case ARM::BI__builtin_arm_mve_vldrdq_gather_base_wb_u64:
3
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_f32:
4
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_s32:
5
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_u32: {
6
  llvm::Type * Param0;
7
  llvm::Type * Param1;
8
  switch (BuiltinID) {
9
  case ARM::BI__builtin_arm_mve_vldrdq_gather_base_wb_s64:
10
    Param0 = llvm::FixedVectorType::get(Int64Ty, 2);
11
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
12
    break;
13
  case ARM::BI__builtin_arm_mve_vldrdq_gather_base_wb_u64:
14
    Param0 = llvm::FixedVectorType::get(Int64Ty, 2);
15
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
16
    break;
17
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_f32:
18
    Param0 = llvm::FixedVectorType::get(FloatTy, 4);
19
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
20
    break;
21
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_s32:
22
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
23
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
24
    break;
25
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_u32:
26
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
27
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
28
    break;
29
  }
30
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
31
  Value *Val1 = Builder.CreateLoad(Val0);
32
  Value *Val2 = EmitScalarExpr(E->getArg(1));
33
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vldr_gather_base_wb, {Param0, Param1}), {Val1, Val2});
34
  Value *Val4 = Builder.CreateExtractValue(Val3, static_cast<unsigned>(1));
35
  Builder.CreateStore(Val4, Val0);
36
  return Builder.CreateExtractValue(Val3, static_cast<unsigned>(0));
37
}
38
case ARM::BI__builtin_arm_mve_vddupq_wb_u16:
39
case ARM::BI__builtin_arm_mve_vddupq_wb_u32:
40
case ARM::BI__builtin_arm_mve_vddupq_wb_u8:
41
case ARM::BI__builtin_arm_mve_vidupq_wb_u16:
42
case ARM::BI__builtin_arm_mve_vidupq_wb_u32:
43
case ARM::BI__builtin_arm_mve_vidupq_wb_u8: {
44
  Intrinsic::ID  Param0;
45
  llvm::Type * Param1;
46
  switch (BuiltinID) {
47
  case ARM::BI__builtin_arm_mve_vddupq_wb_u16:
48
    Param0 = Intrinsic::arm_mve_vddup;
49
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
50
    break;
51
  case ARM::BI__builtin_arm_mve_vddupq_wb_u32:
52
    Param0 = Intrinsic::arm_mve_vddup;
53
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
54
    break;
55
  case ARM::BI__builtin_arm_mve_vddupq_wb_u8:
56
    Param0 = Intrinsic::arm_mve_vddup;
57
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
58
    break;
59
  case ARM::BI__builtin_arm_mve_vidupq_wb_u16:
60
    Param0 = Intrinsic::arm_mve_vidup;
61
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
62
    break;
63
  case ARM::BI__builtin_arm_mve_vidupq_wb_u32:
64
    Param0 = Intrinsic::arm_mve_vidup;
65
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
66
    break;
67
  case ARM::BI__builtin_arm_mve_vidupq_wb_u8:
68
    Param0 = Intrinsic::arm_mve_vidup;
69
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
70
    break;
71
  }
72
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
73
  Value *Val1 = Builder.CreateLoad(Val0);
74
  Value *Val2 = EmitScalarExpr(E->getArg(1));
75
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val1, Val2});
76
  Value *Val4 = Builder.CreateExtractValue(Val3, static_cast<unsigned>(1));
77
  Builder.CreateStore(Val4, Val0);
78
  return Builder.CreateExtractValue(Val3, static_cast<unsigned>(0));
79
}
80
case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_wb_s64:
81
case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_wb_u64:
82
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_f32:
83
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_s32:
84
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_u32: {
85
  llvm::Type * Param0;
86
  llvm::Type * Param1;
87
  switch (BuiltinID) {
88
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_wb_s64:
89
    Param0 = llvm::FixedVectorType::get(Int64Ty, 2);
90
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
91
    break;
92
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_wb_u64:
93
    Param0 = llvm::FixedVectorType::get(Int64Ty, 2);
94
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
95
    break;
96
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_f32:
97
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
98
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
99
    break;
100
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_s32:
101
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
102
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
103
    break;
104
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_u32:
105
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
106
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
107
    break;
108
  }
109
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
110
  Value *Val1 = Builder.CreateLoad(Val0);
111
  Value *Val2 = EmitScalarExpr(E->getArg(1));
112
  Value *Val3 = EmitScalarExpr(E->getArg(2));
113
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vstr_scatter_base_wb, {Param0, Param1}), {Val1, Val2, Val3});
114
  return Builder.CreateStore(Val4, Val0);
115
}
116
case ARM::BI__builtin_arm_mve_vdwdupq_wb_u16:
117
case ARM::BI__builtin_arm_mve_vdwdupq_wb_u32:
118
case ARM::BI__builtin_arm_mve_vdwdupq_wb_u8:
119
case ARM::BI__builtin_arm_mve_viwdupq_wb_u16:
120
case ARM::BI__builtin_arm_mve_viwdupq_wb_u32:
121
case ARM::BI__builtin_arm_mve_viwdupq_wb_u8: {
122
  Intrinsic::ID  Param0;
123
  llvm::Type * Param1;
124
  switch (BuiltinID) {
125
  case ARM::BI__builtin_arm_mve_vdwdupq_wb_u16:
126
    Param0 = Intrinsic::arm_mve_vdwdup;
127
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
128
    break;
129
  case ARM::BI__builtin_arm_mve_vdwdupq_wb_u32:
130
    Param0 = Intrinsic::arm_mve_vdwdup;
131
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
132
    break;
133
  case ARM::BI__builtin_arm_mve_vdwdupq_wb_u8:
134
    Param0 = Intrinsic::arm_mve_vdwdup;
135
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
136
    break;
137
  case ARM::BI__builtin_arm_mve_viwdupq_wb_u16:
138
    Param0 = Intrinsic::arm_mve_viwdup;
139
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
140
    break;
141
  case ARM::BI__builtin_arm_mve_viwdupq_wb_u32:
142
    Param0 = Intrinsic::arm_mve_viwdup;
143
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
144
    break;
145
  case ARM::BI__builtin_arm_mve_viwdupq_wb_u8:
146
    Param0 = Intrinsic::arm_mve_viwdup;
147
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
148
    break;
149
  }
150
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
151
  Value *Val1 = Builder.CreateLoad(Val0);
152
  Value *Val2 = EmitScalarExpr(E->getArg(1));
153
  Value *Val3 = EmitScalarExpr(E->getArg(2));
154
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val1, Val2, Val3});
155
  Value *Val5 = Builder.CreateExtractValue(Val4, static_cast<unsigned>(1));
156
  Builder.CreateStore(Val5, Val0);
157
  return Builder.CreateExtractValue(Val4, static_cast<unsigned>(0));
158
}
159
case ARM::BI__builtin_arm_mve_vldrdq_gather_base_wb_z_s64:
160
case ARM::BI__builtin_arm_mve_vldrdq_gather_base_wb_z_u64:
161
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_z_f32:
162
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_z_s32:
163
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_z_u32: {
164
  llvm::Type * Param0;
165
  llvm::Type * Param1;
166
  llvm::Type * Param2;
167
  switch (BuiltinID) {
168
  case ARM::BI__builtin_arm_mve_vldrdq_gather_base_wb_z_s64:
169
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
170
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
171
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
172
    break;
173
  case ARM::BI__builtin_arm_mve_vldrdq_gather_base_wb_z_u64:
174
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
175
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
176
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
177
    break;
178
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_z_f32:
179
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
180
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
181
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
182
    break;
183
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_z_s32:
184
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
185
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
186
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
187
    break;
188
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_wb_z_u32:
189
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
190
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
191
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
192
    break;
193
  }
194
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
195
  Value *Val1 = Builder.CreateLoad(Val0);
196
  Value *Val2 = EmitScalarExpr(E->getArg(1));
197
  Value *Val3 = EmitScalarExpr(E->getArg(2));
198
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
199
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val4});
200
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vldr_gather_base_wb_predicated, {Param1, Param2, Param0}), {Val1, Val2, Val5});
201
  Value *Val7 = Builder.CreateExtractValue(Val6, static_cast<unsigned>(1));
202
  Builder.CreateStore(Val7, Val0);
203
  return Builder.CreateExtractValue(Val6, static_cast<unsigned>(0));
204
}
205
case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_wb_p_s64:
206
case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_wb_p_u64:
207
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_p_f32:
208
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_p_s32:
209
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_p_u32: {
210
  llvm::Type * Param0;
211
  llvm::Type * Param1;
212
  llvm::Type * Param2;
213
  switch (BuiltinID) {
214
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_wb_p_s64:
215
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
216
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
217
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
218
    break;
219
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_wb_p_u64:
220
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
221
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
222
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
223
    break;
224
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_p_f32:
225
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
226
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
227
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
228
    break;
229
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_p_s32:
230
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
231
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
232
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
233
    break;
234
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_wb_p_u32:
235
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
236
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
237
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
238
    break;
239
  }
240
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
241
  Value *Val1 = Builder.CreateLoad(Val0);
242
  Value *Val2 = EmitScalarExpr(E->getArg(1));
243
  Value *Val3 = EmitScalarExpr(E->getArg(2));
244
  Value *Val4 = EmitScalarExpr(E->getArg(3));
245
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
246
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val5});
247
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vstr_scatter_base_wb_predicated, {Param1, Param2, Param0}), {Val1, Val2, Val3, Val6});
248
  return Builder.CreateStore(Val7, Val0);
249
}
250
case ARM::BI__builtin_arm_mve_vld1q_f32:
251
case ARM::BI__builtin_arm_mve_vldrwq_f32: {
252
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
253
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(FloatTy, 4)));
254
  Address Val2 = Address(Val1, llvm::FixedVectorType::get(FloatTy, 4), CharUnits::fromQuantity(4));
255
  return Builder.CreateLoad(Val2);
256
}
257
case ARM::BI__builtin_arm_mve_vld1q_z_f32:
258
case ARM::BI__builtin_arm_mve_vldrwq_z_f32: {
259
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
260
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(FloatTy, 4)));
261
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 4);
262
  Value *Val3 = EmitScalarExpr(E->getArg(1));
263
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
264
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4});
265
  llvm::Type *Val6 = llvm::FixedVectorType::get(FloatTy, 4);
266
  Value *Val7 = llvm::Constant::getNullValue(Val6);
267
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_load, {llvm::FixedVectorType::get(FloatTy, 4), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(FloatTy, 4))}), {Val1, Val2, Val5, Val7});
268
}
269
case ARM::BI__builtin_arm_mve_vld1q_f16:
270
case ARM::BI__builtin_arm_mve_vldrhq_f16: {
271
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
272
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(HalfTy, 8)));
273
  Address Val2 = Address(Val1, llvm::FixedVectorType::get(HalfTy, 8), CharUnits::fromQuantity(2));
274
  return Builder.CreateLoad(Val2);
275
}
276
case ARM::BI__builtin_arm_mve_vld1q_z_f16:
277
case ARM::BI__builtin_arm_mve_vldrhq_z_f16: {
278
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
279
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(HalfTy, 8)));
280
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 2);
281
  Value *Val3 = EmitScalarExpr(E->getArg(1));
282
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
283
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val4});
284
  llvm::Type *Val6 = llvm::FixedVectorType::get(HalfTy, 8);
285
  Value *Val7 = llvm::Constant::getNullValue(Val6);
286
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_load, {llvm::FixedVectorType::get(HalfTy, 8), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(HalfTy, 8))}), {Val1, Val2, Val5, Val7});
287
}
288
case ARM::BI__builtin_arm_mve_vldrhq_s32:
289
case ARM::BI__builtin_arm_mve_vldrhq_u32: {
290
  bool  Param0;
291
  switch (BuiltinID) {
292
  case ARM::BI__builtin_arm_mve_vldrhq_s32:
293
    Param0 = 0;
294
    break;
295
  case ARM::BI__builtin_arm_mve_vldrhq_u32:
296
    Param0 = 1;
297
    break;
298
  }
299
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
300
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 4)));
301
  Address Val2 = Address(Val1, llvm::FixedVectorType::get(Int16Ty, 4), CharUnits::fromQuantity(2));
302
  Value *Val3 = Builder.CreateLoad(Val2);
303
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
304
  return SignOrZeroExtend(Builder, Val3, Val4, static_cast<bool>(Param0));
305
}
306
case ARM::BI__builtin_arm_mve_vldrhq_z_s32:
307
case ARM::BI__builtin_arm_mve_vldrhq_z_u32: {
308
  bool  Param0;
309
  switch (BuiltinID) {
310
  case ARM::BI__builtin_arm_mve_vldrhq_z_s32:
311
    Param0 = 0;
312
    break;
313
  case ARM::BI__builtin_arm_mve_vldrhq_z_u32:
314
    Param0 = 1;
315
    break;
316
  }
317
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
318
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 4)));
319
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 2);
320
  Value *Val3 = EmitScalarExpr(E->getArg(1));
321
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
322
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4});
323
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int16Ty, 4);
324
  Value *Val7 = llvm::Constant::getNullValue(Val6);
325
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_load, {llvm::FixedVectorType::get(Int16Ty, 4), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 4))}), {Val1, Val2, Val5, Val7});
326
  llvm::Type *Val9 = llvm::FixedVectorType::get(Int32Ty, 4);
327
  return SignOrZeroExtend(Builder, Val8, Val9, static_cast<bool>(Param0));
328
}
329
case ARM::BI__builtin_arm_mve_vld1q_s16:
330
case ARM::BI__builtin_arm_mve_vld1q_u16:
331
case ARM::BI__builtin_arm_mve_vldrhq_s16:
332
case ARM::BI__builtin_arm_mve_vldrhq_u16: {
333
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
334
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 8)));
335
  Address Val2 = Address(Val1, llvm::FixedVectorType::get(Int16Ty, 8), CharUnits::fromQuantity(2));
336
  return Builder.CreateLoad(Val2);
337
}
338
case ARM::BI__builtin_arm_mve_vld1q_z_s16:
339
case ARM::BI__builtin_arm_mve_vld1q_z_u16:
340
case ARM::BI__builtin_arm_mve_vldrhq_z_s16:
341
case ARM::BI__builtin_arm_mve_vldrhq_z_u16: {
342
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
343
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 8)));
344
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 2);
345
  Value *Val3 = EmitScalarExpr(E->getArg(1));
346
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
347
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val4});
348
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int16Ty, 8);
349
  Value *Val7 = llvm::Constant::getNullValue(Val6);
350
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_load, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 8))}), {Val1, Val2, Val5, Val7});
351
}
352
case ARM::BI__builtin_arm_mve_vld1q_s32:
353
case ARM::BI__builtin_arm_mve_vld1q_u32:
354
case ARM::BI__builtin_arm_mve_vldrwq_s32:
355
case ARM::BI__builtin_arm_mve_vldrwq_u32: {
356
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
357
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int32Ty, 4)));
358
  Address Val2 = Address(Val1, llvm::FixedVectorType::get(Int32Ty, 4), CharUnits::fromQuantity(4));
359
  return Builder.CreateLoad(Val2);
360
}
361
case ARM::BI__builtin_arm_mve_vld1q_z_s32:
362
case ARM::BI__builtin_arm_mve_vld1q_z_u32:
363
case ARM::BI__builtin_arm_mve_vldrwq_z_s32:
364
case ARM::BI__builtin_arm_mve_vldrwq_z_u32: {
365
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
366
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int32Ty, 4)));
367
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 4);
368
  Value *Val3 = EmitScalarExpr(E->getArg(1));
369
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
370
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4});
371
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int32Ty, 4);
372
  Value *Val7 = llvm::Constant::getNullValue(Val6);
373
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_load, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int32Ty, 4))}), {Val1, Val2, Val5, Val7});
374
}
375
case ARM::BI__builtin_arm_mve_vld1q_s8:
376
case ARM::BI__builtin_arm_mve_vld1q_u8:
377
case ARM::BI__builtin_arm_mve_vldrbq_s8:
378
case ARM::BI__builtin_arm_mve_vldrbq_u8: {
379
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
380
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 16)));
381
  Address Val2 = Address(Val1, llvm::FixedVectorType::get(Int8Ty, 16), CharUnits::fromQuantity(1));
382
  return Builder.CreateLoad(Val2);
383
}
384
case ARM::BI__builtin_arm_mve_vld1q_z_s8:
385
case ARM::BI__builtin_arm_mve_vld1q_z_u8:
386
case ARM::BI__builtin_arm_mve_vldrbq_z_s8:
387
case ARM::BI__builtin_arm_mve_vldrbq_z_u8: {
388
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
389
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 16)));
390
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 1);
391
  Value *Val3 = EmitScalarExpr(E->getArg(1));
392
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
393
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val4});
394
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int8Ty, 16);
395
  Value *Val7 = llvm::Constant::getNullValue(Val6);
396
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_load, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 16))}), {Val1, Val2, Val5, Val7});
397
}
398
case ARM::BI__builtin_arm_mve_vldrbq_s32:
399
case ARM::BI__builtin_arm_mve_vldrbq_u32: {
400
  bool  Param0;
401
  switch (BuiltinID) {
402
  case ARM::BI__builtin_arm_mve_vldrbq_s32:
403
    Param0 = 0;
404
    break;
405
  case ARM::BI__builtin_arm_mve_vldrbq_u32:
406
    Param0 = 1;
407
    break;
408
  }
409
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
410
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 4)));
411
  Address Val2 = Address(Val1, llvm::FixedVectorType::get(Int8Ty, 4), CharUnits::fromQuantity(1));
412
  Value *Val3 = Builder.CreateLoad(Val2);
413
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
414
  return SignOrZeroExtend(Builder, Val3, Val4, static_cast<bool>(Param0));
415
}
416
case ARM::BI__builtin_arm_mve_vldrbq_z_s32:
417
case ARM::BI__builtin_arm_mve_vldrbq_z_u32: {
418
  bool  Param0;
419
  switch (BuiltinID) {
420
  case ARM::BI__builtin_arm_mve_vldrbq_z_s32:
421
    Param0 = 0;
422
    break;
423
  case ARM::BI__builtin_arm_mve_vldrbq_z_u32:
424
    Param0 = 1;
425
    break;
426
  }
427
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
428
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 4)));
429
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 1);
430
  Value *Val3 = EmitScalarExpr(E->getArg(1));
431
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
432
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4});
433
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int8Ty, 4);
434
  Value *Val7 = llvm::Constant::getNullValue(Val6);
435
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_load, {llvm::FixedVectorType::get(Int8Ty, 4), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 4))}), {Val1, Val2, Val5, Val7});
436
  llvm::Type *Val9 = llvm::FixedVectorType::get(Int32Ty, 4);
437
  return SignOrZeroExtend(Builder, Val8, Val9, static_cast<bool>(Param0));
438
}
439
case ARM::BI__builtin_arm_mve_vldrbq_s16:
440
case ARM::BI__builtin_arm_mve_vldrbq_u16: {
441
  bool  Param0;
442
  switch (BuiltinID) {
443
  case ARM::BI__builtin_arm_mve_vldrbq_s16:
444
    Param0 = 0;
445
    break;
446
  case ARM::BI__builtin_arm_mve_vldrbq_u16:
447
    Param0 = 1;
448
    break;
449
  }
450
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
451
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 8)));
452
  Address Val2 = Address(Val1, llvm::FixedVectorType::get(Int8Ty, 8), CharUnits::fromQuantity(1));
453
  Value *Val3 = Builder.CreateLoad(Val2);
454
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
455
  return SignOrZeroExtend(Builder, Val3, Val4, static_cast<bool>(Param0));
456
}
457
case ARM::BI__builtin_arm_mve_vldrbq_z_s16:
458
case ARM::BI__builtin_arm_mve_vldrbq_z_u16: {
459
  bool  Param0;
460
  switch (BuiltinID) {
461
  case ARM::BI__builtin_arm_mve_vldrbq_z_s16:
462
    Param0 = 0;
463
    break;
464
  case ARM::BI__builtin_arm_mve_vldrbq_z_u16:
465
    Param0 = 1;
466
    break;
467
  }
468
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
469
  Value *Val1 = Builder.CreatePointerCast((Val0.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 8)));
470
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 1);
471
  Value *Val3 = EmitScalarExpr(E->getArg(1));
472
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
473
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val4});
474
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int8Ty, 8);
475
  Value *Val7 = llvm::Constant::getNullValue(Val6);
476
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_load, {llvm::FixedVectorType::get(Int8Ty, 8), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 8))}), {Val1, Val2, Val5, Val7});
477
  llvm::Type *Val9 = llvm::FixedVectorType::get(Int16Ty, 8);
478
  return SignOrZeroExtend(Builder, Val8, Val9, static_cast<bool>(Param0));
479
}
480
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_s16:
481
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_s32:
482
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_s8:
483
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_u16:
484
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_u32:
485
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_u8:
486
case ARM::BI__builtin_arm_mve_vstrdq_scatter_offset_p_s64:
487
case ARM::BI__builtin_arm_mve_vstrdq_scatter_offset_p_u64:
488
case ARM::BI__builtin_arm_mve_vstrdq_scatter_shifted_offset_p_s64:
489
case ARM::BI__builtin_arm_mve_vstrdq_scatter_shifted_offset_p_u64:
490
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_f16:
491
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_s16:
492
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_s32:
493
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_u16:
494
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_u32:
495
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_f16:
496
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_s16:
497
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_s32:
498
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_u16:
499
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_u32:
500
case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_p_f32:
501
case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_p_s32:
502
case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_p_u32:
503
case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_p_f32:
504
case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_p_s32:
505
case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_p_u32: {
506
  uint32_t  Param0;
507
  uint32_t  Param1;
508
  llvm::Type * Param2;
509
  llvm::Type * Param3;
510
  llvm::Type * Param4;
511
  llvm::Type * Param5;
512
  switch (BuiltinID) {
513
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_s16:
514
    Param0 = 8;
515
    Param1 = 0;
516
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
517
    Param3 = llvm::PointerType::getUnqual(Int8Ty);
518
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
519
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
520
    break;
521
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_s32:
522
    Param0 = 8;
523
    Param1 = 0;
524
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
525
    Param3 = llvm::PointerType::getUnqual(Int8Ty);
526
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
527
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
528
    break;
529
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_s8:
530
    Param0 = 8;
531
    Param1 = 0;
532
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
533
    Param3 = llvm::PointerType::getUnqual(Int8Ty);
534
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
535
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
536
    break;
537
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_u16:
538
    Param0 = 8;
539
    Param1 = 0;
540
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
541
    Param3 = llvm::PointerType::getUnqual(Int8Ty);
542
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
543
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
544
    break;
545
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_u32:
546
    Param0 = 8;
547
    Param1 = 0;
548
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
549
    Param3 = llvm::PointerType::getUnqual(Int8Ty);
550
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
551
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
552
    break;
553
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_p_u8:
554
    Param0 = 8;
555
    Param1 = 0;
556
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
557
    Param3 = llvm::PointerType::getUnqual(Int8Ty);
558
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
559
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
560
    break;
561
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_offset_p_s64:
562
    Param0 = 64;
563
    Param1 = 0;
564
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
565
    Param3 = llvm::PointerType::getUnqual(Int64Ty);
566
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
567
    Param5 = llvm::FixedVectorType::get(Int64Ty, 2);
568
    break;
569
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_offset_p_u64:
570
    Param0 = 64;
571
    Param1 = 0;
572
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
573
    Param3 = llvm::PointerType::getUnqual(Int64Ty);
574
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
575
    Param5 = llvm::FixedVectorType::get(Int64Ty, 2);
576
    break;
577
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_shifted_offset_p_s64:
578
    Param0 = 64;
579
    Param1 = 3;
580
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
581
    Param3 = llvm::PointerType::getUnqual(Int64Ty);
582
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
583
    Param5 = llvm::FixedVectorType::get(Int64Ty, 2);
584
    break;
585
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_shifted_offset_p_u64:
586
    Param0 = 64;
587
    Param1 = 3;
588
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
589
    Param3 = llvm::PointerType::getUnqual(Int64Ty);
590
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
591
    Param5 = llvm::FixedVectorType::get(Int64Ty, 2);
592
    break;
593
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_f16:
594
    Param0 = 16;
595
    Param1 = 0;
596
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
597
    Param3 = llvm::PointerType::getUnqual(HalfTy);
598
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
599
    Param5 = llvm::FixedVectorType::get(HalfTy, 8);
600
    break;
601
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_s16:
602
    Param0 = 16;
603
    Param1 = 0;
604
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
605
    Param3 = llvm::PointerType::getUnqual(Int16Ty);
606
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
607
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
608
    break;
609
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_s32:
610
    Param0 = 16;
611
    Param1 = 0;
612
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
613
    Param3 = llvm::PointerType::getUnqual(Int16Ty);
614
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
615
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
616
    break;
617
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_u16:
618
    Param0 = 16;
619
    Param1 = 0;
620
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
621
    Param3 = llvm::PointerType::getUnqual(Int16Ty);
622
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
623
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
624
    break;
625
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_p_u32:
626
    Param0 = 16;
627
    Param1 = 0;
628
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
629
    Param3 = llvm::PointerType::getUnqual(Int16Ty);
630
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
631
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
632
    break;
633
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_f16:
634
    Param0 = 16;
635
    Param1 = 1;
636
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
637
    Param3 = llvm::PointerType::getUnqual(HalfTy);
638
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
639
    Param5 = llvm::FixedVectorType::get(HalfTy, 8);
640
    break;
641
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_s16:
642
    Param0 = 16;
643
    Param1 = 1;
644
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
645
    Param3 = llvm::PointerType::getUnqual(Int16Ty);
646
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
647
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
648
    break;
649
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_s32:
650
    Param0 = 16;
651
    Param1 = 1;
652
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
653
    Param3 = llvm::PointerType::getUnqual(Int16Ty);
654
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
655
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
656
    break;
657
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_u16:
658
    Param0 = 16;
659
    Param1 = 1;
660
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
661
    Param3 = llvm::PointerType::getUnqual(Int16Ty);
662
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
663
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
664
    break;
665
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_p_u32:
666
    Param0 = 16;
667
    Param1 = 1;
668
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
669
    Param3 = llvm::PointerType::getUnqual(Int16Ty);
670
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
671
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
672
    break;
673
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_p_f32:
674
    Param0 = 32;
675
    Param1 = 0;
676
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
677
    Param3 = llvm::PointerType::getUnqual(FloatTy);
678
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
679
    Param5 = llvm::FixedVectorType::get(FloatTy, 4);
680
    break;
681
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_p_s32:
682
    Param0 = 32;
683
    Param1 = 0;
684
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
685
    Param3 = llvm::PointerType::getUnqual(Int32Ty);
686
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
687
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
688
    break;
689
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_p_u32:
690
    Param0 = 32;
691
    Param1 = 0;
692
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
693
    Param3 = llvm::PointerType::getUnqual(Int32Ty);
694
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
695
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
696
    break;
697
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_p_f32:
698
    Param0 = 32;
699
    Param1 = 2;
700
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
701
    Param3 = llvm::PointerType::getUnqual(FloatTy);
702
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
703
    Param5 = llvm::FixedVectorType::get(FloatTy, 4);
704
    break;
705
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_p_s32:
706
    Param0 = 32;
707
    Param1 = 2;
708
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
709
    Param3 = llvm::PointerType::getUnqual(Int32Ty);
710
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
711
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
712
    break;
713
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_p_u32:
714
    Param0 = 32;
715
    Param1 = 2;
716
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
717
    Param3 = llvm::PointerType::getUnqual(Int32Ty);
718
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
719
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
720
    break;
721
  }
722
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
723
  Value *Val1 = EmitScalarExpr(E->getArg(1));
724
  Value *Val2 = EmitScalarExpr(E->getArg(2));
725
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
726
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param1);
727
  Value *Val5 = EmitScalarExpr(E->getArg(3));
728
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
729
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param2}), {Val6});
730
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vstr_scatter_offset_predicated, {Param3, Param4, Param5, Param2}), {(Val0.getPointer()), Val1, Val2, Val3, Val4, Val7});
731
}
732
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_s16:
733
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_s32:
734
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_s8:
735
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_u16:
736
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_u32:
737
case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_u8:
738
case ARM::BI__builtin_arm_mve_vstrdq_scatter_offset_s64:
739
case ARM::BI__builtin_arm_mve_vstrdq_scatter_offset_u64:
740
case ARM::BI__builtin_arm_mve_vstrdq_scatter_shifted_offset_s64:
741
case ARM::BI__builtin_arm_mve_vstrdq_scatter_shifted_offset_u64:
742
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_f16:
743
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_s16:
744
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_s32:
745
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_u16:
746
case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_u32:
747
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_f16:
748
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_s16:
749
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_s32:
750
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_u16:
751
case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_u32:
752
case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_f32:
753
case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_s32:
754
case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_u32:
755
case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_f32:
756
case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_s32:
757
case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_u32: {
758
  uint32_t  Param0;
759
  uint32_t  Param1;
760
  llvm::Type * Param2;
761
  llvm::Type * Param3;
762
  llvm::Type * Param4;
763
  switch (BuiltinID) {
764
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_s16:
765
    Param0 = 8;
766
    Param1 = 0;
767
    Param2 = llvm::PointerType::getUnqual(Int8Ty);
768
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
769
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
770
    break;
771
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_s32:
772
    Param0 = 8;
773
    Param1 = 0;
774
    Param2 = llvm::PointerType::getUnqual(Int8Ty);
775
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
776
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
777
    break;
778
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_s8:
779
    Param0 = 8;
780
    Param1 = 0;
781
    Param2 = llvm::PointerType::getUnqual(Int8Ty);
782
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
783
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
784
    break;
785
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_u16:
786
    Param0 = 8;
787
    Param1 = 0;
788
    Param2 = llvm::PointerType::getUnqual(Int8Ty);
789
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
790
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
791
    break;
792
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_u32:
793
    Param0 = 8;
794
    Param1 = 0;
795
    Param2 = llvm::PointerType::getUnqual(Int8Ty);
796
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
797
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
798
    break;
799
  case ARM::BI__builtin_arm_mve_vstrbq_scatter_offset_u8:
800
    Param0 = 8;
801
    Param1 = 0;
802
    Param2 = llvm::PointerType::getUnqual(Int8Ty);
803
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
804
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
805
    break;
806
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_offset_s64:
807
    Param0 = 64;
808
    Param1 = 0;
809
    Param2 = llvm::PointerType::getUnqual(Int64Ty);
810
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
811
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
812
    break;
813
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_offset_u64:
814
    Param0 = 64;
815
    Param1 = 0;
816
    Param2 = llvm::PointerType::getUnqual(Int64Ty);
817
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
818
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
819
    break;
820
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_shifted_offset_s64:
821
    Param0 = 64;
822
    Param1 = 3;
823
    Param2 = llvm::PointerType::getUnqual(Int64Ty);
824
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
825
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
826
    break;
827
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_shifted_offset_u64:
828
    Param0 = 64;
829
    Param1 = 3;
830
    Param2 = llvm::PointerType::getUnqual(Int64Ty);
831
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
832
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
833
    break;
834
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_f16:
835
    Param0 = 16;
836
    Param1 = 0;
837
    Param2 = llvm::PointerType::getUnqual(HalfTy);
838
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
839
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
840
    break;
841
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_s16:
842
    Param0 = 16;
843
    Param1 = 0;
844
    Param2 = llvm::PointerType::getUnqual(Int16Ty);
845
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
846
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
847
    break;
848
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_s32:
849
    Param0 = 16;
850
    Param1 = 0;
851
    Param2 = llvm::PointerType::getUnqual(Int16Ty);
852
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
853
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
854
    break;
855
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_u16:
856
    Param0 = 16;
857
    Param1 = 0;
858
    Param2 = llvm::PointerType::getUnqual(Int16Ty);
859
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
860
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
861
    break;
862
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_offset_u32:
863
    Param0 = 16;
864
    Param1 = 0;
865
    Param2 = llvm::PointerType::getUnqual(Int16Ty);
866
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
867
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
868
    break;
869
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_f16:
870
    Param0 = 16;
871
    Param1 = 1;
872
    Param2 = llvm::PointerType::getUnqual(HalfTy);
873
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
874
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
875
    break;
876
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_s16:
877
    Param0 = 16;
878
    Param1 = 1;
879
    Param2 = llvm::PointerType::getUnqual(Int16Ty);
880
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
881
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
882
    break;
883
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_s32:
884
    Param0 = 16;
885
    Param1 = 1;
886
    Param2 = llvm::PointerType::getUnqual(Int16Ty);
887
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
888
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
889
    break;
890
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_u16:
891
    Param0 = 16;
892
    Param1 = 1;
893
    Param2 = llvm::PointerType::getUnqual(Int16Ty);
894
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
895
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
896
    break;
897
  case ARM::BI__builtin_arm_mve_vstrhq_scatter_shifted_offset_u32:
898
    Param0 = 16;
899
    Param1 = 1;
900
    Param2 = llvm::PointerType::getUnqual(Int16Ty);
901
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
902
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
903
    break;
904
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_f32:
905
    Param0 = 32;
906
    Param1 = 0;
907
    Param2 = llvm::PointerType::getUnqual(FloatTy);
908
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
909
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
910
    break;
911
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_s32:
912
    Param0 = 32;
913
    Param1 = 0;
914
    Param2 = llvm::PointerType::getUnqual(Int32Ty);
915
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
916
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
917
    break;
918
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_offset_u32:
919
    Param0 = 32;
920
    Param1 = 0;
921
    Param2 = llvm::PointerType::getUnqual(Int32Ty);
922
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
923
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
924
    break;
925
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_f32:
926
    Param0 = 32;
927
    Param1 = 2;
928
    Param2 = llvm::PointerType::getUnqual(FloatTy);
929
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
930
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
931
    break;
932
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_s32:
933
    Param0 = 32;
934
    Param1 = 2;
935
    Param2 = llvm::PointerType::getUnqual(Int32Ty);
936
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
937
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
938
    break;
939
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_shifted_offset_u32:
940
    Param0 = 32;
941
    Param1 = 2;
942
    Param2 = llvm::PointerType::getUnqual(Int32Ty);
943
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
944
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
945
    break;
946
  }
947
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
948
  Value *Val1 = EmitScalarExpr(E->getArg(1));
949
  Value *Val2 = EmitScalarExpr(E->getArg(2));
950
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
951
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param1);
952
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vstr_scatter_offset, {Param2, Param3, Param4}), {(Val0.getPointer()), Val1, Val2, Val3, Val4});
953
}
954
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_s16:
955
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_s32:
956
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_s8:
957
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_u16:
958
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_u32:
959
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_u8:
960
case ARM::BI__builtin_arm_mve_vldrdq_gather_offset_z_s64:
961
case ARM::BI__builtin_arm_mve_vldrdq_gather_offset_z_u64:
962
case ARM::BI__builtin_arm_mve_vldrdq_gather_shifted_offset_z_s64:
963
case ARM::BI__builtin_arm_mve_vldrdq_gather_shifted_offset_z_u64:
964
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_f16:
965
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_s16:
966
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_s32:
967
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_u16:
968
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_u32:
969
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_f16:
970
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_s16:
971
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_s32:
972
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_u16:
973
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_u32:
974
case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_z_f32:
975
case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_z_s32:
976
case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_z_u32:
977
case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_z_f32:
978
case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_z_s32:
979
case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_z_u32: {
980
  uint32_t  Param0;
981
  uint32_t  Param1;
982
  uint32_t  Param2;
983
  llvm::Type * Param3;
984
  llvm::Type * Param4;
985
  llvm::Type * Param5;
986
  llvm::Type * Param6;
987
  switch (BuiltinID) {
988
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_s16:
989
    Param0 = 8;
990
    Param1 = 0;
991
    Param2 = 0;
992
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
993
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
994
    Param5 = llvm::PointerType::getUnqual(Int8Ty);
995
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
996
    break;
997
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_s32:
998
    Param0 = 8;
999
    Param1 = 0;
1000
    Param2 = 0;
1001
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1002
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1003
    Param5 = llvm::PointerType::getUnqual(Int8Ty);
1004
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1005
    break;
1006
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_s8:
1007
    Param0 = 8;
1008
    Param1 = 0;
1009
    Param2 = 0;
1010
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1011
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
1012
    Param5 = llvm::PointerType::getUnqual(Int8Ty);
1013
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
1014
    break;
1015
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_u16:
1016
    Param0 = 8;
1017
    Param1 = 0;
1018
    Param2 = 1;
1019
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1020
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
1021
    Param5 = llvm::PointerType::getUnqual(Int8Ty);
1022
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
1023
    break;
1024
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_u32:
1025
    Param0 = 8;
1026
    Param1 = 0;
1027
    Param2 = 1;
1028
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1029
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1030
    Param5 = llvm::PointerType::getUnqual(Int8Ty);
1031
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1032
    break;
1033
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_z_u8:
1034
    Param0 = 8;
1035
    Param1 = 0;
1036
    Param2 = 1;
1037
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1038
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
1039
    Param5 = llvm::PointerType::getUnqual(Int8Ty);
1040
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
1041
    break;
1042
  case ARM::BI__builtin_arm_mve_vldrdq_gather_offset_z_s64:
1043
    Param0 = 64;
1044
    Param1 = 0;
1045
    Param2 = 0;
1046
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
1047
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
1048
    Param5 = llvm::PointerType::getUnqual(Int64Ty);
1049
    Param6 = llvm::FixedVectorType::get(Int64Ty, 2);
1050
    break;
1051
  case ARM::BI__builtin_arm_mve_vldrdq_gather_offset_z_u64:
1052
    Param0 = 64;
1053
    Param1 = 0;
1054
    Param2 = 1;
1055
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
1056
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
1057
    Param5 = llvm::PointerType::getUnqual(Int64Ty);
1058
    Param6 = llvm::FixedVectorType::get(Int64Ty, 2);
1059
    break;
1060
  case ARM::BI__builtin_arm_mve_vldrdq_gather_shifted_offset_z_s64:
1061
    Param0 = 64;
1062
    Param1 = 3;
1063
    Param2 = 0;
1064
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
1065
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
1066
    Param5 = llvm::PointerType::getUnqual(Int64Ty);
1067
    Param6 = llvm::FixedVectorType::get(Int64Ty, 2);
1068
    break;
1069
  case ARM::BI__builtin_arm_mve_vldrdq_gather_shifted_offset_z_u64:
1070
    Param0 = 64;
1071
    Param1 = 3;
1072
    Param2 = 1;
1073
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
1074
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
1075
    Param5 = llvm::PointerType::getUnqual(Int64Ty);
1076
    Param6 = llvm::FixedVectorType::get(Int64Ty, 2);
1077
    break;
1078
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_f16:
1079
    Param0 = 16;
1080
    Param1 = 0;
1081
    Param2 = 0;
1082
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1083
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
1084
    Param5 = llvm::PointerType::getUnqual(HalfTy);
1085
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
1086
    break;
1087
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_s16:
1088
    Param0 = 16;
1089
    Param1 = 0;
1090
    Param2 = 0;
1091
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1092
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
1093
    Param5 = llvm::PointerType::getUnqual(Int16Ty);
1094
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
1095
    break;
1096
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_s32:
1097
    Param0 = 16;
1098
    Param1 = 0;
1099
    Param2 = 0;
1100
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1101
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1102
    Param5 = llvm::PointerType::getUnqual(Int16Ty);
1103
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1104
    break;
1105
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_u16:
1106
    Param0 = 16;
1107
    Param1 = 0;
1108
    Param2 = 1;
1109
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1110
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
1111
    Param5 = llvm::PointerType::getUnqual(Int16Ty);
1112
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
1113
    break;
1114
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_z_u32:
1115
    Param0 = 16;
1116
    Param1 = 0;
1117
    Param2 = 1;
1118
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1119
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1120
    Param5 = llvm::PointerType::getUnqual(Int16Ty);
1121
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1122
    break;
1123
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_f16:
1124
    Param0 = 16;
1125
    Param1 = 1;
1126
    Param2 = 0;
1127
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1128
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
1129
    Param5 = llvm::PointerType::getUnqual(HalfTy);
1130
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
1131
    break;
1132
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_s16:
1133
    Param0 = 16;
1134
    Param1 = 1;
1135
    Param2 = 0;
1136
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1137
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
1138
    Param5 = llvm::PointerType::getUnqual(Int16Ty);
1139
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
1140
    break;
1141
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_s32:
1142
    Param0 = 16;
1143
    Param1 = 1;
1144
    Param2 = 0;
1145
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1146
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1147
    Param5 = llvm::PointerType::getUnqual(Int16Ty);
1148
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1149
    break;
1150
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_u16:
1151
    Param0 = 16;
1152
    Param1 = 1;
1153
    Param2 = 1;
1154
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1155
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
1156
    Param5 = llvm::PointerType::getUnqual(Int16Ty);
1157
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
1158
    break;
1159
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_z_u32:
1160
    Param0 = 16;
1161
    Param1 = 1;
1162
    Param2 = 1;
1163
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1164
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1165
    Param5 = llvm::PointerType::getUnqual(Int16Ty);
1166
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1167
    break;
1168
  case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_z_f32:
1169
    Param0 = 32;
1170
    Param1 = 0;
1171
    Param2 = 0;
1172
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1173
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
1174
    Param5 = llvm::PointerType::getUnqual(FloatTy);
1175
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1176
    break;
1177
  case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_z_s32:
1178
    Param0 = 32;
1179
    Param1 = 0;
1180
    Param2 = 0;
1181
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1182
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1183
    Param5 = llvm::PointerType::getUnqual(Int32Ty);
1184
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1185
    break;
1186
  case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_z_u32:
1187
    Param0 = 32;
1188
    Param1 = 0;
1189
    Param2 = 1;
1190
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1191
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1192
    Param5 = llvm::PointerType::getUnqual(Int32Ty);
1193
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1194
    break;
1195
  case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_z_f32:
1196
    Param0 = 32;
1197
    Param1 = 2;
1198
    Param2 = 0;
1199
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1200
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
1201
    Param5 = llvm::PointerType::getUnqual(FloatTy);
1202
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1203
    break;
1204
  case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_z_s32:
1205
    Param0 = 32;
1206
    Param1 = 2;
1207
    Param2 = 0;
1208
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1209
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1210
    Param5 = llvm::PointerType::getUnqual(Int32Ty);
1211
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1212
    break;
1213
  case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_z_u32:
1214
    Param0 = 32;
1215
    Param1 = 2;
1216
    Param2 = 1;
1217
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1218
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
1219
    Param5 = llvm::PointerType::getUnqual(Int32Ty);
1220
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
1221
    break;
1222
  }
1223
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
1224
  Value *Val1 = EmitScalarExpr(E->getArg(1));
1225
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
1226
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
1227
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param2);
1228
  Value *Val5 = EmitScalarExpr(E->getArg(2));
1229
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
1230
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val6});
1231
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vldr_gather_offset_predicated, {Param4, Param5, Param6, Param3}), {(Val0.getPointer()), Val1, Val2, Val3, Val4, Val7});
1232
}
1233
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_s16:
1234
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_s32:
1235
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_s8:
1236
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_u16:
1237
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_u32:
1238
case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_u8:
1239
case ARM::BI__builtin_arm_mve_vldrdq_gather_offset_s64:
1240
case ARM::BI__builtin_arm_mve_vldrdq_gather_offset_u64:
1241
case ARM::BI__builtin_arm_mve_vldrdq_gather_shifted_offset_s64:
1242
case ARM::BI__builtin_arm_mve_vldrdq_gather_shifted_offset_u64:
1243
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_f16:
1244
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_s16:
1245
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_s32:
1246
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_u16:
1247
case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_u32:
1248
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_f16:
1249
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_s16:
1250
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_s32:
1251
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_u16:
1252
case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_u32:
1253
case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_f32:
1254
case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_s32:
1255
case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_u32:
1256
case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_f32:
1257
case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_s32:
1258
case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_u32: {
1259
  uint32_t  Param0;
1260
  uint32_t  Param1;
1261
  uint32_t  Param2;
1262
  llvm::Type * Param3;
1263
  llvm::Type * Param4;
1264
  llvm::Type * Param5;
1265
  switch (BuiltinID) {
1266
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_s16:
1267
    Param0 = 8;
1268
    Param1 = 0;
1269
    Param2 = 0;
1270
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
1271
    Param4 = llvm::PointerType::getUnqual(Int8Ty);
1272
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
1273
    break;
1274
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_s32:
1275
    Param0 = 8;
1276
    Param1 = 0;
1277
    Param2 = 0;
1278
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1279
    Param4 = llvm::PointerType::getUnqual(Int8Ty);
1280
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1281
    break;
1282
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_s8:
1283
    Param0 = 8;
1284
    Param1 = 0;
1285
    Param2 = 0;
1286
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
1287
    Param4 = llvm::PointerType::getUnqual(Int8Ty);
1288
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
1289
    break;
1290
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_u16:
1291
    Param0 = 8;
1292
    Param1 = 0;
1293
    Param2 = 1;
1294
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
1295
    Param4 = llvm::PointerType::getUnqual(Int8Ty);
1296
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
1297
    break;
1298
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_u32:
1299
    Param0 = 8;
1300
    Param1 = 0;
1301
    Param2 = 1;
1302
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1303
    Param4 = llvm::PointerType::getUnqual(Int8Ty);
1304
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1305
    break;
1306
  case ARM::BI__builtin_arm_mve_vldrbq_gather_offset_u8:
1307
    Param0 = 8;
1308
    Param1 = 0;
1309
    Param2 = 1;
1310
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
1311
    Param4 = llvm::PointerType::getUnqual(Int8Ty);
1312
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
1313
    break;
1314
  case ARM::BI__builtin_arm_mve_vldrdq_gather_offset_s64:
1315
    Param0 = 64;
1316
    Param1 = 0;
1317
    Param2 = 0;
1318
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
1319
    Param4 = llvm::PointerType::getUnqual(Int64Ty);
1320
    Param5 = llvm::FixedVectorType::get(Int64Ty, 2);
1321
    break;
1322
  case ARM::BI__builtin_arm_mve_vldrdq_gather_offset_u64:
1323
    Param0 = 64;
1324
    Param1 = 0;
1325
    Param2 = 1;
1326
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
1327
    Param4 = llvm::PointerType::getUnqual(Int64Ty);
1328
    Param5 = llvm::FixedVectorType::get(Int64Ty, 2);
1329
    break;
1330
  case ARM::BI__builtin_arm_mve_vldrdq_gather_shifted_offset_s64:
1331
    Param0 = 64;
1332
    Param1 = 3;
1333
    Param2 = 0;
1334
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
1335
    Param4 = llvm::PointerType::getUnqual(Int64Ty);
1336
    Param5 = llvm::FixedVectorType::get(Int64Ty, 2);
1337
    break;
1338
  case ARM::BI__builtin_arm_mve_vldrdq_gather_shifted_offset_u64:
1339
    Param0 = 64;
1340
    Param1 = 3;
1341
    Param2 = 1;
1342
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
1343
    Param4 = llvm::PointerType::getUnqual(Int64Ty);
1344
    Param5 = llvm::FixedVectorType::get(Int64Ty, 2);
1345
    break;
1346
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_f16:
1347
    Param0 = 16;
1348
    Param1 = 0;
1349
    Param2 = 0;
1350
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
1351
    Param4 = llvm::PointerType::getUnqual(HalfTy);
1352
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
1353
    break;
1354
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_s16:
1355
    Param0 = 16;
1356
    Param1 = 0;
1357
    Param2 = 0;
1358
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
1359
    Param4 = llvm::PointerType::getUnqual(Int16Ty);
1360
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
1361
    break;
1362
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_s32:
1363
    Param0 = 16;
1364
    Param1 = 0;
1365
    Param2 = 0;
1366
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1367
    Param4 = llvm::PointerType::getUnqual(Int16Ty);
1368
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1369
    break;
1370
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_u16:
1371
    Param0 = 16;
1372
    Param1 = 0;
1373
    Param2 = 1;
1374
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
1375
    Param4 = llvm::PointerType::getUnqual(Int16Ty);
1376
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
1377
    break;
1378
  case ARM::BI__builtin_arm_mve_vldrhq_gather_offset_u32:
1379
    Param0 = 16;
1380
    Param1 = 0;
1381
    Param2 = 1;
1382
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1383
    Param4 = llvm::PointerType::getUnqual(Int16Ty);
1384
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1385
    break;
1386
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_f16:
1387
    Param0 = 16;
1388
    Param1 = 1;
1389
    Param2 = 0;
1390
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
1391
    Param4 = llvm::PointerType::getUnqual(HalfTy);
1392
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
1393
    break;
1394
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_s16:
1395
    Param0 = 16;
1396
    Param1 = 1;
1397
    Param2 = 0;
1398
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
1399
    Param4 = llvm::PointerType::getUnqual(Int16Ty);
1400
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
1401
    break;
1402
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_s32:
1403
    Param0 = 16;
1404
    Param1 = 1;
1405
    Param2 = 0;
1406
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1407
    Param4 = llvm::PointerType::getUnqual(Int16Ty);
1408
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1409
    break;
1410
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_u16:
1411
    Param0 = 16;
1412
    Param1 = 1;
1413
    Param2 = 1;
1414
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
1415
    Param4 = llvm::PointerType::getUnqual(Int16Ty);
1416
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
1417
    break;
1418
  case ARM::BI__builtin_arm_mve_vldrhq_gather_shifted_offset_u32:
1419
    Param0 = 16;
1420
    Param1 = 1;
1421
    Param2 = 1;
1422
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1423
    Param4 = llvm::PointerType::getUnqual(Int16Ty);
1424
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1425
    break;
1426
  case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_f32:
1427
    Param0 = 32;
1428
    Param1 = 0;
1429
    Param2 = 0;
1430
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
1431
    Param4 = llvm::PointerType::getUnqual(FloatTy);
1432
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1433
    break;
1434
  case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_s32:
1435
    Param0 = 32;
1436
    Param1 = 0;
1437
    Param2 = 0;
1438
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1439
    Param4 = llvm::PointerType::getUnqual(Int32Ty);
1440
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1441
    break;
1442
  case ARM::BI__builtin_arm_mve_vldrwq_gather_offset_u32:
1443
    Param0 = 32;
1444
    Param1 = 0;
1445
    Param2 = 1;
1446
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1447
    Param4 = llvm::PointerType::getUnqual(Int32Ty);
1448
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1449
    break;
1450
  case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_f32:
1451
    Param0 = 32;
1452
    Param1 = 2;
1453
    Param2 = 0;
1454
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
1455
    Param4 = llvm::PointerType::getUnqual(FloatTy);
1456
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1457
    break;
1458
  case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_s32:
1459
    Param0 = 32;
1460
    Param1 = 2;
1461
    Param2 = 0;
1462
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1463
    Param4 = llvm::PointerType::getUnqual(Int32Ty);
1464
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1465
    break;
1466
  case ARM::BI__builtin_arm_mve_vldrwq_gather_shifted_offset_u32:
1467
    Param0 = 32;
1468
    Param1 = 2;
1469
    Param2 = 1;
1470
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
1471
    Param4 = llvm::PointerType::getUnqual(Int32Ty);
1472
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
1473
    break;
1474
  }
1475
  Address Val0 = EmitPointerWithAlignment(E->getArg(0));
1476
  Value *Val1 = EmitScalarExpr(E->getArg(1));
1477
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
1478
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
1479
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param2);
1480
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vldr_gather_offset, {Param3, Param4, Param5}), {(Val0.getPointer()), Val1, Val2, Val3, Val4});
1481
}
1482
case ARM::BI__builtin_arm_mve_vshlcq_s16:
1483
case ARM::BI__builtin_arm_mve_vshlcq_s32:
1484
case ARM::BI__builtin_arm_mve_vshlcq_s8:
1485
case ARM::BI__builtin_arm_mve_vshlcq_u16:
1486
case ARM::BI__builtin_arm_mve_vshlcq_u32:
1487
case ARM::BI__builtin_arm_mve_vshlcq_u8: {
1488
  llvm::Type * Param0;
1489
  switch (BuiltinID) {
1490
  case ARM::BI__builtin_arm_mve_vshlcq_s16:
1491
    Param0 = llvm::FixedVectorType::get(Int16Ty, 8);
1492
    break;
1493
  case ARM::BI__builtin_arm_mve_vshlcq_s32:
1494
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
1495
    break;
1496
  case ARM::BI__builtin_arm_mve_vshlcq_s8:
1497
    Param0 = llvm::FixedVectorType::get(Int8Ty, 16);
1498
    break;
1499
  case ARM::BI__builtin_arm_mve_vshlcq_u16:
1500
    Param0 = llvm::FixedVectorType::get(Int16Ty, 8);
1501
    break;
1502
  case ARM::BI__builtin_arm_mve_vshlcq_u32:
1503
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
1504
    break;
1505
  case ARM::BI__builtin_arm_mve_vshlcq_u8:
1506
    Param0 = llvm::FixedVectorType::get(Int8Ty, 16);
1507
    break;
1508
  }
1509
  Address Val0 = EmitPointerWithAlignment(E->getArg(1));
1510
  Value *Val1 = Builder.CreateLoad(Val0);
1511
  Value *Val2 = EmitScalarExpr(E->getArg(0));
1512
  Value *Val3 = EmitScalarExpr(E->getArg(2));
1513
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshlc, {Param0}), {Val2, Val1, Val3});
1514
  Value *Val5 = Builder.CreateExtractValue(Val4, static_cast<unsigned>(0));
1515
  Builder.CreateStore(Val5, Val0);
1516
  return Builder.CreateExtractValue(Val4, static_cast<unsigned>(1));
1517
}
1518
case ARM::BI__builtin_arm_mve_vddupq_m_wb_u16:
1519
case ARM::BI__builtin_arm_mve_vddupq_m_wb_u32:
1520
case ARM::BI__builtin_arm_mve_vddupq_m_wb_u8:
1521
case ARM::BI__builtin_arm_mve_vidupq_m_wb_u16:
1522
case ARM::BI__builtin_arm_mve_vidupq_m_wb_u32:
1523
case ARM::BI__builtin_arm_mve_vidupq_m_wb_u8:
1524
case ARM::BI__builtin_arm_mve_vshlcq_m_s16:
1525
case ARM::BI__builtin_arm_mve_vshlcq_m_s32:
1526
case ARM::BI__builtin_arm_mve_vshlcq_m_s8:
1527
case ARM::BI__builtin_arm_mve_vshlcq_m_u16:
1528
case ARM::BI__builtin_arm_mve_vshlcq_m_u32:
1529
case ARM::BI__builtin_arm_mve_vshlcq_m_u8: {
1530
  llvm::Type * Param0;
1531
  Intrinsic::ID  Param1;
1532
  llvm::Type * Param2;
1533
  unsigned  Param3;
1534
  unsigned  Param4;
1535
  switch (BuiltinID) {
1536
  case ARM::BI__builtin_arm_mve_vddupq_m_wb_u16:
1537
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1538
    Param1 = Intrinsic::arm_mve_vddup_predicated;
1539
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1540
    Param3 = 1;
1541
    Param4 = 0;
1542
    break;
1543
  case ARM::BI__builtin_arm_mve_vddupq_m_wb_u32:
1544
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1545
    Param1 = Intrinsic::arm_mve_vddup_predicated;
1546
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
1547
    Param3 = 1;
1548
    Param4 = 0;
1549
    break;
1550
  case ARM::BI__builtin_arm_mve_vddupq_m_wb_u8:
1551
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1552
    Param1 = Intrinsic::arm_mve_vddup_predicated;
1553
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1554
    Param3 = 1;
1555
    Param4 = 0;
1556
    break;
1557
  case ARM::BI__builtin_arm_mve_vidupq_m_wb_u16:
1558
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1559
    Param1 = Intrinsic::arm_mve_vidup_predicated;
1560
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1561
    Param3 = 1;
1562
    Param4 = 0;
1563
    break;
1564
  case ARM::BI__builtin_arm_mve_vidupq_m_wb_u32:
1565
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1566
    Param1 = Intrinsic::arm_mve_vidup_predicated;
1567
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
1568
    Param3 = 1;
1569
    Param4 = 0;
1570
    break;
1571
  case ARM::BI__builtin_arm_mve_vidupq_m_wb_u8:
1572
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1573
    Param1 = Intrinsic::arm_mve_vidup_predicated;
1574
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1575
    Param3 = 1;
1576
    Param4 = 0;
1577
    break;
1578
  case ARM::BI__builtin_arm_mve_vshlcq_m_s16:
1579
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1580
    Param1 = Intrinsic::arm_mve_vshlc_predicated;
1581
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1582
    Param3 = 0;
1583
    Param4 = 1;
1584
    break;
1585
  case ARM::BI__builtin_arm_mve_vshlcq_m_s32:
1586
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1587
    Param1 = Intrinsic::arm_mve_vshlc_predicated;
1588
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
1589
    Param3 = 0;
1590
    Param4 = 1;
1591
    break;
1592
  case ARM::BI__builtin_arm_mve_vshlcq_m_s8:
1593
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1594
    Param1 = Intrinsic::arm_mve_vshlc_predicated;
1595
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1596
    Param3 = 0;
1597
    Param4 = 1;
1598
    break;
1599
  case ARM::BI__builtin_arm_mve_vshlcq_m_u16:
1600
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1601
    Param1 = Intrinsic::arm_mve_vshlc_predicated;
1602
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1603
    Param3 = 0;
1604
    Param4 = 1;
1605
    break;
1606
  case ARM::BI__builtin_arm_mve_vshlcq_m_u32:
1607
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1608
    Param1 = Intrinsic::arm_mve_vshlc_predicated;
1609
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
1610
    Param3 = 0;
1611
    Param4 = 1;
1612
    break;
1613
  case ARM::BI__builtin_arm_mve_vshlcq_m_u8:
1614
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1615
    Param1 = Intrinsic::arm_mve_vshlc_predicated;
1616
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1617
    Param3 = 0;
1618
    Param4 = 1;
1619
    break;
1620
  }
1621
  Address Val0 = EmitPointerWithAlignment(E->getArg(1));
1622
  Value *Val1 = Builder.CreateLoad(Val0);
1623
  Value *Val2 = EmitScalarExpr(E->getArg(0));
1624
  Value *Val3 = EmitScalarExpr(E->getArg(2));
1625
  Value *Val4 = EmitScalarExpr(E->getArg(3));
1626
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
1627
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val5});
1628
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val2, Val1, Val3, Val6});
1629
  Value *Val8 = Builder.CreateExtractValue(Val7, static_cast<unsigned>(Param3));
1630
  Builder.CreateStore(Val8, Val0);
1631
  return Builder.CreateExtractValue(Val7, static_cast<unsigned>(Param4));
1632
}
1633
case ARM::BI__builtin_arm_mve_vdwdupq_m_wb_u16:
1634
case ARM::BI__builtin_arm_mve_vdwdupq_m_wb_u32:
1635
case ARM::BI__builtin_arm_mve_vdwdupq_m_wb_u8:
1636
case ARM::BI__builtin_arm_mve_viwdupq_m_wb_u16:
1637
case ARM::BI__builtin_arm_mve_viwdupq_m_wb_u32:
1638
case ARM::BI__builtin_arm_mve_viwdupq_m_wb_u8: {
1639
  llvm::Type * Param0;
1640
  Intrinsic::ID  Param1;
1641
  llvm::Type * Param2;
1642
  switch (BuiltinID) {
1643
  case ARM::BI__builtin_arm_mve_vdwdupq_m_wb_u16:
1644
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1645
    Param1 = Intrinsic::arm_mve_vdwdup_predicated;
1646
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1647
    break;
1648
  case ARM::BI__builtin_arm_mve_vdwdupq_m_wb_u32:
1649
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1650
    Param1 = Intrinsic::arm_mve_vdwdup_predicated;
1651
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
1652
    break;
1653
  case ARM::BI__builtin_arm_mve_vdwdupq_m_wb_u8:
1654
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1655
    Param1 = Intrinsic::arm_mve_vdwdup_predicated;
1656
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1657
    break;
1658
  case ARM::BI__builtin_arm_mve_viwdupq_m_wb_u16:
1659
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1660
    Param1 = Intrinsic::arm_mve_viwdup_predicated;
1661
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1662
    break;
1663
  case ARM::BI__builtin_arm_mve_viwdupq_m_wb_u32:
1664
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1665
    Param1 = Intrinsic::arm_mve_viwdup_predicated;
1666
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
1667
    break;
1668
  case ARM::BI__builtin_arm_mve_viwdupq_m_wb_u8:
1669
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1670
    Param1 = Intrinsic::arm_mve_viwdup_predicated;
1671
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1672
    break;
1673
  }
1674
  Address Val0 = EmitPointerWithAlignment(E->getArg(1));
1675
  Value *Val1 = Builder.CreateLoad(Val0);
1676
  Value *Val2 = EmitScalarExpr(E->getArg(0));
1677
  Value *Val3 = EmitScalarExpr(E->getArg(2));
1678
  Value *Val4 = EmitScalarExpr(E->getArg(3));
1679
  Value *Val5 = EmitScalarExpr(E->getArg(4));
1680
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
1681
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val6});
1682
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val2, Val1, Val3, Val4, Val7});
1683
  Value *Val9 = Builder.CreateExtractValue(Val8, static_cast<unsigned>(1));
1684
  Builder.CreateStore(Val9, Val0);
1685
  return Builder.CreateExtractValue(Val8, static_cast<unsigned>(0));
1686
}
1687
case ARM::BI__builtin_arm_mve_vld2q_f16:
1688
case ARM::BI__builtin_arm_mve_vld2q_f32:
1689
case ARM::BI__builtin_arm_mve_vld2q_s16:
1690
case ARM::BI__builtin_arm_mve_vld2q_s32:
1691
case ARM::BI__builtin_arm_mve_vld2q_s8:
1692
case ARM::BI__builtin_arm_mve_vld2q_u16:
1693
case ARM::BI__builtin_arm_mve_vld2q_u32:
1694
case ARM::BI__builtin_arm_mve_vld2q_u8: {
1695
  CustomCodeGenType = CustomCodeGen::VLD24;
1696
  IRIntr = Intrinsic::arm_mve_vld2q;
1697
  NumVectors = 2;
1698
  break; // custom code gen
1699
}
1700
case ARM::BI__builtin_arm_mve_vld4q_f16:
1701
case ARM::BI__builtin_arm_mve_vld4q_f32:
1702
case ARM::BI__builtin_arm_mve_vld4q_s16:
1703
case ARM::BI__builtin_arm_mve_vld4q_s32:
1704
case ARM::BI__builtin_arm_mve_vld4q_s8:
1705
case ARM::BI__builtin_arm_mve_vld4q_u16:
1706
case ARM::BI__builtin_arm_mve_vld4q_u32:
1707
case ARM::BI__builtin_arm_mve_vld4q_u8: {
1708
  CustomCodeGenType = CustomCodeGen::VLD24;
1709
  IRIntr = Intrinsic::arm_mve_vld4q;
1710
  NumVectors = 4;
1711
  break; // custom code gen
1712
}
1713
case ARM::BI__builtin_arm_mve_vst2q_f16:
1714
case ARM::BI__builtin_arm_mve_vst2q_f32:
1715
case ARM::BI__builtin_arm_mve_vst2q_s16:
1716
case ARM::BI__builtin_arm_mve_vst2q_s32:
1717
case ARM::BI__builtin_arm_mve_vst2q_s8:
1718
case ARM::BI__builtin_arm_mve_vst2q_u16:
1719
case ARM::BI__builtin_arm_mve_vst2q_u32:
1720
case ARM::BI__builtin_arm_mve_vst2q_u8: {
1721
  CustomCodeGenType = CustomCodeGen::VST24;
1722
  IRIntr = Intrinsic::arm_mve_vst2q;
1723
  NumVectors = 2;
1724
  break; // custom code gen
1725
}
1726
case ARM::BI__builtin_arm_mve_vst4q_f16:
1727
case ARM::BI__builtin_arm_mve_vst4q_f32:
1728
case ARM::BI__builtin_arm_mve_vst4q_s16:
1729
case ARM::BI__builtin_arm_mve_vst4q_s32:
1730
case ARM::BI__builtin_arm_mve_vst4q_s8:
1731
case ARM::BI__builtin_arm_mve_vst4q_u16:
1732
case ARM::BI__builtin_arm_mve_vst4q_u32:
1733
case ARM::BI__builtin_arm_mve_vst4q_u8: {
1734
  CustomCodeGenType = CustomCodeGen::VST24;
1735
  IRIntr = Intrinsic::arm_mve_vst4q;
1736
  NumVectors = 4;
1737
  break; // custom code gen
1738
}
1739
case ARM::BI__builtin_arm_mve_vmaxnmaq_f16:
1740
case ARM::BI__builtin_arm_mve_vmaxnmaq_f32:
1741
case ARM::BI__builtin_arm_mve_vminnmaq_f16:
1742
case ARM::BI__builtin_arm_mve_vminnmaq_f32: {
1743
  llvm::Type * Param0;
1744
  Intrinsic::ID  Param1;
1745
  switch (BuiltinID) {
1746
  case ARM::BI__builtin_arm_mve_vmaxnmaq_f16:
1747
    Param0 = llvm::FixedVectorType::get(HalfTy, 8);
1748
    Param1 = Intrinsic::maxnum;
1749
    break;
1750
  case ARM::BI__builtin_arm_mve_vmaxnmaq_f32:
1751
    Param0 = llvm::FixedVectorType::get(FloatTy, 4);
1752
    Param1 = Intrinsic::maxnum;
1753
    break;
1754
  case ARM::BI__builtin_arm_mve_vminnmaq_f16:
1755
    Param0 = llvm::FixedVectorType::get(HalfTy, 8);
1756
    Param1 = Intrinsic::minnum;
1757
    break;
1758
  case ARM::BI__builtin_arm_mve_vminnmaq_f32:
1759
    Param0 = llvm::FixedVectorType::get(FloatTy, 4);
1760
    Param1 = Intrinsic::minnum;
1761
    break;
1762
  }
1763
  Value *Val0 = EmitScalarExpr(E->getArg(0));
1764
  Value *Val1 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::fabs, {Param0}), {Val0});
1765
  Value *Val2 = EmitScalarExpr(E->getArg(1));
1766
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::fabs, {Param0}), {Val2});
1767
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param0}), {Val1, Val3});
1768
}
1769
case ARM::BI__builtin_arm_mve_vctp16q:
1770
case ARM::BI__builtin_arm_mve_vctp32q:
1771
case ARM::BI__builtin_arm_mve_vctp64q:
1772
case ARM::BI__builtin_arm_mve_vctp8q: {
1773
  Intrinsic::ID  Param0;
1774
  llvm::Type * Param1;
1775
  switch (BuiltinID) {
1776
  case ARM::BI__builtin_arm_mve_vctp16q:
1777
    Param0 = Intrinsic::arm_mve_vctp16;
1778
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1779
    break;
1780
  case ARM::BI__builtin_arm_mve_vctp32q:
1781
    Param0 = Intrinsic::arm_mve_vctp32;
1782
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
1783
    break;
1784
  case ARM::BI__builtin_arm_mve_vctp64q:
1785
    Param0 = Intrinsic::arm_mve_vctp64;
1786
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
1787
    break;
1788
  case ARM::BI__builtin_arm_mve_vctp8q:
1789
    Param0 = Intrinsic::arm_mve_vctp8;
1790
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1791
    break;
1792
  }
1793
  Value *Val0 = EmitScalarExpr(E->getArg(0));
1794
  Value *Val1 = Builder.CreateCall(CGM.getIntrinsic(Param0), {Val0});
1795
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param1}), {Val1});
1796
  return Builder.CreateIntCast(Val2, Int16Ty, false);
1797
}
1798
case ARM::BI__builtin_arm_mve_vmvnq_n_s32:
1799
case ARM::BI__builtin_arm_mve_vmvnq_n_u32: {
1800
  bool  Param0;
1801
  switch (BuiltinID) {
1802
  case ARM::BI__builtin_arm_mve_vmvnq_n_s32:
1803
    Param0 = true;
1804
    break;
1805
  case ARM::BI__builtin_arm_mve_vmvnq_n_u32:
1806
    Param0 = false;
1807
    break;
1808
  }
1809
  Value *Val0 = EmitScalarExpr(E->getArg(0));
1810
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, Param0);
1811
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
1812
  return Builder.CreateNot(Val2);
1813
}
1814
case ARM::BI__builtin_arm_mve_vmvnq_n_s16:
1815
case ARM::BI__builtin_arm_mve_vmvnq_n_u16: {
1816
  bool  Param0;
1817
  switch (BuiltinID) {
1818
  case ARM::BI__builtin_arm_mve_vmvnq_n_s16:
1819
    Param0 = true;
1820
    break;
1821
  case ARM::BI__builtin_arm_mve_vmvnq_n_u16:
1822
    Param0 = false;
1823
    break;
1824
  }
1825
  Value *Val0 = EmitScalarExpr(E->getArg(0));
1826
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
1827
  Value *Val2 = Builder.CreateIntCast(Val1, Int16Ty, Param0);
1828
  Value *Val3 = ARMMVEVectorSplat(Builder, Val2);
1829
  return Builder.CreateNot(Val3);
1830
}
1831
case ARM::BI__builtin_arm_mve_vmaxavq_s16:
1832
case ARM::BI__builtin_arm_mve_vmaxavq_s8:
1833
case ARM::BI__builtin_arm_mve_vminavq_s16:
1834
case ARM::BI__builtin_arm_mve_vminavq_s8: {
1835
  Intrinsic::ID  Param0;
1836
  llvm::Type * Param1;
1837
  llvm::Type * Param2;
1838
  switch (BuiltinID) {
1839
  case ARM::BI__builtin_arm_mve_vmaxavq_s16:
1840
    Param0 = Intrinsic::arm_mve_maxav;
1841
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
1842
    Param2 = Int16Ty;
1843
    break;
1844
  case ARM::BI__builtin_arm_mve_vmaxavq_s8:
1845
    Param0 = Intrinsic::arm_mve_maxav;
1846
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
1847
    Param2 = Int8Ty;
1848
    break;
1849
  case ARM::BI__builtin_arm_mve_vminavq_s16:
1850
    Param0 = Intrinsic::arm_mve_minav;
1851
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
1852
    Param2 = Int16Ty;
1853
    break;
1854
  case ARM::BI__builtin_arm_mve_vminavq_s8:
1855
    Param0 = Intrinsic::arm_mve_minav;
1856
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
1857
    Param2 = Int8Ty;
1858
    break;
1859
  }
1860
  Value *Val0 = EmitScalarExpr(E->getArg(0));
1861
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
1862
  Value *Val2 = EmitScalarExpr(E->getArg(1));
1863
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val1, Val2});
1864
  return Builder.CreateIntCast(Val3, Param2, false);
1865
}
1866
case ARM::BI__builtin_arm_mve_vmaxavq_p_s16:
1867
case ARM::BI__builtin_arm_mve_vmaxavq_p_s8:
1868
case ARM::BI__builtin_arm_mve_vminavq_p_s16:
1869
case ARM::BI__builtin_arm_mve_vminavq_p_s8: {
1870
  llvm::Type * Param0;
1871
  Intrinsic::ID  Param1;
1872
  llvm::Type * Param2;
1873
  llvm::Type * Param3;
1874
  switch (BuiltinID) {
1875
  case ARM::BI__builtin_arm_mve_vmaxavq_p_s16:
1876
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1877
    Param1 = Intrinsic::arm_mve_maxav_predicated;
1878
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1879
    Param3 = Int16Ty;
1880
    break;
1881
  case ARM::BI__builtin_arm_mve_vmaxavq_p_s8:
1882
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1883
    Param1 = Intrinsic::arm_mve_maxav_predicated;
1884
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1885
    Param3 = Int8Ty;
1886
    break;
1887
  case ARM::BI__builtin_arm_mve_vminavq_p_s16:
1888
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
1889
    Param1 = Intrinsic::arm_mve_minav_predicated;
1890
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1891
    Param3 = Int16Ty;
1892
    break;
1893
  case ARM::BI__builtin_arm_mve_vminavq_p_s8:
1894
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
1895
    Param1 = Intrinsic::arm_mve_minav_predicated;
1896
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1897
    Param3 = Int8Ty;
1898
    break;
1899
  }
1900
  Value *Val0 = EmitScalarExpr(E->getArg(0));
1901
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
1902
  Value *Val2 = EmitScalarExpr(E->getArg(1));
1903
  Value *Val3 = EmitScalarExpr(E->getArg(2));
1904
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
1905
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val4});
1906
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val1, Val2, Val5});
1907
  return Builder.CreateIntCast(Val6, Param3, false);
1908
}
1909
case ARM::BI__builtin_arm_mve_vmaxvq_s16:
1910
case ARM::BI__builtin_arm_mve_vmaxvq_s8:
1911
case ARM::BI__builtin_arm_mve_vmaxvq_u16:
1912
case ARM::BI__builtin_arm_mve_vmaxvq_u8:
1913
case ARM::BI__builtin_arm_mve_vminvq_s16:
1914
case ARM::BI__builtin_arm_mve_vminvq_s8:
1915
case ARM::BI__builtin_arm_mve_vminvq_u16:
1916
case ARM::BI__builtin_arm_mve_vminvq_u8: {
1917
  uint32_t  Param0;
1918
  Intrinsic::ID  Param1;
1919
  llvm::Type * Param2;
1920
  llvm::Type * Param3;
1921
  bool  Param4;
1922
  switch (BuiltinID) {
1923
  case ARM::BI__builtin_arm_mve_vmaxvq_s16:
1924
    Param0 = 0;
1925
    Param1 = Intrinsic::arm_mve_maxv;
1926
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1927
    Param3 = Int16Ty;
1928
    Param4 = true;
1929
    break;
1930
  case ARM::BI__builtin_arm_mve_vmaxvq_s8:
1931
    Param0 = 0;
1932
    Param1 = Intrinsic::arm_mve_maxv;
1933
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1934
    Param3 = Int8Ty;
1935
    Param4 = true;
1936
    break;
1937
  case ARM::BI__builtin_arm_mve_vmaxvq_u16:
1938
    Param0 = 1;
1939
    Param1 = Intrinsic::arm_mve_maxv;
1940
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1941
    Param3 = Int16Ty;
1942
    Param4 = false;
1943
    break;
1944
  case ARM::BI__builtin_arm_mve_vmaxvq_u8:
1945
    Param0 = 1;
1946
    Param1 = Intrinsic::arm_mve_maxv;
1947
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1948
    Param3 = Int8Ty;
1949
    Param4 = false;
1950
    break;
1951
  case ARM::BI__builtin_arm_mve_vminvq_s16:
1952
    Param0 = 0;
1953
    Param1 = Intrinsic::arm_mve_minv;
1954
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1955
    Param3 = Int16Ty;
1956
    Param4 = true;
1957
    break;
1958
  case ARM::BI__builtin_arm_mve_vminvq_s8:
1959
    Param0 = 0;
1960
    Param1 = Intrinsic::arm_mve_minv;
1961
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1962
    Param3 = Int8Ty;
1963
    Param4 = true;
1964
    break;
1965
  case ARM::BI__builtin_arm_mve_vminvq_u16:
1966
    Param0 = 1;
1967
    Param1 = Intrinsic::arm_mve_minv;
1968
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
1969
    Param3 = Int16Ty;
1970
    Param4 = false;
1971
    break;
1972
  case ARM::BI__builtin_arm_mve_vminvq_u8:
1973
    Param0 = 1;
1974
    Param1 = Intrinsic::arm_mve_minv;
1975
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
1976
    Param3 = Int8Ty;
1977
    Param4 = false;
1978
    break;
1979
  }
1980
  Value *Val0 = EmitScalarExpr(E->getArg(0));
1981
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
1982
  Value *Val2 = EmitScalarExpr(E->getArg(1));
1983
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
1984
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2}), {Val1, Val2, Val3});
1985
  return Builder.CreateIntCast(Val4, Param3, Param4);
1986
}
1987
case ARM::BI__builtin_arm_mve_vmaxvq_p_s16:
1988
case ARM::BI__builtin_arm_mve_vmaxvq_p_s8:
1989
case ARM::BI__builtin_arm_mve_vmaxvq_p_u16:
1990
case ARM::BI__builtin_arm_mve_vmaxvq_p_u8:
1991
case ARM::BI__builtin_arm_mve_vminvq_p_s16:
1992
case ARM::BI__builtin_arm_mve_vminvq_p_s8:
1993
case ARM::BI__builtin_arm_mve_vminvq_p_u16:
1994
case ARM::BI__builtin_arm_mve_vminvq_p_u8: {
1995
  uint32_t  Param0;
1996
  llvm::Type * Param1;
1997
  Intrinsic::ID  Param2;
1998
  llvm::Type * Param3;
1999
  llvm::Type * Param4;
2000
  bool  Param5;
2001
  switch (BuiltinID) {
2002
  case ARM::BI__builtin_arm_mve_vmaxvq_p_s16:
2003
    Param0 = 0;
2004
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2005
    Param2 = Intrinsic::arm_mve_maxv_predicated;
2006
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
2007
    Param4 = Int16Ty;
2008
    Param5 = true;
2009
    break;
2010
  case ARM::BI__builtin_arm_mve_vmaxvq_p_s8:
2011
    Param0 = 0;
2012
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2013
    Param2 = Intrinsic::arm_mve_maxv_predicated;
2014
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
2015
    Param4 = Int8Ty;
2016
    Param5 = true;
2017
    break;
2018
  case ARM::BI__builtin_arm_mve_vmaxvq_p_u16:
2019
    Param0 = 1;
2020
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2021
    Param2 = Intrinsic::arm_mve_maxv_predicated;
2022
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
2023
    Param4 = Int16Ty;
2024
    Param5 = false;
2025
    break;
2026
  case ARM::BI__builtin_arm_mve_vmaxvq_p_u8:
2027
    Param0 = 1;
2028
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2029
    Param2 = Intrinsic::arm_mve_maxv_predicated;
2030
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
2031
    Param4 = Int8Ty;
2032
    Param5 = false;
2033
    break;
2034
  case ARM::BI__builtin_arm_mve_vminvq_p_s16:
2035
    Param0 = 0;
2036
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2037
    Param2 = Intrinsic::arm_mve_minv_predicated;
2038
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
2039
    Param4 = Int16Ty;
2040
    Param5 = true;
2041
    break;
2042
  case ARM::BI__builtin_arm_mve_vminvq_p_s8:
2043
    Param0 = 0;
2044
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2045
    Param2 = Intrinsic::arm_mve_minv_predicated;
2046
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
2047
    Param4 = Int8Ty;
2048
    Param5 = true;
2049
    break;
2050
  case ARM::BI__builtin_arm_mve_vminvq_p_u16:
2051
    Param0 = 1;
2052
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2053
    Param2 = Intrinsic::arm_mve_minv_predicated;
2054
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
2055
    Param4 = Int16Ty;
2056
    Param5 = false;
2057
    break;
2058
  case ARM::BI__builtin_arm_mve_vminvq_p_u8:
2059
    Param0 = 1;
2060
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2061
    Param2 = Intrinsic::arm_mve_minv_predicated;
2062
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
2063
    Param4 = Int8Ty;
2064
    Param5 = false;
2065
    break;
2066
  }
2067
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2068
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
2069
  Value *Val2 = EmitScalarExpr(E->getArg(1));
2070
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
2071
  Value *Val4 = EmitScalarExpr(E->getArg(2));
2072
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
2073
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val5});
2074
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param1}), {Val1, Val2, Val3, Val6});
2075
  return Builder.CreateIntCast(Val7, Param4, Param5);
2076
}
2077
case ARM::BI__builtin_arm_mve_vadcq_s32:
2078
case ARM::BI__builtin_arm_mve_vadcq_u32:
2079
case ARM::BI__builtin_arm_mve_vsbcq_s32:
2080
case ARM::BI__builtin_arm_mve_vsbcq_u32: {
2081
  Intrinsic::ID  Param0;
2082
  switch (BuiltinID) {
2083
  case ARM::BI__builtin_arm_mve_vadcq_s32:
2084
    Param0 = Intrinsic::arm_mve_vadc;
2085
    break;
2086
  case ARM::BI__builtin_arm_mve_vadcq_u32:
2087
    Param0 = Intrinsic::arm_mve_vadc;
2088
    break;
2089
  case ARM::BI__builtin_arm_mve_vsbcq_s32:
2090
    Param0 = Intrinsic::arm_mve_vsbc;
2091
    break;
2092
  case ARM::BI__builtin_arm_mve_vsbcq_u32:
2093
    Param0 = Intrinsic::arm_mve_vsbc;
2094
    break;
2095
  }
2096
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2097
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2098
  Address Val2 = EmitPointerWithAlignment(E->getArg(2));
2099
  Value *Val3 = Builder.CreateLoad(Val2);
2100
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, 29);
2101
  Value *Val5 = Builder.CreateShl(Val3, Val4);
2102
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4)}), {Val0, Val1, Val5});
2103
  Value *Val7 = llvm::ConstantInt::get(Int32Ty, 1);
2104
  Value *Val8 = Builder.CreateExtractValue(Val6, static_cast<unsigned>(1));
2105
  Value *Val9 = llvm::ConstantInt::get(Int32Ty, 29);
2106
  Value *Val10 = Builder.CreateLShr(Val8, Val9);
2107
  Value *Val11 = Builder.CreateAnd(Val7, Val10);
2108
  Builder.CreateStore(Val11, Val2);
2109
  return Builder.CreateExtractValue(Val6, static_cast<unsigned>(0));
2110
}
2111
case ARM::BI__builtin_arm_mve_vcmpeqq_n_f16:
2112
case ARM::BI__builtin_arm_mve_vcmpeqq_n_f32: {
2113
  llvm::Type * Param0;
2114
  switch (BuiltinID) {
2115
  case ARM::BI__builtin_arm_mve_vcmpeqq_n_f16:
2116
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2117
    break;
2118
  case ARM::BI__builtin_arm_mve_vcmpeqq_n_f32:
2119
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2120
    break;
2121
  }
2122
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2123
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2124
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2125
  Value *Val3 = Builder.CreateFCmpOEQ(Val0, Val2);
2126
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2127
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2128
}
2129
case ARM::BI__builtin_arm_mve_vcmpgeq_n_f16:
2130
case ARM::BI__builtin_arm_mve_vcmpgeq_n_f32: {
2131
  llvm::Type * Param0;
2132
  switch (BuiltinID) {
2133
  case ARM::BI__builtin_arm_mve_vcmpgeq_n_f16:
2134
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2135
    break;
2136
  case ARM::BI__builtin_arm_mve_vcmpgeq_n_f32:
2137
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2138
    break;
2139
  }
2140
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2141
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2142
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2143
  Value *Val3 = Builder.CreateFCmpOGE(Val0, Val2);
2144
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2145
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2146
}
2147
case ARM::BI__builtin_arm_mve_vcmpgtq_n_f16:
2148
case ARM::BI__builtin_arm_mve_vcmpgtq_n_f32: {
2149
  llvm::Type * Param0;
2150
  switch (BuiltinID) {
2151
  case ARM::BI__builtin_arm_mve_vcmpgtq_n_f16:
2152
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2153
    break;
2154
  case ARM::BI__builtin_arm_mve_vcmpgtq_n_f32:
2155
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2156
    break;
2157
  }
2158
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2159
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2160
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2161
  Value *Val3 = Builder.CreateFCmpOGT(Val0, Val2);
2162
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2163
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2164
}
2165
case ARM::BI__builtin_arm_mve_vcmpleq_n_f16:
2166
case ARM::BI__builtin_arm_mve_vcmpleq_n_f32: {
2167
  llvm::Type * Param0;
2168
  switch (BuiltinID) {
2169
  case ARM::BI__builtin_arm_mve_vcmpleq_n_f16:
2170
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2171
    break;
2172
  case ARM::BI__builtin_arm_mve_vcmpleq_n_f32:
2173
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2174
    break;
2175
  }
2176
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2177
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2178
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2179
  Value *Val3 = Builder.CreateFCmpOLE(Val0, Val2);
2180
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2181
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2182
}
2183
case ARM::BI__builtin_arm_mve_vcmpltq_n_f16:
2184
case ARM::BI__builtin_arm_mve_vcmpltq_n_f32: {
2185
  llvm::Type * Param0;
2186
  switch (BuiltinID) {
2187
  case ARM::BI__builtin_arm_mve_vcmpltq_n_f16:
2188
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2189
    break;
2190
  case ARM::BI__builtin_arm_mve_vcmpltq_n_f32:
2191
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2192
    break;
2193
  }
2194
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2195
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2196
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2197
  Value *Val3 = Builder.CreateFCmpOLT(Val0, Val2);
2198
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2199
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2200
}
2201
case ARM::BI__builtin_arm_mve_vcmpneq_n_f16:
2202
case ARM::BI__builtin_arm_mve_vcmpneq_n_f32: {
2203
  llvm::Type * Param0;
2204
  switch (BuiltinID) {
2205
  case ARM::BI__builtin_arm_mve_vcmpneq_n_f16:
2206
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2207
    break;
2208
  case ARM::BI__builtin_arm_mve_vcmpneq_n_f32:
2209
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2210
    break;
2211
  }
2212
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2213
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2214
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2215
  Value *Val3 = Builder.CreateFCmpUNE(Val0, Val2);
2216
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2217
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2218
}
2219
case ARM::BI__builtin_arm_mve_vcmpeqq_n_s16:
2220
case ARM::BI__builtin_arm_mve_vcmpeqq_n_s32:
2221
case ARM::BI__builtin_arm_mve_vcmpeqq_n_s8:
2222
case ARM::BI__builtin_arm_mve_vcmpeqq_n_u16:
2223
case ARM::BI__builtin_arm_mve_vcmpeqq_n_u32:
2224
case ARM::BI__builtin_arm_mve_vcmpeqq_n_u8: {
2225
  llvm::Type * Param0;
2226
  switch (BuiltinID) {
2227
  case ARM::BI__builtin_arm_mve_vcmpeqq_n_s16:
2228
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2229
    break;
2230
  case ARM::BI__builtin_arm_mve_vcmpeqq_n_s32:
2231
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2232
    break;
2233
  case ARM::BI__builtin_arm_mve_vcmpeqq_n_s8:
2234
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2235
    break;
2236
  case ARM::BI__builtin_arm_mve_vcmpeqq_n_u16:
2237
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2238
    break;
2239
  case ARM::BI__builtin_arm_mve_vcmpeqq_n_u32:
2240
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2241
    break;
2242
  case ARM::BI__builtin_arm_mve_vcmpeqq_n_u8:
2243
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2244
    break;
2245
  }
2246
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2247
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2248
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2249
  Value *Val3 = Builder.CreateICmpEQ(Val0, Val2);
2250
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2251
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2252
}
2253
case ARM::BI__builtin_arm_mve_vcmpneq_n_s16:
2254
case ARM::BI__builtin_arm_mve_vcmpneq_n_s32:
2255
case ARM::BI__builtin_arm_mve_vcmpneq_n_s8:
2256
case ARM::BI__builtin_arm_mve_vcmpneq_n_u16:
2257
case ARM::BI__builtin_arm_mve_vcmpneq_n_u32:
2258
case ARM::BI__builtin_arm_mve_vcmpneq_n_u8: {
2259
  llvm::Type * Param0;
2260
  switch (BuiltinID) {
2261
  case ARM::BI__builtin_arm_mve_vcmpneq_n_s16:
2262
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2263
    break;
2264
  case ARM::BI__builtin_arm_mve_vcmpneq_n_s32:
2265
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2266
    break;
2267
  case ARM::BI__builtin_arm_mve_vcmpneq_n_s8:
2268
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2269
    break;
2270
  case ARM::BI__builtin_arm_mve_vcmpneq_n_u16:
2271
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2272
    break;
2273
  case ARM::BI__builtin_arm_mve_vcmpneq_n_u32:
2274
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2275
    break;
2276
  case ARM::BI__builtin_arm_mve_vcmpneq_n_u8:
2277
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2278
    break;
2279
  }
2280
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2281
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2282
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2283
  Value *Val3 = Builder.CreateICmpNE(Val0, Val2);
2284
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2285
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2286
}
2287
case ARM::BI__builtin_arm_mve_vcmpgeq_n_s16:
2288
case ARM::BI__builtin_arm_mve_vcmpgeq_n_s32:
2289
case ARM::BI__builtin_arm_mve_vcmpgeq_n_s8: {
2290
  llvm::Type * Param0;
2291
  switch (BuiltinID) {
2292
  case ARM::BI__builtin_arm_mve_vcmpgeq_n_s16:
2293
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2294
    break;
2295
  case ARM::BI__builtin_arm_mve_vcmpgeq_n_s32:
2296
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2297
    break;
2298
  case ARM::BI__builtin_arm_mve_vcmpgeq_n_s8:
2299
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2300
    break;
2301
  }
2302
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2303
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2304
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2305
  Value *Val3 = Builder.CreateICmpSGE(Val0, Val2);
2306
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2307
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2308
}
2309
case ARM::BI__builtin_arm_mve_vcmpgtq_n_s16:
2310
case ARM::BI__builtin_arm_mve_vcmpgtq_n_s32:
2311
case ARM::BI__builtin_arm_mve_vcmpgtq_n_s8: {
2312
  llvm::Type * Param0;
2313
  switch (BuiltinID) {
2314
  case ARM::BI__builtin_arm_mve_vcmpgtq_n_s16:
2315
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2316
    break;
2317
  case ARM::BI__builtin_arm_mve_vcmpgtq_n_s32:
2318
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2319
    break;
2320
  case ARM::BI__builtin_arm_mve_vcmpgtq_n_s8:
2321
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2322
    break;
2323
  }
2324
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2325
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2326
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2327
  Value *Val3 = Builder.CreateICmpSGT(Val0, Val2);
2328
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2329
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2330
}
2331
case ARM::BI__builtin_arm_mve_vcmpleq_n_s16:
2332
case ARM::BI__builtin_arm_mve_vcmpleq_n_s32:
2333
case ARM::BI__builtin_arm_mve_vcmpleq_n_s8: {
2334
  llvm::Type * Param0;
2335
  switch (BuiltinID) {
2336
  case ARM::BI__builtin_arm_mve_vcmpleq_n_s16:
2337
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2338
    break;
2339
  case ARM::BI__builtin_arm_mve_vcmpleq_n_s32:
2340
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2341
    break;
2342
  case ARM::BI__builtin_arm_mve_vcmpleq_n_s8:
2343
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2344
    break;
2345
  }
2346
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2347
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2348
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2349
  Value *Val3 = Builder.CreateICmpSLE(Val0, Val2);
2350
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2351
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2352
}
2353
case ARM::BI__builtin_arm_mve_vcmpltq_n_s16:
2354
case ARM::BI__builtin_arm_mve_vcmpltq_n_s32:
2355
case ARM::BI__builtin_arm_mve_vcmpltq_n_s8: {
2356
  llvm::Type * Param0;
2357
  switch (BuiltinID) {
2358
  case ARM::BI__builtin_arm_mve_vcmpltq_n_s16:
2359
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2360
    break;
2361
  case ARM::BI__builtin_arm_mve_vcmpltq_n_s32:
2362
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2363
    break;
2364
  case ARM::BI__builtin_arm_mve_vcmpltq_n_s8:
2365
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2366
    break;
2367
  }
2368
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2369
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2370
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2371
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
2372
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2373
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2374
}
2375
case ARM::BI__builtin_arm_mve_vcmpcsq_n_u16:
2376
case ARM::BI__builtin_arm_mve_vcmpcsq_n_u32:
2377
case ARM::BI__builtin_arm_mve_vcmpcsq_n_u8: {
2378
  llvm::Type * Param0;
2379
  switch (BuiltinID) {
2380
  case ARM::BI__builtin_arm_mve_vcmpcsq_n_u16:
2381
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2382
    break;
2383
  case ARM::BI__builtin_arm_mve_vcmpcsq_n_u32:
2384
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2385
    break;
2386
  case ARM::BI__builtin_arm_mve_vcmpcsq_n_u8:
2387
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2388
    break;
2389
  }
2390
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2391
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2392
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2393
  Value *Val3 = Builder.CreateICmpUGE(Val0, Val2);
2394
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2395
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2396
}
2397
case ARM::BI__builtin_arm_mve_vcmphiq_n_u16:
2398
case ARM::BI__builtin_arm_mve_vcmphiq_n_u32:
2399
case ARM::BI__builtin_arm_mve_vcmphiq_n_u8: {
2400
  llvm::Type * Param0;
2401
  switch (BuiltinID) {
2402
  case ARM::BI__builtin_arm_mve_vcmphiq_n_u16:
2403
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2404
    break;
2405
  case ARM::BI__builtin_arm_mve_vcmphiq_n_u32:
2406
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2407
    break;
2408
  case ARM::BI__builtin_arm_mve_vcmphiq_n_u8:
2409
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2410
    break;
2411
  }
2412
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2413
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2414
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2415
  Value *Val3 = Builder.CreateICmpUGT(Val0, Val2);
2416
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val3});
2417
  return Builder.CreateIntCast(Val4, Int16Ty, false);
2418
}
2419
case ARM::BI__builtin_arm_mve_vqdmullbq_n_s16:
2420
case ARM::BI__builtin_arm_mve_vqdmullbq_n_s32:
2421
case ARM::BI__builtin_arm_mve_vqdmulltq_n_s16:
2422
case ARM::BI__builtin_arm_mve_vqdmulltq_n_s32: {
2423
  uint32_t  Param0;
2424
  llvm::Type * Param1;
2425
  llvm::Type * Param2;
2426
  switch (BuiltinID) {
2427
  case ARM::BI__builtin_arm_mve_vqdmullbq_n_s16:
2428
    Param0 = 0;
2429
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2430
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
2431
    break;
2432
  case ARM::BI__builtin_arm_mve_vqdmullbq_n_s32:
2433
    Param0 = 0;
2434
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
2435
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
2436
    break;
2437
  case ARM::BI__builtin_arm_mve_vqdmulltq_n_s16:
2438
    Param0 = 1;
2439
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2440
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
2441
    break;
2442
  case ARM::BI__builtin_arm_mve_vqdmulltq_n_s32:
2443
    Param0 = 1;
2444
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
2445
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
2446
    break;
2447
  }
2448
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2449
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2450
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2451
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
2452
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vqdmull, {Param1, Param2}), {Val0, Val2, Val3});
2453
}
2454
case ARM::BI__builtin_arm_mve_vhaddq_n_s16:
2455
case ARM::BI__builtin_arm_mve_vhaddq_n_s32:
2456
case ARM::BI__builtin_arm_mve_vhaddq_n_s8:
2457
case ARM::BI__builtin_arm_mve_vhaddq_n_u16:
2458
case ARM::BI__builtin_arm_mve_vhaddq_n_u32:
2459
case ARM::BI__builtin_arm_mve_vhaddq_n_u8:
2460
case ARM::BI__builtin_arm_mve_vhsubq_n_s16:
2461
case ARM::BI__builtin_arm_mve_vhsubq_n_s32:
2462
case ARM::BI__builtin_arm_mve_vhsubq_n_s8:
2463
case ARM::BI__builtin_arm_mve_vhsubq_n_u16:
2464
case ARM::BI__builtin_arm_mve_vhsubq_n_u32:
2465
case ARM::BI__builtin_arm_mve_vhsubq_n_u8: {
2466
  uint32_t  Param0;
2467
  Intrinsic::ID  Param1;
2468
  llvm::Type * Param2;
2469
  switch (BuiltinID) {
2470
  case ARM::BI__builtin_arm_mve_vhaddq_n_s16:
2471
    Param0 = 0;
2472
    Param1 = Intrinsic::arm_mve_vhadd;
2473
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
2474
    break;
2475
  case ARM::BI__builtin_arm_mve_vhaddq_n_s32:
2476
    Param0 = 0;
2477
    Param1 = Intrinsic::arm_mve_vhadd;
2478
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
2479
    break;
2480
  case ARM::BI__builtin_arm_mve_vhaddq_n_s8:
2481
    Param0 = 0;
2482
    Param1 = Intrinsic::arm_mve_vhadd;
2483
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
2484
    break;
2485
  case ARM::BI__builtin_arm_mve_vhaddq_n_u16:
2486
    Param0 = 1;
2487
    Param1 = Intrinsic::arm_mve_vhadd;
2488
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
2489
    break;
2490
  case ARM::BI__builtin_arm_mve_vhaddq_n_u32:
2491
    Param0 = 1;
2492
    Param1 = Intrinsic::arm_mve_vhadd;
2493
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
2494
    break;
2495
  case ARM::BI__builtin_arm_mve_vhaddq_n_u8:
2496
    Param0 = 1;
2497
    Param1 = Intrinsic::arm_mve_vhadd;
2498
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
2499
    break;
2500
  case ARM::BI__builtin_arm_mve_vhsubq_n_s16:
2501
    Param0 = 0;
2502
    Param1 = Intrinsic::arm_mve_vhsub;
2503
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
2504
    break;
2505
  case ARM::BI__builtin_arm_mve_vhsubq_n_s32:
2506
    Param0 = 0;
2507
    Param1 = Intrinsic::arm_mve_vhsub;
2508
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
2509
    break;
2510
  case ARM::BI__builtin_arm_mve_vhsubq_n_s8:
2511
    Param0 = 0;
2512
    Param1 = Intrinsic::arm_mve_vhsub;
2513
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
2514
    break;
2515
  case ARM::BI__builtin_arm_mve_vhsubq_n_u16:
2516
    Param0 = 1;
2517
    Param1 = Intrinsic::arm_mve_vhsub;
2518
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
2519
    break;
2520
  case ARM::BI__builtin_arm_mve_vhsubq_n_u32:
2521
    Param0 = 1;
2522
    Param1 = Intrinsic::arm_mve_vhsub;
2523
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
2524
    break;
2525
  case ARM::BI__builtin_arm_mve_vhsubq_n_u8:
2526
    Param0 = 1;
2527
    Param1 = Intrinsic::arm_mve_vhsub;
2528
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
2529
    break;
2530
  }
2531
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2532
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2533
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2534
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
2535
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2}), {Val0, Val2, Val3});
2536
}
2537
case ARM::BI__builtin_arm_mve_vaddq_n_s16:
2538
case ARM::BI__builtin_arm_mve_vaddq_n_s32:
2539
case ARM::BI__builtin_arm_mve_vaddq_n_s8:
2540
case ARM::BI__builtin_arm_mve_vaddq_n_u16:
2541
case ARM::BI__builtin_arm_mve_vaddq_n_u32:
2542
case ARM::BI__builtin_arm_mve_vaddq_n_u8: {
2543
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2544
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2545
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2546
  return Builder.CreateAdd(Val0, Val2);
2547
}
2548
case ARM::BI__builtin_arm_mve_vqaddq_n_s16:
2549
case ARM::BI__builtin_arm_mve_vqaddq_n_s32:
2550
case ARM::BI__builtin_arm_mve_vqaddq_n_s8:
2551
case ARM::BI__builtin_arm_mve_vqaddq_n_u16:
2552
case ARM::BI__builtin_arm_mve_vqaddq_n_u32:
2553
case ARM::BI__builtin_arm_mve_vqaddq_n_u8:
2554
case ARM::BI__builtin_arm_mve_vqdmulhq_n_s16:
2555
case ARM::BI__builtin_arm_mve_vqdmulhq_n_s32:
2556
case ARM::BI__builtin_arm_mve_vqdmulhq_n_s8:
2557
case ARM::BI__builtin_arm_mve_vqrdmulhq_n_s16:
2558
case ARM::BI__builtin_arm_mve_vqrdmulhq_n_s32:
2559
case ARM::BI__builtin_arm_mve_vqrdmulhq_n_s8:
2560
case ARM::BI__builtin_arm_mve_vqsubq_n_s16:
2561
case ARM::BI__builtin_arm_mve_vqsubq_n_s32:
2562
case ARM::BI__builtin_arm_mve_vqsubq_n_s8:
2563
case ARM::BI__builtin_arm_mve_vqsubq_n_u16:
2564
case ARM::BI__builtin_arm_mve_vqsubq_n_u32:
2565
case ARM::BI__builtin_arm_mve_vqsubq_n_u8: {
2566
  Intrinsic::ID  Param0;
2567
  llvm::Type * Param1;
2568
  switch (BuiltinID) {
2569
  case ARM::BI__builtin_arm_mve_vqaddq_n_s16:
2570
    Param0 = Intrinsic::sadd_sat;
2571
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
2572
    break;
2573
  case ARM::BI__builtin_arm_mve_vqaddq_n_s32:
2574
    Param0 = Intrinsic::sadd_sat;
2575
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2576
    break;
2577
  case ARM::BI__builtin_arm_mve_vqaddq_n_s8:
2578
    Param0 = Intrinsic::sadd_sat;
2579
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
2580
    break;
2581
  case ARM::BI__builtin_arm_mve_vqaddq_n_u16:
2582
    Param0 = Intrinsic::uadd_sat;
2583
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
2584
    break;
2585
  case ARM::BI__builtin_arm_mve_vqaddq_n_u32:
2586
    Param0 = Intrinsic::uadd_sat;
2587
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2588
    break;
2589
  case ARM::BI__builtin_arm_mve_vqaddq_n_u8:
2590
    Param0 = Intrinsic::uadd_sat;
2591
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
2592
    break;
2593
  case ARM::BI__builtin_arm_mve_vqdmulhq_n_s16:
2594
    Param0 = Intrinsic::arm_mve_vqdmulh;
2595
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
2596
    break;
2597
  case ARM::BI__builtin_arm_mve_vqdmulhq_n_s32:
2598
    Param0 = Intrinsic::arm_mve_vqdmulh;
2599
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2600
    break;
2601
  case ARM::BI__builtin_arm_mve_vqdmulhq_n_s8:
2602
    Param0 = Intrinsic::arm_mve_vqdmulh;
2603
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
2604
    break;
2605
  case ARM::BI__builtin_arm_mve_vqrdmulhq_n_s16:
2606
    Param0 = Intrinsic::arm_mve_vqrdmulh;
2607
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
2608
    break;
2609
  case ARM::BI__builtin_arm_mve_vqrdmulhq_n_s32:
2610
    Param0 = Intrinsic::arm_mve_vqrdmulh;
2611
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2612
    break;
2613
  case ARM::BI__builtin_arm_mve_vqrdmulhq_n_s8:
2614
    Param0 = Intrinsic::arm_mve_vqrdmulh;
2615
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
2616
    break;
2617
  case ARM::BI__builtin_arm_mve_vqsubq_n_s16:
2618
    Param0 = Intrinsic::ssub_sat;
2619
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
2620
    break;
2621
  case ARM::BI__builtin_arm_mve_vqsubq_n_s32:
2622
    Param0 = Intrinsic::ssub_sat;
2623
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2624
    break;
2625
  case ARM::BI__builtin_arm_mve_vqsubq_n_s8:
2626
    Param0 = Intrinsic::ssub_sat;
2627
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
2628
    break;
2629
  case ARM::BI__builtin_arm_mve_vqsubq_n_u16:
2630
    Param0 = Intrinsic::usub_sat;
2631
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
2632
    break;
2633
  case ARM::BI__builtin_arm_mve_vqsubq_n_u32:
2634
    Param0 = Intrinsic::usub_sat;
2635
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2636
    break;
2637
  case ARM::BI__builtin_arm_mve_vqsubq_n_u8:
2638
    Param0 = Intrinsic::usub_sat;
2639
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
2640
    break;
2641
  }
2642
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2643
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2644
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2645
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val0, Val2});
2646
}
2647
case ARM::BI__builtin_arm_mve_vaddq_n_f16:
2648
case ARM::BI__builtin_arm_mve_vaddq_n_f32: {
2649
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2650
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2651
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2652
  return Builder.CreateFAdd(Val0, Val2);
2653
}
2654
case ARM::BI__builtin_arm_mve_vmulq_n_f16:
2655
case ARM::BI__builtin_arm_mve_vmulq_n_f32: {
2656
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2657
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2658
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2659
  return Builder.CreateFMul(Val0, Val2);
2660
}
2661
case ARM::BI__builtin_arm_mve_vsubq_n_f16:
2662
case ARM::BI__builtin_arm_mve_vsubq_n_f32: {
2663
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2664
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2665
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2666
  return Builder.CreateFSub(Val0, Val2);
2667
}
2668
case ARM::BI__builtin_arm_mve_vmulq_n_s16:
2669
case ARM::BI__builtin_arm_mve_vmulq_n_s32:
2670
case ARM::BI__builtin_arm_mve_vmulq_n_s8:
2671
case ARM::BI__builtin_arm_mve_vmulq_n_u16:
2672
case ARM::BI__builtin_arm_mve_vmulq_n_u32:
2673
case ARM::BI__builtin_arm_mve_vmulq_n_u8: {
2674
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2675
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2676
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2677
  return Builder.CreateMul(Val0, Val2);
2678
}
2679
case ARM::BI__builtin_arm_mve_vsubq_n_s16:
2680
case ARM::BI__builtin_arm_mve_vsubq_n_s32:
2681
case ARM::BI__builtin_arm_mve_vsubq_n_s8:
2682
case ARM::BI__builtin_arm_mve_vsubq_n_u16:
2683
case ARM::BI__builtin_arm_mve_vsubq_n_u32:
2684
case ARM::BI__builtin_arm_mve_vsubq_n_u8: {
2685
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2686
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2687
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
2688
  return Builder.CreateSub(Val0, Val2);
2689
}
2690
case ARM::BI__builtin_arm_mve_vmaxnmavq_f16:
2691
case ARM::BI__builtin_arm_mve_vmaxnmavq_f32:
2692
case ARM::BI__builtin_arm_mve_vmaxnmvq_f16:
2693
case ARM::BI__builtin_arm_mve_vmaxnmvq_f32:
2694
case ARM::BI__builtin_arm_mve_vminnmavq_f16:
2695
case ARM::BI__builtin_arm_mve_vminnmavq_f32:
2696
case ARM::BI__builtin_arm_mve_vminnmvq_f16:
2697
case ARM::BI__builtin_arm_mve_vminnmvq_f32: {
2698
  Intrinsic::ID  Param0;
2699
  llvm::Type * Param1;
2700
  llvm::Type * Param2;
2701
  switch (BuiltinID) {
2702
  case ARM::BI__builtin_arm_mve_vmaxnmavq_f16:
2703
    Param0 = Intrinsic::arm_mve_maxnmav;
2704
    Param1 = HalfTy;
2705
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
2706
    break;
2707
  case ARM::BI__builtin_arm_mve_vmaxnmavq_f32:
2708
    Param0 = Intrinsic::arm_mve_maxnmav;
2709
    Param1 = FloatTy;
2710
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
2711
    break;
2712
  case ARM::BI__builtin_arm_mve_vmaxnmvq_f16:
2713
    Param0 = Intrinsic::arm_mve_maxnmv;
2714
    Param1 = HalfTy;
2715
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
2716
    break;
2717
  case ARM::BI__builtin_arm_mve_vmaxnmvq_f32:
2718
    Param0 = Intrinsic::arm_mve_maxnmv;
2719
    Param1 = FloatTy;
2720
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
2721
    break;
2722
  case ARM::BI__builtin_arm_mve_vminnmavq_f16:
2723
    Param0 = Intrinsic::arm_mve_minnmav;
2724
    Param1 = HalfTy;
2725
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
2726
    break;
2727
  case ARM::BI__builtin_arm_mve_vminnmavq_f32:
2728
    Param0 = Intrinsic::arm_mve_minnmav;
2729
    Param1 = FloatTy;
2730
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
2731
    break;
2732
  case ARM::BI__builtin_arm_mve_vminnmvq_f16:
2733
    Param0 = Intrinsic::arm_mve_minnmv;
2734
    Param1 = HalfTy;
2735
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
2736
    break;
2737
  case ARM::BI__builtin_arm_mve_vminnmvq_f32:
2738
    Param0 = Intrinsic::arm_mve_minnmv;
2739
    Param1 = FloatTy;
2740
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
2741
    break;
2742
  }
2743
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2744
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2745
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1, Param2}), {Val0, Val1});
2746
  return (Val2);
2747
}
2748
case ARM::BI__builtin_arm_mve_vddupq_n_u16:
2749
case ARM::BI__builtin_arm_mve_vddupq_n_u32:
2750
case ARM::BI__builtin_arm_mve_vddupq_n_u8:
2751
case ARM::BI__builtin_arm_mve_vidupq_n_u16:
2752
case ARM::BI__builtin_arm_mve_vidupq_n_u32:
2753
case ARM::BI__builtin_arm_mve_vidupq_n_u8: {
2754
  Intrinsic::ID  Param0;
2755
  llvm::Type * Param1;
2756
  switch (BuiltinID) {
2757
  case ARM::BI__builtin_arm_mve_vddupq_n_u16:
2758
    Param0 = Intrinsic::arm_mve_vddup;
2759
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
2760
    break;
2761
  case ARM::BI__builtin_arm_mve_vddupq_n_u32:
2762
    Param0 = Intrinsic::arm_mve_vddup;
2763
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2764
    break;
2765
  case ARM::BI__builtin_arm_mve_vddupq_n_u8:
2766
    Param0 = Intrinsic::arm_mve_vddup;
2767
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
2768
    break;
2769
  case ARM::BI__builtin_arm_mve_vidupq_n_u16:
2770
    Param0 = Intrinsic::arm_mve_vidup;
2771
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
2772
    break;
2773
  case ARM::BI__builtin_arm_mve_vidupq_n_u32:
2774
    Param0 = Intrinsic::arm_mve_vidup;
2775
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
2776
    break;
2777
  case ARM::BI__builtin_arm_mve_vidupq_n_u8:
2778
    Param0 = Intrinsic::arm_mve_vidup;
2779
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
2780
    break;
2781
  }
2782
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2783
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2784
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val0, Val1});
2785
  return Builder.CreateExtractValue(Val2, static_cast<unsigned>(0));
2786
}
2787
case ARM::BI__builtin_arm_mve_vmaxavq_s32:
2788
case ARM::BI__builtin_arm_mve_vminavq_s32: {
2789
  Intrinsic::ID  Param0;
2790
  switch (BuiltinID) {
2791
  case ARM::BI__builtin_arm_mve_vmaxavq_s32:
2792
    Param0 = Intrinsic::arm_mve_maxav;
2793
    break;
2794
  case ARM::BI__builtin_arm_mve_vminavq_s32:
2795
    Param0 = Intrinsic::arm_mve_minav;
2796
    break;
2797
  }
2798
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2799
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2800
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4)}), {Val0, Val1});
2801
  return Builder.CreateIntCast(Val2, Int32Ty, false);
2802
}
2803
case ARM::BI__builtin_arm_mve_vcmpeqq_f16:
2804
case ARM::BI__builtin_arm_mve_vcmpeqq_f32: {
2805
  llvm::Type * Param0;
2806
  switch (BuiltinID) {
2807
  case ARM::BI__builtin_arm_mve_vcmpeqq_f16:
2808
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2809
    break;
2810
  case ARM::BI__builtin_arm_mve_vcmpeqq_f32:
2811
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2812
    break;
2813
  }
2814
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2815
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2816
  Value *Val2 = Builder.CreateFCmpOEQ(Val0, Val1);
2817
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2818
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2819
}
2820
case ARM::BI__builtin_arm_mve_vcmpgeq_f16:
2821
case ARM::BI__builtin_arm_mve_vcmpgeq_f32: {
2822
  llvm::Type * Param0;
2823
  switch (BuiltinID) {
2824
  case ARM::BI__builtin_arm_mve_vcmpgeq_f16:
2825
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2826
    break;
2827
  case ARM::BI__builtin_arm_mve_vcmpgeq_f32:
2828
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2829
    break;
2830
  }
2831
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2832
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2833
  Value *Val2 = Builder.CreateFCmpOGE(Val0, Val1);
2834
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2835
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2836
}
2837
case ARM::BI__builtin_arm_mve_vcmpgtq_f16:
2838
case ARM::BI__builtin_arm_mve_vcmpgtq_f32: {
2839
  llvm::Type * Param0;
2840
  switch (BuiltinID) {
2841
  case ARM::BI__builtin_arm_mve_vcmpgtq_f16:
2842
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2843
    break;
2844
  case ARM::BI__builtin_arm_mve_vcmpgtq_f32:
2845
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2846
    break;
2847
  }
2848
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2849
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2850
  Value *Val2 = Builder.CreateFCmpOGT(Val0, Val1);
2851
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2852
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2853
}
2854
case ARM::BI__builtin_arm_mve_vcmpleq_f16:
2855
case ARM::BI__builtin_arm_mve_vcmpleq_f32: {
2856
  llvm::Type * Param0;
2857
  switch (BuiltinID) {
2858
  case ARM::BI__builtin_arm_mve_vcmpleq_f16:
2859
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2860
    break;
2861
  case ARM::BI__builtin_arm_mve_vcmpleq_f32:
2862
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2863
    break;
2864
  }
2865
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2866
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2867
  Value *Val2 = Builder.CreateFCmpOLE(Val0, Val1);
2868
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2869
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2870
}
2871
case ARM::BI__builtin_arm_mve_vcmpltq_f16:
2872
case ARM::BI__builtin_arm_mve_vcmpltq_f32: {
2873
  llvm::Type * Param0;
2874
  switch (BuiltinID) {
2875
  case ARM::BI__builtin_arm_mve_vcmpltq_f16:
2876
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2877
    break;
2878
  case ARM::BI__builtin_arm_mve_vcmpltq_f32:
2879
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2880
    break;
2881
  }
2882
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2883
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2884
  Value *Val2 = Builder.CreateFCmpOLT(Val0, Val1);
2885
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2886
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2887
}
2888
case ARM::BI__builtin_arm_mve_vcmpneq_f16:
2889
case ARM::BI__builtin_arm_mve_vcmpneq_f32: {
2890
  llvm::Type * Param0;
2891
  switch (BuiltinID) {
2892
  case ARM::BI__builtin_arm_mve_vcmpneq_f16:
2893
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2894
    break;
2895
  case ARM::BI__builtin_arm_mve_vcmpneq_f32:
2896
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2897
    break;
2898
  }
2899
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2900
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2901
  Value *Val2 = Builder.CreateFCmpUNE(Val0, Val1);
2902
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2903
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2904
}
2905
case ARM::BI__builtin_arm_mve_vcmpeqq_s16:
2906
case ARM::BI__builtin_arm_mve_vcmpeqq_s32:
2907
case ARM::BI__builtin_arm_mve_vcmpeqq_s8:
2908
case ARM::BI__builtin_arm_mve_vcmpeqq_u16:
2909
case ARM::BI__builtin_arm_mve_vcmpeqq_u32:
2910
case ARM::BI__builtin_arm_mve_vcmpeqq_u8: {
2911
  llvm::Type * Param0;
2912
  switch (BuiltinID) {
2913
  case ARM::BI__builtin_arm_mve_vcmpeqq_s16:
2914
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2915
    break;
2916
  case ARM::BI__builtin_arm_mve_vcmpeqq_s32:
2917
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2918
    break;
2919
  case ARM::BI__builtin_arm_mve_vcmpeqq_s8:
2920
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2921
    break;
2922
  case ARM::BI__builtin_arm_mve_vcmpeqq_u16:
2923
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2924
    break;
2925
  case ARM::BI__builtin_arm_mve_vcmpeqq_u32:
2926
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2927
    break;
2928
  case ARM::BI__builtin_arm_mve_vcmpeqq_u8:
2929
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2930
    break;
2931
  }
2932
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2933
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2934
  Value *Val2 = Builder.CreateICmpEQ(Val0, Val1);
2935
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2936
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2937
}
2938
case ARM::BI__builtin_arm_mve_vcmpneq_s16:
2939
case ARM::BI__builtin_arm_mve_vcmpneq_s32:
2940
case ARM::BI__builtin_arm_mve_vcmpneq_s8:
2941
case ARM::BI__builtin_arm_mve_vcmpneq_u16:
2942
case ARM::BI__builtin_arm_mve_vcmpneq_u32:
2943
case ARM::BI__builtin_arm_mve_vcmpneq_u8: {
2944
  llvm::Type * Param0;
2945
  switch (BuiltinID) {
2946
  case ARM::BI__builtin_arm_mve_vcmpneq_s16:
2947
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2948
    break;
2949
  case ARM::BI__builtin_arm_mve_vcmpneq_s32:
2950
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2951
    break;
2952
  case ARM::BI__builtin_arm_mve_vcmpneq_s8:
2953
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2954
    break;
2955
  case ARM::BI__builtin_arm_mve_vcmpneq_u16:
2956
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2957
    break;
2958
  case ARM::BI__builtin_arm_mve_vcmpneq_u32:
2959
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2960
    break;
2961
  case ARM::BI__builtin_arm_mve_vcmpneq_u8:
2962
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2963
    break;
2964
  }
2965
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2966
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2967
  Value *Val2 = Builder.CreateICmpNE(Val0, Val1);
2968
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2969
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2970
}
2971
case ARM::BI__builtin_arm_mve_vcmpgeq_s16:
2972
case ARM::BI__builtin_arm_mve_vcmpgeq_s32:
2973
case ARM::BI__builtin_arm_mve_vcmpgeq_s8: {
2974
  llvm::Type * Param0;
2975
  switch (BuiltinID) {
2976
  case ARM::BI__builtin_arm_mve_vcmpgeq_s16:
2977
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
2978
    break;
2979
  case ARM::BI__builtin_arm_mve_vcmpgeq_s32:
2980
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
2981
    break;
2982
  case ARM::BI__builtin_arm_mve_vcmpgeq_s8:
2983
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
2984
    break;
2985
  }
2986
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2987
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2988
  Value *Val2 = Builder.CreateICmpSGE(Val0, Val1);
2989
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
2990
  return Builder.CreateIntCast(Val3, Int16Ty, false);
2991
}
2992
case ARM::BI__builtin_arm_mve_vmaxq_s16:
2993
case ARM::BI__builtin_arm_mve_vmaxq_s32:
2994
case ARM::BI__builtin_arm_mve_vmaxq_s8: {
2995
  Value *Val0 = EmitScalarExpr(E->getArg(0));
2996
  Value *Val1 = EmitScalarExpr(E->getArg(1));
2997
  Value *Val2 = Builder.CreateICmpSGE(Val0, Val1);
2998
  return Builder.CreateSelect(Val2, Val0, Val1);
2999
}
3000
case ARM::BI__builtin_arm_mve_vcmpgtq_s16:
3001
case ARM::BI__builtin_arm_mve_vcmpgtq_s32:
3002
case ARM::BI__builtin_arm_mve_vcmpgtq_s8: {
3003
  llvm::Type * Param0;
3004
  switch (BuiltinID) {
3005
  case ARM::BI__builtin_arm_mve_vcmpgtq_s16:
3006
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3007
    break;
3008
  case ARM::BI__builtin_arm_mve_vcmpgtq_s32:
3009
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3010
    break;
3011
  case ARM::BI__builtin_arm_mve_vcmpgtq_s8:
3012
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3013
    break;
3014
  }
3015
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3016
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3017
  Value *Val2 = Builder.CreateICmpSGT(Val0, Val1);
3018
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
3019
  return Builder.CreateIntCast(Val3, Int16Ty, false);
3020
}
3021
case ARM::BI__builtin_arm_mve_vcmpleq_s16:
3022
case ARM::BI__builtin_arm_mve_vcmpleq_s32:
3023
case ARM::BI__builtin_arm_mve_vcmpleq_s8: {
3024
  llvm::Type * Param0;
3025
  switch (BuiltinID) {
3026
  case ARM::BI__builtin_arm_mve_vcmpleq_s16:
3027
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3028
    break;
3029
  case ARM::BI__builtin_arm_mve_vcmpleq_s32:
3030
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3031
    break;
3032
  case ARM::BI__builtin_arm_mve_vcmpleq_s8:
3033
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3034
    break;
3035
  }
3036
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3037
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3038
  Value *Val2 = Builder.CreateICmpSLE(Val0, Val1);
3039
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
3040
  return Builder.CreateIntCast(Val3, Int16Ty, false);
3041
}
3042
case ARM::BI__builtin_arm_mve_vminq_s16:
3043
case ARM::BI__builtin_arm_mve_vminq_s32:
3044
case ARM::BI__builtin_arm_mve_vminq_s8: {
3045
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3046
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3047
  Value *Val2 = Builder.CreateICmpSLE(Val0, Val1);
3048
  return Builder.CreateSelect(Val2, Val0, Val1);
3049
}
3050
case ARM::BI__builtin_arm_mve_vcmpltq_s16:
3051
case ARM::BI__builtin_arm_mve_vcmpltq_s32:
3052
case ARM::BI__builtin_arm_mve_vcmpltq_s8: {
3053
  llvm::Type * Param0;
3054
  switch (BuiltinID) {
3055
  case ARM::BI__builtin_arm_mve_vcmpltq_s16:
3056
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3057
    break;
3058
  case ARM::BI__builtin_arm_mve_vcmpltq_s32:
3059
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3060
    break;
3061
  case ARM::BI__builtin_arm_mve_vcmpltq_s8:
3062
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3063
    break;
3064
  }
3065
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3066
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3067
  Value *Val2 = Builder.CreateICmpSLT(Val0, Val1);
3068
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
3069
  return Builder.CreateIntCast(Val3, Int16Ty, false);
3070
}
3071
case ARM::BI__builtin_arm_mve_vcmpcsq_u16:
3072
case ARM::BI__builtin_arm_mve_vcmpcsq_u32:
3073
case ARM::BI__builtin_arm_mve_vcmpcsq_u8: {
3074
  llvm::Type * Param0;
3075
  switch (BuiltinID) {
3076
  case ARM::BI__builtin_arm_mve_vcmpcsq_u16:
3077
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3078
    break;
3079
  case ARM::BI__builtin_arm_mve_vcmpcsq_u32:
3080
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3081
    break;
3082
  case ARM::BI__builtin_arm_mve_vcmpcsq_u8:
3083
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3084
    break;
3085
  }
3086
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3087
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3088
  Value *Val2 = Builder.CreateICmpUGE(Val0, Val1);
3089
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
3090
  return Builder.CreateIntCast(Val3, Int16Ty, false);
3091
}
3092
case ARM::BI__builtin_arm_mve_vmaxq_u16:
3093
case ARM::BI__builtin_arm_mve_vmaxq_u32:
3094
case ARM::BI__builtin_arm_mve_vmaxq_u8: {
3095
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3096
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3097
  Value *Val2 = Builder.CreateICmpUGE(Val0, Val1);
3098
  return Builder.CreateSelect(Val2, Val0, Val1);
3099
}
3100
case ARM::BI__builtin_arm_mve_vcmphiq_u16:
3101
case ARM::BI__builtin_arm_mve_vcmphiq_u32:
3102
case ARM::BI__builtin_arm_mve_vcmphiq_u8: {
3103
  llvm::Type * Param0;
3104
  switch (BuiltinID) {
3105
  case ARM::BI__builtin_arm_mve_vcmphiq_u16:
3106
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3107
    break;
3108
  case ARM::BI__builtin_arm_mve_vcmphiq_u32:
3109
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3110
    break;
3111
  case ARM::BI__builtin_arm_mve_vcmphiq_u8:
3112
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3113
    break;
3114
  }
3115
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3116
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3117
  Value *Val2 = Builder.CreateICmpUGT(Val0, Val1);
3118
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val2});
3119
  return Builder.CreateIntCast(Val3, Int16Ty, false);
3120
}
3121
case ARM::BI__builtin_arm_mve_vminq_u16:
3122
case ARM::BI__builtin_arm_mve_vminq_u32:
3123
case ARM::BI__builtin_arm_mve_vminq_u8: {
3124
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3125
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3126
  Value *Val2 = Builder.CreateICmpULE(Val0, Val1);
3127
  return Builder.CreateSelect(Val2, Val0, Val1);
3128
}
3129
case ARM::BI__builtin_arm_mve_vbicq_n_s32:
3130
case ARM::BI__builtin_arm_mve_vbicq_n_u32: {
3131
  bool  Param0;
3132
  switch (BuiltinID) {
3133
  case ARM::BI__builtin_arm_mve_vbicq_n_s32:
3134
    Param0 = true;
3135
    break;
3136
  case ARM::BI__builtin_arm_mve_vbicq_n_u32:
3137
    Param0 = false;
3138
    break;
3139
  }
3140
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3141
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3142
  Value *Val2 = Builder.CreateIntCast(Val1, Int32Ty, Param0);
3143
  Value *Val3 = ARMMVEVectorSplat(Builder, Val2);
3144
  Value *Val4 = Builder.CreateNot(Val3);
3145
  return Builder.CreateAnd(Val0, Val4);
3146
}
3147
case ARM::BI__builtin_arm_mve_vorrq_n_s32:
3148
case ARM::BI__builtin_arm_mve_vorrq_n_u32: {
3149
  bool  Param0;
3150
  switch (BuiltinID) {
3151
  case ARM::BI__builtin_arm_mve_vorrq_n_s32:
3152
    Param0 = true;
3153
    break;
3154
  case ARM::BI__builtin_arm_mve_vorrq_n_u32:
3155
    Param0 = false;
3156
    break;
3157
  }
3158
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3159
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3160
  Value *Val2 = Builder.CreateIntCast(Val1, Int32Ty, Param0);
3161
  Value *Val3 = ARMMVEVectorSplat(Builder, Val2);
3162
  return Builder.CreateOr(Val0, Val3);
3163
}
3164
case ARM::BI__builtin_arm_mve_vbicq_n_s16:
3165
case ARM::BI__builtin_arm_mve_vbicq_n_u16: {
3166
  bool  Param0;
3167
  switch (BuiltinID) {
3168
  case ARM::BI__builtin_arm_mve_vbicq_n_s16:
3169
    Param0 = true;
3170
    break;
3171
  case ARM::BI__builtin_arm_mve_vbicq_n_u16:
3172
    Param0 = false;
3173
    break;
3174
  }
3175
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3176
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3177
  Value *Val2 = Builder.CreateIntCast(Val1, Int32Ty, false);
3178
  Value *Val3 = Builder.CreateIntCast(Val2, Int16Ty, Param0);
3179
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
3180
  Value *Val5 = Builder.CreateNot(Val4);
3181
  return Builder.CreateAnd(Val0, Val5);
3182
}
3183
case ARM::BI__builtin_arm_mve_vorrq_n_s16:
3184
case ARM::BI__builtin_arm_mve_vorrq_n_u16: {
3185
  bool  Param0;
3186
  switch (BuiltinID) {
3187
  case ARM::BI__builtin_arm_mve_vorrq_n_s16:
3188
    Param0 = true;
3189
    break;
3190
  case ARM::BI__builtin_arm_mve_vorrq_n_u16:
3191
    Param0 = false;
3192
    break;
3193
  }
3194
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3195
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3196
  Value *Val2 = Builder.CreateIntCast(Val1, Int32Ty, false);
3197
  Value *Val3 = Builder.CreateIntCast(Val2, Int16Ty, Param0);
3198
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
3199
  return Builder.CreateOr(Val0, Val4);
3200
}
3201
case ARM::BI__builtin_arm_mve_vshlq_n_s16:
3202
case ARM::BI__builtin_arm_mve_vshlq_n_s32:
3203
case ARM::BI__builtin_arm_mve_vshlq_n_s8:
3204
case ARM::BI__builtin_arm_mve_vshlq_n_u16:
3205
case ARM::BI__builtin_arm_mve_vshlq_n_u32:
3206
case ARM::BI__builtin_arm_mve_vshlq_n_u8: {
3207
  llvm::Type * Param0;
3208
  bool  Param1;
3209
  switch (BuiltinID) {
3210
  case ARM::BI__builtin_arm_mve_vshlq_n_s16:
3211
    Param0 = Int16Ty;
3212
    Param1 = true;
3213
    break;
3214
  case ARM::BI__builtin_arm_mve_vshlq_n_s32:
3215
    Param0 = Int32Ty;
3216
    Param1 = true;
3217
    break;
3218
  case ARM::BI__builtin_arm_mve_vshlq_n_s8:
3219
    Param0 = Int8Ty;
3220
    Param1 = true;
3221
    break;
3222
  case ARM::BI__builtin_arm_mve_vshlq_n_u16:
3223
    Param0 = Int16Ty;
3224
    Param1 = false;
3225
    break;
3226
  case ARM::BI__builtin_arm_mve_vshlq_n_u32:
3227
    Param0 = Int32Ty;
3228
    Param1 = false;
3229
    break;
3230
  case ARM::BI__builtin_arm_mve_vshlq_n_u8:
3231
    Param0 = Int8Ty;
3232
    Param1 = false;
3233
    break;
3234
  }
3235
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3236
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3237
  Value *Val2 = Builder.CreateIntCast(Val1, Param0, Param1);
3238
  Value *Val3 = ARMMVEVectorSplat(Builder, Val2);
3239
  return Builder.CreateShl(Val0, Val3);
3240
}
3241
case ARM::BI__builtin_arm_mve_vmlasq_n_s16:
3242
case ARM::BI__builtin_arm_mve_vmlasq_n_s32:
3243
case ARM::BI__builtin_arm_mve_vmlasq_n_s8:
3244
case ARM::BI__builtin_arm_mve_vmlasq_n_u16:
3245
case ARM::BI__builtin_arm_mve_vmlasq_n_u32:
3246
case ARM::BI__builtin_arm_mve_vmlasq_n_u8: {
3247
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3248
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3249
  Value *Val2 = Builder.CreateMul(Val0, Val1);
3250
  Value *Val3 = EmitScalarExpr(E->getArg(2));
3251
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
3252
  return Builder.CreateAdd(Val2, Val4);
3253
}
3254
case ARM::BI__builtin_arm_mve_vbicq_s16:
3255
case ARM::BI__builtin_arm_mve_vbicq_s32:
3256
case ARM::BI__builtin_arm_mve_vbicq_s8:
3257
case ARM::BI__builtin_arm_mve_vbicq_u16:
3258
case ARM::BI__builtin_arm_mve_vbicq_u32:
3259
case ARM::BI__builtin_arm_mve_vbicq_u8: {
3260
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3261
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3262
  Value *Val2 = Builder.CreateNot(Val1);
3263
  return Builder.CreateAnd(Val0, Val2);
3264
}
3265
case ARM::BI__builtin_arm_mve_vornq_s16:
3266
case ARM::BI__builtin_arm_mve_vornq_s32:
3267
case ARM::BI__builtin_arm_mve_vornq_s8:
3268
case ARM::BI__builtin_arm_mve_vornq_u16:
3269
case ARM::BI__builtin_arm_mve_vornq_u32:
3270
case ARM::BI__builtin_arm_mve_vornq_u8: {
3271
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3272
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3273
  Value *Val2 = Builder.CreateNot(Val1);
3274
  return Builder.CreateOr(Val0, Val2);
3275
}
3276
case ARM::BI__builtin_arm_mve_vadcq_m_s32:
3277
case ARM::BI__builtin_arm_mve_vadcq_m_u32:
3278
case ARM::BI__builtin_arm_mve_vsbcq_m_s32:
3279
case ARM::BI__builtin_arm_mve_vsbcq_m_u32: {
3280
  Intrinsic::ID  Param0;
3281
  switch (BuiltinID) {
3282
  case ARM::BI__builtin_arm_mve_vadcq_m_s32:
3283
    Param0 = Intrinsic::arm_mve_vadc_predicated;
3284
    break;
3285
  case ARM::BI__builtin_arm_mve_vadcq_m_u32:
3286
    Param0 = Intrinsic::arm_mve_vadc_predicated;
3287
    break;
3288
  case ARM::BI__builtin_arm_mve_vsbcq_m_s32:
3289
    Param0 = Intrinsic::arm_mve_vsbc_predicated;
3290
    break;
3291
  case ARM::BI__builtin_arm_mve_vsbcq_m_u32:
3292
    Param0 = Intrinsic::arm_mve_vsbc_predicated;
3293
    break;
3294
  }
3295
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3296
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3297
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3298
  Address Val3 = EmitPointerWithAlignment(E->getArg(3));
3299
  Value *Val4 = Builder.CreateLoad(Val3);
3300
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, 29);
3301
  Value *Val6 = Builder.CreateShl(Val4, Val5);
3302
  Value *Val7 = EmitScalarExpr(E->getArg(4));
3303
  Value *Val8 = Builder.CreateIntCast(Val7, Int32Ty, false);
3304
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val8});
3305
  Value *Val10 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val0, Val1, Val2, Val6, Val9});
3306
  Value *Val11 = llvm::ConstantInt::get(Int32Ty, 1);
3307
  Value *Val12 = Builder.CreateExtractValue(Val10, static_cast<unsigned>(1));
3308
  Value *Val13 = llvm::ConstantInt::get(Int32Ty, 29);
3309
  Value *Val14 = Builder.CreateLShr(Val12, Val13);
3310
  Value *Val15 = Builder.CreateAnd(Val11, Val14);
3311
  Builder.CreateStore(Val15, Val3);
3312
  return Builder.CreateExtractValue(Val10, static_cast<unsigned>(0));
3313
}
3314
case ARM::BI__builtin_arm_mve_vdwdupq_n_u16:
3315
case ARM::BI__builtin_arm_mve_vdwdupq_n_u32:
3316
case ARM::BI__builtin_arm_mve_vdwdupq_n_u8:
3317
case ARM::BI__builtin_arm_mve_viwdupq_n_u16:
3318
case ARM::BI__builtin_arm_mve_viwdupq_n_u32:
3319
case ARM::BI__builtin_arm_mve_viwdupq_n_u8: {
3320
  Intrinsic::ID  Param0;
3321
  llvm::Type * Param1;
3322
  switch (BuiltinID) {
3323
  case ARM::BI__builtin_arm_mve_vdwdupq_n_u16:
3324
    Param0 = Intrinsic::arm_mve_vdwdup;
3325
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
3326
    break;
3327
  case ARM::BI__builtin_arm_mve_vdwdupq_n_u32:
3328
    Param0 = Intrinsic::arm_mve_vdwdup;
3329
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
3330
    break;
3331
  case ARM::BI__builtin_arm_mve_vdwdupq_n_u8:
3332
    Param0 = Intrinsic::arm_mve_vdwdup;
3333
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
3334
    break;
3335
  case ARM::BI__builtin_arm_mve_viwdupq_n_u16:
3336
    Param0 = Intrinsic::arm_mve_viwdup;
3337
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
3338
    break;
3339
  case ARM::BI__builtin_arm_mve_viwdupq_n_u32:
3340
    Param0 = Intrinsic::arm_mve_viwdup;
3341
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
3342
    break;
3343
  case ARM::BI__builtin_arm_mve_viwdupq_n_u8:
3344
    Param0 = Intrinsic::arm_mve_viwdup;
3345
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
3346
    break;
3347
  }
3348
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3349
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3350
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3351
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val0, Val1, Val2});
3352
  return Builder.CreateExtractValue(Val3, static_cast<unsigned>(0));
3353
}
3354
case ARM::BI__builtin_arm_mve_vmaxnmavq_p_f16:
3355
case ARM::BI__builtin_arm_mve_vmaxnmavq_p_f32:
3356
case ARM::BI__builtin_arm_mve_vmaxnmvq_p_f16:
3357
case ARM::BI__builtin_arm_mve_vmaxnmvq_p_f32:
3358
case ARM::BI__builtin_arm_mve_vminnmavq_p_f16:
3359
case ARM::BI__builtin_arm_mve_vminnmavq_p_f32:
3360
case ARM::BI__builtin_arm_mve_vminnmvq_p_f16:
3361
case ARM::BI__builtin_arm_mve_vminnmvq_p_f32: {
3362
  llvm::Type * Param0;
3363
  Intrinsic::ID  Param1;
3364
  llvm::Type * Param2;
3365
  llvm::Type * Param3;
3366
  switch (BuiltinID) {
3367
  case ARM::BI__builtin_arm_mve_vmaxnmavq_p_f16:
3368
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3369
    Param1 = Intrinsic::arm_mve_maxnmav_predicated;
3370
    Param2 = HalfTy;
3371
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
3372
    break;
3373
  case ARM::BI__builtin_arm_mve_vmaxnmavq_p_f32:
3374
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3375
    Param1 = Intrinsic::arm_mve_maxnmav_predicated;
3376
    Param2 = FloatTy;
3377
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
3378
    break;
3379
  case ARM::BI__builtin_arm_mve_vmaxnmvq_p_f16:
3380
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3381
    Param1 = Intrinsic::arm_mve_maxnmv_predicated;
3382
    Param2 = HalfTy;
3383
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
3384
    break;
3385
  case ARM::BI__builtin_arm_mve_vmaxnmvq_p_f32:
3386
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3387
    Param1 = Intrinsic::arm_mve_maxnmv_predicated;
3388
    Param2 = FloatTy;
3389
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
3390
    break;
3391
  case ARM::BI__builtin_arm_mve_vminnmavq_p_f16:
3392
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3393
    Param1 = Intrinsic::arm_mve_minnmav_predicated;
3394
    Param2 = HalfTy;
3395
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
3396
    break;
3397
  case ARM::BI__builtin_arm_mve_vminnmavq_p_f32:
3398
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3399
    Param1 = Intrinsic::arm_mve_minnmav_predicated;
3400
    Param2 = FloatTy;
3401
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
3402
    break;
3403
  case ARM::BI__builtin_arm_mve_vminnmvq_p_f16:
3404
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3405
    Param1 = Intrinsic::arm_mve_minnmv_predicated;
3406
    Param2 = HalfTy;
3407
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
3408
    break;
3409
  case ARM::BI__builtin_arm_mve_vminnmvq_p_f32:
3410
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3411
    Param1 = Intrinsic::arm_mve_minnmv_predicated;
3412
    Param2 = FloatTy;
3413
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
3414
    break;
3415
  }
3416
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3417
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3418
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3419
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
3420
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val3});
3421
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param3, Param0}), {Val0, Val1, Val4});
3422
  return (Val5);
3423
}
3424
case ARM::BI__builtin_arm_mve_vldrdq_gather_base_z_s64:
3425
case ARM::BI__builtin_arm_mve_vldrdq_gather_base_z_u64:
3426
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_z_f32:
3427
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_z_s32:
3428
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_z_u32: {
3429
  llvm::Type * Param0;
3430
  llvm::Type * Param1;
3431
  llvm::Type * Param2;
3432
  switch (BuiltinID) {
3433
  case ARM::BI__builtin_arm_mve_vldrdq_gather_base_z_s64:
3434
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
3435
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
3436
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
3437
    break;
3438
  case ARM::BI__builtin_arm_mve_vldrdq_gather_base_z_u64:
3439
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
3440
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
3441
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
3442
    break;
3443
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_z_f32:
3444
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3445
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
3446
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3447
    break;
3448
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_z_s32:
3449
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3450
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
3451
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3452
    break;
3453
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_z_u32:
3454
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3455
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
3456
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3457
    break;
3458
  }
3459
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3460
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3461
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3462
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
3463
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val3});
3464
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vldr_gather_base_predicated, {Param1, Param2, Param0}), {Val0, Val1, Val4});
3465
}
3466
case ARM::BI__builtin_arm_mve_vmaxaq_m_s16:
3467
case ARM::BI__builtin_arm_mve_vmaxaq_m_s32:
3468
case ARM::BI__builtin_arm_mve_vmaxaq_m_s8:
3469
case ARM::BI__builtin_arm_mve_vmaxnmaq_m_f16:
3470
case ARM::BI__builtin_arm_mve_vmaxnmaq_m_f32:
3471
case ARM::BI__builtin_arm_mve_vminaq_m_s16:
3472
case ARM::BI__builtin_arm_mve_vminaq_m_s32:
3473
case ARM::BI__builtin_arm_mve_vminaq_m_s8:
3474
case ARM::BI__builtin_arm_mve_vminnmaq_m_f16:
3475
case ARM::BI__builtin_arm_mve_vminnmaq_m_f32: {
3476
  llvm::Type * Param0;
3477
  Intrinsic::ID  Param1;
3478
  llvm::Type * Param2;
3479
  switch (BuiltinID) {
3480
  case ARM::BI__builtin_arm_mve_vmaxaq_m_s16:
3481
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3482
    Param1 = Intrinsic::arm_mve_vmaxa_predicated;
3483
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3484
    break;
3485
  case ARM::BI__builtin_arm_mve_vmaxaq_m_s32:
3486
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3487
    Param1 = Intrinsic::arm_mve_vmaxa_predicated;
3488
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3489
    break;
3490
  case ARM::BI__builtin_arm_mve_vmaxaq_m_s8:
3491
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3492
    Param1 = Intrinsic::arm_mve_vmaxa_predicated;
3493
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3494
    break;
3495
  case ARM::BI__builtin_arm_mve_vmaxnmaq_m_f16:
3496
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3497
    Param1 = Intrinsic::arm_mve_vmaxnma_predicated;
3498
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
3499
    break;
3500
  case ARM::BI__builtin_arm_mve_vmaxnmaq_m_f32:
3501
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3502
    Param1 = Intrinsic::arm_mve_vmaxnma_predicated;
3503
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
3504
    break;
3505
  case ARM::BI__builtin_arm_mve_vminaq_m_s16:
3506
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3507
    Param1 = Intrinsic::arm_mve_vmina_predicated;
3508
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3509
    break;
3510
  case ARM::BI__builtin_arm_mve_vminaq_m_s32:
3511
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3512
    Param1 = Intrinsic::arm_mve_vmina_predicated;
3513
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3514
    break;
3515
  case ARM::BI__builtin_arm_mve_vminaq_m_s8:
3516
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3517
    Param1 = Intrinsic::arm_mve_vmina_predicated;
3518
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3519
    break;
3520
  case ARM::BI__builtin_arm_mve_vminnmaq_m_f16:
3521
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3522
    Param1 = Intrinsic::arm_mve_vminnma_predicated;
3523
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
3524
    break;
3525
  case ARM::BI__builtin_arm_mve_vminnmaq_m_f32:
3526
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3527
    Param1 = Intrinsic::arm_mve_vminnma_predicated;
3528
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
3529
    break;
3530
  }
3531
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3532
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3533
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3534
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
3535
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val3});
3536
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val0, Val1, Val4});
3537
}
3538
case ARM::BI__builtin_arm_mve_vmaxavq_p_s32:
3539
case ARM::BI__builtin_arm_mve_vminavq_p_s32: {
3540
  Intrinsic::ID  Param0;
3541
  switch (BuiltinID) {
3542
  case ARM::BI__builtin_arm_mve_vmaxavq_p_s32:
3543
    Param0 = Intrinsic::arm_mve_maxav_predicated;
3544
    break;
3545
  case ARM::BI__builtin_arm_mve_vminavq_p_s32:
3546
    Param0 = Intrinsic::arm_mve_minav_predicated;
3547
    break;
3548
  }
3549
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3550
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3551
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3552
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
3553
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val3});
3554
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val0, Val1, Val4});
3555
  return Builder.CreateIntCast(Val5, Int32Ty, false);
3556
}
3557
case ARM::BI__builtin_arm_mve_vmlaq_m_n_s16:
3558
case ARM::BI__builtin_arm_mve_vmlaq_m_n_s8:
3559
case ARM::BI__builtin_arm_mve_vmlaq_m_n_u16:
3560
case ARM::BI__builtin_arm_mve_vmlaq_m_n_u8:
3561
case ARM::BI__builtin_arm_mve_vmlasq_m_n_s16:
3562
case ARM::BI__builtin_arm_mve_vmlasq_m_n_s8:
3563
case ARM::BI__builtin_arm_mve_vmlasq_m_n_u16:
3564
case ARM::BI__builtin_arm_mve_vmlasq_m_n_u8:
3565
case ARM::BI__builtin_arm_mve_vqdmlahq_m_n_s16:
3566
case ARM::BI__builtin_arm_mve_vqdmlahq_m_n_s8:
3567
case ARM::BI__builtin_arm_mve_vqdmlashq_m_n_s16:
3568
case ARM::BI__builtin_arm_mve_vqdmlashq_m_n_s8:
3569
case ARM::BI__builtin_arm_mve_vqrdmlahq_m_n_s16:
3570
case ARM::BI__builtin_arm_mve_vqrdmlahq_m_n_s8:
3571
case ARM::BI__builtin_arm_mve_vqrdmlashq_m_n_s16:
3572
case ARM::BI__builtin_arm_mve_vqrdmlashq_m_n_s8: {
3573
  llvm::Type * Param0;
3574
  Intrinsic::ID  Param1;
3575
  llvm::Type * Param2;
3576
  switch (BuiltinID) {
3577
  case ARM::BI__builtin_arm_mve_vmlaq_m_n_s16:
3578
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3579
    Param1 = Intrinsic::arm_mve_vmla_n_predicated;
3580
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3581
    break;
3582
  case ARM::BI__builtin_arm_mve_vmlaq_m_n_s8:
3583
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3584
    Param1 = Intrinsic::arm_mve_vmla_n_predicated;
3585
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3586
    break;
3587
  case ARM::BI__builtin_arm_mve_vmlaq_m_n_u16:
3588
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3589
    Param1 = Intrinsic::arm_mve_vmla_n_predicated;
3590
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3591
    break;
3592
  case ARM::BI__builtin_arm_mve_vmlaq_m_n_u8:
3593
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3594
    Param1 = Intrinsic::arm_mve_vmla_n_predicated;
3595
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3596
    break;
3597
  case ARM::BI__builtin_arm_mve_vmlasq_m_n_s16:
3598
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3599
    Param1 = Intrinsic::arm_mve_vmlas_n_predicated;
3600
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3601
    break;
3602
  case ARM::BI__builtin_arm_mve_vmlasq_m_n_s8:
3603
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3604
    Param1 = Intrinsic::arm_mve_vmlas_n_predicated;
3605
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3606
    break;
3607
  case ARM::BI__builtin_arm_mve_vmlasq_m_n_u16:
3608
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3609
    Param1 = Intrinsic::arm_mve_vmlas_n_predicated;
3610
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3611
    break;
3612
  case ARM::BI__builtin_arm_mve_vmlasq_m_n_u8:
3613
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3614
    Param1 = Intrinsic::arm_mve_vmlas_n_predicated;
3615
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3616
    break;
3617
  case ARM::BI__builtin_arm_mve_vqdmlahq_m_n_s16:
3618
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3619
    Param1 = Intrinsic::arm_mve_vqdmlah_predicated;
3620
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3621
    break;
3622
  case ARM::BI__builtin_arm_mve_vqdmlahq_m_n_s8:
3623
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3624
    Param1 = Intrinsic::arm_mve_vqdmlah_predicated;
3625
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3626
    break;
3627
  case ARM::BI__builtin_arm_mve_vqdmlashq_m_n_s16:
3628
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3629
    Param1 = Intrinsic::arm_mve_vqdmlash_predicated;
3630
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3631
    break;
3632
  case ARM::BI__builtin_arm_mve_vqdmlashq_m_n_s8:
3633
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3634
    Param1 = Intrinsic::arm_mve_vqdmlash_predicated;
3635
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3636
    break;
3637
  case ARM::BI__builtin_arm_mve_vqrdmlahq_m_n_s16:
3638
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3639
    Param1 = Intrinsic::arm_mve_vqrdmlah_predicated;
3640
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3641
    break;
3642
  case ARM::BI__builtin_arm_mve_vqrdmlahq_m_n_s8:
3643
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3644
    Param1 = Intrinsic::arm_mve_vqrdmlah_predicated;
3645
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3646
    break;
3647
  case ARM::BI__builtin_arm_mve_vqrdmlashq_m_n_s16:
3648
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3649
    Param1 = Intrinsic::arm_mve_vqrdmlash_predicated;
3650
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3651
    break;
3652
  case ARM::BI__builtin_arm_mve_vqrdmlashq_m_n_s8:
3653
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3654
    Param1 = Intrinsic::arm_mve_vqrdmlash_predicated;
3655
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3656
    break;
3657
  }
3658
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3659
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3660
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3661
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
3662
  Value *Val4 = EmitScalarExpr(E->getArg(3));
3663
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
3664
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val5});
3665
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val0, Val1, Val3, Val6});
3666
}
3667
case ARM::BI__builtin_arm_mve_vqdmlahq_n_s16:
3668
case ARM::BI__builtin_arm_mve_vqdmlahq_n_s8:
3669
case ARM::BI__builtin_arm_mve_vqdmlashq_n_s16:
3670
case ARM::BI__builtin_arm_mve_vqdmlashq_n_s8:
3671
case ARM::BI__builtin_arm_mve_vqrdmlahq_n_s16:
3672
case ARM::BI__builtin_arm_mve_vqrdmlahq_n_s8:
3673
case ARM::BI__builtin_arm_mve_vqrdmlashq_n_s16:
3674
case ARM::BI__builtin_arm_mve_vqrdmlashq_n_s8: {
3675
  Intrinsic::ID  Param0;
3676
  llvm::Type * Param1;
3677
  switch (BuiltinID) {
3678
  case ARM::BI__builtin_arm_mve_vqdmlahq_n_s16:
3679
    Param0 = Intrinsic::arm_mve_vqdmlah;
3680
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
3681
    break;
3682
  case ARM::BI__builtin_arm_mve_vqdmlahq_n_s8:
3683
    Param0 = Intrinsic::arm_mve_vqdmlah;
3684
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
3685
    break;
3686
  case ARM::BI__builtin_arm_mve_vqdmlashq_n_s16:
3687
    Param0 = Intrinsic::arm_mve_vqdmlash;
3688
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
3689
    break;
3690
  case ARM::BI__builtin_arm_mve_vqdmlashq_n_s8:
3691
    Param0 = Intrinsic::arm_mve_vqdmlash;
3692
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
3693
    break;
3694
  case ARM::BI__builtin_arm_mve_vqrdmlahq_n_s16:
3695
    Param0 = Intrinsic::arm_mve_vqrdmlah;
3696
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
3697
    break;
3698
  case ARM::BI__builtin_arm_mve_vqrdmlahq_n_s8:
3699
    Param0 = Intrinsic::arm_mve_vqrdmlah;
3700
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
3701
    break;
3702
  case ARM::BI__builtin_arm_mve_vqrdmlashq_n_s16:
3703
    Param0 = Intrinsic::arm_mve_vqrdmlash;
3704
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
3705
    break;
3706
  case ARM::BI__builtin_arm_mve_vqrdmlashq_n_s8:
3707
    Param0 = Intrinsic::arm_mve_vqrdmlash;
3708
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
3709
    break;
3710
  }
3711
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3712
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3713
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3714
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
3715
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val0, Val1, Val3});
3716
}
3717
case ARM::BI__builtin_arm_mve_vddupq_m_n_u16:
3718
case ARM::BI__builtin_arm_mve_vddupq_m_n_u32:
3719
case ARM::BI__builtin_arm_mve_vddupq_m_n_u8:
3720
case ARM::BI__builtin_arm_mve_vidupq_m_n_u16:
3721
case ARM::BI__builtin_arm_mve_vidupq_m_n_u32:
3722
case ARM::BI__builtin_arm_mve_vidupq_m_n_u8: {
3723
  llvm::Type * Param0;
3724
  Intrinsic::ID  Param1;
3725
  llvm::Type * Param2;
3726
  switch (BuiltinID) {
3727
  case ARM::BI__builtin_arm_mve_vddupq_m_n_u16:
3728
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3729
    Param1 = Intrinsic::arm_mve_vddup_predicated;
3730
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3731
    break;
3732
  case ARM::BI__builtin_arm_mve_vddupq_m_n_u32:
3733
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3734
    Param1 = Intrinsic::arm_mve_vddup_predicated;
3735
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3736
    break;
3737
  case ARM::BI__builtin_arm_mve_vddupq_m_n_u8:
3738
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3739
    Param1 = Intrinsic::arm_mve_vddup_predicated;
3740
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3741
    break;
3742
  case ARM::BI__builtin_arm_mve_vidupq_m_n_u16:
3743
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3744
    Param1 = Intrinsic::arm_mve_vidup_predicated;
3745
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3746
    break;
3747
  case ARM::BI__builtin_arm_mve_vidupq_m_n_u32:
3748
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3749
    Param1 = Intrinsic::arm_mve_vidup_predicated;
3750
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3751
    break;
3752
  case ARM::BI__builtin_arm_mve_vidupq_m_n_u8:
3753
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3754
    Param1 = Intrinsic::arm_mve_vidup_predicated;
3755
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3756
    break;
3757
  }
3758
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3759
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3760
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3761
  Value *Val3 = EmitScalarExpr(E->getArg(3));
3762
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
3763
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val4});
3764
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val0, Val1, Val2, Val5});
3765
  return Builder.CreateExtractValue(Val6, static_cast<unsigned>(0));
3766
}
3767
case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_p_s64:
3768
case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_p_u64:
3769
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_p_f32:
3770
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_p_s32:
3771
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_p_u32: {
3772
  llvm::Type * Param0;
3773
  llvm::Type * Param1;
3774
  llvm::Type * Param2;
3775
  switch (BuiltinID) {
3776
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_p_s64:
3777
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
3778
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
3779
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
3780
    break;
3781
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_p_u64:
3782
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
3783
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
3784
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
3785
    break;
3786
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_p_f32:
3787
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3788
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
3789
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
3790
    break;
3791
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_p_s32:
3792
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3793
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
3794
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3795
    break;
3796
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_p_u32:
3797
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3798
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
3799
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3800
    break;
3801
  }
3802
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3803
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3804
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3805
  Value *Val3 = EmitScalarExpr(E->getArg(3));
3806
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
3807
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val4});
3808
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vstr_scatter_base_predicated, {Param1, Param2, Param0}), {Val0, Val1, Val2, Val5});
3809
}
3810
case ARM::BI__builtin_arm_mve_vbrsrq_m_n_f16:
3811
case ARM::BI__builtin_arm_mve_vbrsrq_m_n_f32:
3812
case ARM::BI__builtin_arm_mve_vbrsrq_m_n_s16:
3813
case ARM::BI__builtin_arm_mve_vbrsrq_m_n_s32:
3814
case ARM::BI__builtin_arm_mve_vbrsrq_m_n_s8:
3815
case ARM::BI__builtin_arm_mve_vbrsrq_m_n_u16:
3816
case ARM::BI__builtin_arm_mve_vbrsrq_m_n_u32:
3817
case ARM::BI__builtin_arm_mve_vbrsrq_m_n_u8:
3818
case ARM::BI__builtin_arm_mve_vmlaq_m_n_s32:
3819
case ARM::BI__builtin_arm_mve_vmlaq_m_n_u32:
3820
case ARM::BI__builtin_arm_mve_vmlasq_m_n_s32:
3821
case ARM::BI__builtin_arm_mve_vmlasq_m_n_u32:
3822
case ARM::BI__builtin_arm_mve_vqdmlahq_m_n_s32:
3823
case ARM::BI__builtin_arm_mve_vqdmlashq_m_n_s32:
3824
case ARM::BI__builtin_arm_mve_vqrdmlahq_m_n_s32:
3825
case ARM::BI__builtin_arm_mve_vqrdmlashq_m_n_s32:
3826
case ARM::BI__builtin_arm_mve_vsliq_m_n_s16:
3827
case ARM::BI__builtin_arm_mve_vsliq_m_n_s32:
3828
case ARM::BI__builtin_arm_mve_vsliq_m_n_s8:
3829
case ARM::BI__builtin_arm_mve_vsliq_m_n_u16:
3830
case ARM::BI__builtin_arm_mve_vsliq_m_n_u32:
3831
case ARM::BI__builtin_arm_mve_vsliq_m_n_u8:
3832
case ARM::BI__builtin_arm_mve_vsriq_m_n_s16:
3833
case ARM::BI__builtin_arm_mve_vsriq_m_n_s32:
3834
case ARM::BI__builtin_arm_mve_vsriq_m_n_s8:
3835
case ARM::BI__builtin_arm_mve_vsriq_m_n_u16:
3836
case ARM::BI__builtin_arm_mve_vsriq_m_n_u32:
3837
case ARM::BI__builtin_arm_mve_vsriq_m_n_u8: {
3838
  llvm::Type * Param0;
3839
  Intrinsic::ID  Param1;
3840
  llvm::Type * Param2;
3841
  switch (BuiltinID) {
3842
  case ARM::BI__builtin_arm_mve_vbrsrq_m_n_f16:
3843
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3844
    Param1 = Intrinsic::arm_mve_vbrsr_predicated;
3845
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
3846
    break;
3847
  case ARM::BI__builtin_arm_mve_vbrsrq_m_n_f32:
3848
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3849
    Param1 = Intrinsic::arm_mve_vbrsr_predicated;
3850
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
3851
    break;
3852
  case ARM::BI__builtin_arm_mve_vbrsrq_m_n_s16:
3853
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3854
    Param1 = Intrinsic::arm_mve_vbrsr_predicated;
3855
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3856
    break;
3857
  case ARM::BI__builtin_arm_mve_vbrsrq_m_n_s32:
3858
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3859
    Param1 = Intrinsic::arm_mve_vbrsr_predicated;
3860
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3861
    break;
3862
  case ARM::BI__builtin_arm_mve_vbrsrq_m_n_s8:
3863
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3864
    Param1 = Intrinsic::arm_mve_vbrsr_predicated;
3865
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3866
    break;
3867
  case ARM::BI__builtin_arm_mve_vbrsrq_m_n_u16:
3868
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3869
    Param1 = Intrinsic::arm_mve_vbrsr_predicated;
3870
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3871
    break;
3872
  case ARM::BI__builtin_arm_mve_vbrsrq_m_n_u32:
3873
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3874
    Param1 = Intrinsic::arm_mve_vbrsr_predicated;
3875
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3876
    break;
3877
  case ARM::BI__builtin_arm_mve_vbrsrq_m_n_u8:
3878
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3879
    Param1 = Intrinsic::arm_mve_vbrsr_predicated;
3880
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3881
    break;
3882
  case ARM::BI__builtin_arm_mve_vmlaq_m_n_s32:
3883
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3884
    Param1 = Intrinsic::arm_mve_vmla_n_predicated;
3885
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3886
    break;
3887
  case ARM::BI__builtin_arm_mve_vmlaq_m_n_u32:
3888
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3889
    Param1 = Intrinsic::arm_mve_vmla_n_predicated;
3890
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3891
    break;
3892
  case ARM::BI__builtin_arm_mve_vmlasq_m_n_s32:
3893
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3894
    Param1 = Intrinsic::arm_mve_vmlas_n_predicated;
3895
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3896
    break;
3897
  case ARM::BI__builtin_arm_mve_vmlasq_m_n_u32:
3898
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3899
    Param1 = Intrinsic::arm_mve_vmlas_n_predicated;
3900
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3901
    break;
3902
  case ARM::BI__builtin_arm_mve_vqdmlahq_m_n_s32:
3903
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3904
    Param1 = Intrinsic::arm_mve_vqdmlah_predicated;
3905
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3906
    break;
3907
  case ARM::BI__builtin_arm_mve_vqdmlashq_m_n_s32:
3908
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3909
    Param1 = Intrinsic::arm_mve_vqdmlash_predicated;
3910
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3911
    break;
3912
  case ARM::BI__builtin_arm_mve_vqrdmlahq_m_n_s32:
3913
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3914
    Param1 = Intrinsic::arm_mve_vqrdmlah_predicated;
3915
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3916
    break;
3917
  case ARM::BI__builtin_arm_mve_vqrdmlashq_m_n_s32:
3918
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3919
    Param1 = Intrinsic::arm_mve_vqrdmlash_predicated;
3920
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3921
    break;
3922
  case ARM::BI__builtin_arm_mve_vsliq_m_n_s16:
3923
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3924
    Param1 = Intrinsic::arm_mve_vsli_predicated;
3925
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3926
    break;
3927
  case ARM::BI__builtin_arm_mve_vsliq_m_n_s32:
3928
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3929
    Param1 = Intrinsic::arm_mve_vsli_predicated;
3930
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3931
    break;
3932
  case ARM::BI__builtin_arm_mve_vsliq_m_n_s8:
3933
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3934
    Param1 = Intrinsic::arm_mve_vsli_predicated;
3935
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3936
    break;
3937
  case ARM::BI__builtin_arm_mve_vsliq_m_n_u16:
3938
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3939
    Param1 = Intrinsic::arm_mve_vsli_predicated;
3940
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3941
    break;
3942
  case ARM::BI__builtin_arm_mve_vsliq_m_n_u32:
3943
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3944
    Param1 = Intrinsic::arm_mve_vsli_predicated;
3945
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3946
    break;
3947
  case ARM::BI__builtin_arm_mve_vsliq_m_n_u8:
3948
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3949
    Param1 = Intrinsic::arm_mve_vsli_predicated;
3950
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3951
    break;
3952
  case ARM::BI__builtin_arm_mve_vsriq_m_n_s16:
3953
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3954
    Param1 = Intrinsic::arm_mve_vsri_predicated;
3955
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3956
    break;
3957
  case ARM::BI__builtin_arm_mve_vsriq_m_n_s32:
3958
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3959
    Param1 = Intrinsic::arm_mve_vsri_predicated;
3960
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3961
    break;
3962
  case ARM::BI__builtin_arm_mve_vsriq_m_n_s8:
3963
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3964
    Param1 = Intrinsic::arm_mve_vsri_predicated;
3965
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3966
    break;
3967
  case ARM::BI__builtin_arm_mve_vsriq_m_n_u16:
3968
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
3969
    Param1 = Intrinsic::arm_mve_vsri_predicated;
3970
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
3971
    break;
3972
  case ARM::BI__builtin_arm_mve_vsriq_m_n_u32:
3973
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
3974
    Param1 = Intrinsic::arm_mve_vsri_predicated;
3975
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
3976
    break;
3977
  case ARM::BI__builtin_arm_mve_vsriq_m_n_u8:
3978
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
3979
    Param1 = Intrinsic::arm_mve_vsri_predicated;
3980
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
3981
    break;
3982
  }
3983
  Value *Val0 = EmitScalarExpr(E->getArg(0));
3984
  Value *Val1 = EmitScalarExpr(E->getArg(1));
3985
  Value *Val2 = EmitScalarExpr(E->getArg(2));
3986
  Value *Val3 = EmitScalarExpr(E->getArg(3));
3987
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
3988
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val4});
3989
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val0, Val1, Val2, Val5});
3990
}
3991
case ARM::BI__builtin_arm_mve_vdwdupq_m_n_u16:
3992
case ARM::BI__builtin_arm_mve_vdwdupq_m_n_u32:
3993
case ARM::BI__builtin_arm_mve_vdwdupq_m_n_u8:
3994
case ARM::BI__builtin_arm_mve_viwdupq_m_n_u16:
3995
case ARM::BI__builtin_arm_mve_viwdupq_m_n_u32:
3996
case ARM::BI__builtin_arm_mve_viwdupq_m_n_u8: {
3997
  llvm::Type * Param0;
3998
  Intrinsic::ID  Param1;
3999
  llvm::Type * Param2;
4000
  switch (BuiltinID) {
4001
  case ARM::BI__builtin_arm_mve_vdwdupq_m_n_u16:
4002
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4003
    Param1 = Intrinsic::arm_mve_vdwdup_predicated;
4004
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
4005
    break;
4006
  case ARM::BI__builtin_arm_mve_vdwdupq_m_n_u32:
4007
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4008
    Param1 = Intrinsic::arm_mve_vdwdup_predicated;
4009
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
4010
    break;
4011
  case ARM::BI__builtin_arm_mve_vdwdupq_m_n_u8:
4012
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4013
    Param1 = Intrinsic::arm_mve_vdwdup_predicated;
4014
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
4015
    break;
4016
  case ARM::BI__builtin_arm_mve_viwdupq_m_n_u16:
4017
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4018
    Param1 = Intrinsic::arm_mve_viwdup_predicated;
4019
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
4020
    break;
4021
  case ARM::BI__builtin_arm_mve_viwdupq_m_n_u32:
4022
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4023
    Param1 = Intrinsic::arm_mve_viwdup_predicated;
4024
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
4025
    break;
4026
  case ARM::BI__builtin_arm_mve_viwdupq_m_n_u8:
4027
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4028
    Param1 = Intrinsic::arm_mve_viwdup_predicated;
4029
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
4030
    break;
4031
  }
4032
  Value *Val0 = EmitScalarExpr(E->getArg(0));
4033
  Value *Val1 = EmitScalarExpr(E->getArg(1));
4034
  Value *Val2 = EmitScalarExpr(E->getArg(2));
4035
  Value *Val3 = EmitScalarExpr(E->getArg(3));
4036
  Value *Val4 = EmitScalarExpr(E->getArg(4));
4037
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
4038
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val5});
4039
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val0, Val1, Val2, Val3, Val6});
4040
  return Builder.CreateExtractValue(Val7, static_cast<unsigned>(0));
4041
}
4042
case ARM::BI__builtin_arm_mve_vadciq_m_s32:
4043
case ARM::BI__builtin_arm_mve_vadciq_m_u32:
4044
case ARM::BI__builtin_arm_mve_vsbciq_m_s32:
4045
case ARM::BI__builtin_arm_mve_vsbciq_m_u32: {
4046
  Intrinsic::ID  Param0;
4047
  switch (BuiltinID) {
4048
  case ARM::BI__builtin_arm_mve_vadciq_m_s32:
4049
    Param0 = Intrinsic::arm_mve_vadc_predicated;
4050
    break;
4051
  case ARM::BI__builtin_arm_mve_vadciq_m_u32:
4052
    Param0 = Intrinsic::arm_mve_vadc_predicated;
4053
    break;
4054
  case ARM::BI__builtin_arm_mve_vsbciq_m_s32:
4055
    Param0 = Intrinsic::arm_mve_vsbc_predicated;
4056
    break;
4057
  case ARM::BI__builtin_arm_mve_vsbciq_m_u32:
4058
    Param0 = Intrinsic::arm_mve_vsbc_predicated;
4059
    break;
4060
  }
4061
  Value *Val0 = EmitScalarExpr(E->getArg(0));
4062
  Value *Val1 = EmitScalarExpr(E->getArg(1));
4063
  Value *Val2 = EmitScalarExpr(E->getArg(2));
4064
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, 0);
4065
  Value *Val4 = EmitScalarExpr(E->getArg(4));
4066
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
4067
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
4068
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val0, Val1, Val2, Val3, Val6});
4069
  Value *Val8 = llvm::ConstantInt::get(Int32Ty, 1);
4070
  Value *Val9 = Builder.CreateExtractValue(Val7, static_cast<unsigned>(1));
4071
  Value *Val10 = llvm::ConstantInt::get(Int32Ty, 29);
4072
  Value *Val11 = Builder.CreateLShr(Val9, Val10);
4073
  Value *Val12 = Builder.CreateAnd(Val8, Val11);
4074
  Address Val13 = EmitPointerWithAlignment(E->getArg(3));
4075
  Builder.CreateStore(Val12, Val13);
4076
  return Builder.CreateExtractValue(Val7, static_cast<unsigned>(0));
4077
}
4078
case ARM::BI__builtin_arm_mve_vqdmladhq_m_s16:
4079
case ARM::BI__builtin_arm_mve_vqdmladhq_m_s32:
4080
case ARM::BI__builtin_arm_mve_vqdmladhq_m_s8:
4081
case ARM::BI__builtin_arm_mve_vqdmladhxq_m_s16:
4082
case ARM::BI__builtin_arm_mve_vqdmladhxq_m_s32:
4083
case ARM::BI__builtin_arm_mve_vqdmladhxq_m_s8:
4084
case ARM::BI__builtin_arm_mve_vqdmlsdhq_m_s16:
4085
case ARM::BI__builtin_arm_mve_vqdmlsdhq_m_s32:
4086
case ARM::BI__builtin_arm_mve_vqdmlsdhq_m_s8:
4087
case ARM::BI__builtin_arm_mve_vqdmlsdhxq_m_s16:
4088
case ARM::BI__builtin_arm_mve_vqdmlsdhxq_m_s32:
4089
case ARM::BI__builtin_arm_mve_vqdmlsdhxq_m_s8:
4090
case ARM::BI__builtin_arm_mve_vqrdmladhq_m_s16:
4091
case ARM::BI__builtin_arm_mve_vqrdmladhq_m_s32:
4092
case ARM::BI__builtin_arm_mve_vqrdmladhq_m_s8:
4093
case ARM::BI__builtin_arm_mve_vqrdmladhxq_m_s16:
4094
case ARM::BI__builtin_arm_mve_vqrdmladhxq_m_s32:
4095
case ARM::BI__builtin_arm_mve_vqrdmladhxq_m_s8:
4096
case ARM::BI__builtin_arm_mve_vqrdmlsdhq_m_s16:
4097
case ARM::BI__builtin_arm_mve_vqrdmlsdhq_m_s32:
4098
case ARM::BI__builtin_arm_mve_vqrdmlsdhq_m_s8:
4099
case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_m_s16:
4100
case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_m_s32:
4101
case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_m_s8: {
4102
  uint32_t  Param0;
4103
  uint32_t  Param1;
4104
  uint32_t  Param2;
4105
  llvm::Type * Param3;
4106
  llvm::Type * Param4;
4107
  switch (BuiltinID) {
4108
  case ARM::BI__builtin_arm_mve_vqdmladhq_m_s16:
4109
    Param0 = 0;
4110
    Param1 = 0;
4111
    Param2 = 0;
4112
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4113
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
4114
    break;
4115
  case ARM::BI__builtin_arm_mve_vqdmladhq_m_s32:
4116
    Param0 = 0;
4117
    Param1 = 0;
4118
    Param2 = 0;
4119
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4120
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
4121
    break;
4122
  case ARM::BI__builtin_arm_mve_vqdmladhq_m_s8:
4123
    Param0 = 0;
4124
    Param1 = 0;
4125
    Param2 = 0;
4126
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4127
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
4128
    break;
4129
  case ARM::BI__builtin_arm_mve_vqdmladhxq_m_s16:
4130
    Param0 = 1;
4131
    Param1 = 0;
4132
    Param2 = 0;
4133
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4134
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
4135
    break;
4136
  case ARM::BI__builtin_arm_mve_vqdmladhxq_m_s32:
4137
    Param0 = 1;
4138
    Param1 = 0;
4139
    Param2 = 0;
4140
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4141
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
4142
    break;
4143
  case ARM::BI__builtin_arm_mve_vqdmladhxq_m_s8:
4144
    Param0 = 1;
4145
    Param1 = 0;
4146
    Param2 = 0;
4147
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4148
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
4149
    break;
4150
  case ARM::BI__builtin_arm_mve_vqdmlsdhq_m_s16:
4151
    Param0 = 0;
4152
    Param1 = 0;
4153
    Param2 = 1;
4154
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4155
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
4156
    break;
4157
  case ARM::BI__builtin_arm_mve_vqdmlsdhq_m_s32:
4158
    Param0 = 0;
4159
    Param1 = 0;
4160
    Param2 = 1;
4161
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4162
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
4163
    break;
4164
  case ARM::BI__builtin_arm_mve_vqdmlsdhq_m_s8:
4165
    Param0 = 0;
4166
    Param1 = 0;
4167
    Param2 = 1;
4168
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4169
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
4170
    break;
4171
  case ARM::BI__builtin_arm_mve_vqdmlsdhxq_m_s16:
4172
    Param0 = 1;
4173
    Param1 = 0;
4174
    Param2 = 1;
4175
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4176
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
4177
    break;
4178
  case ARM::BI__builtin_arm_mve_vqdmlsdhxq_m_s32:
4179
    Param0 = 1;
4180
    Param1 = 0;
4181
    Param2 = 1;
4182
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4183
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
4184
    break;
4185
  case ARM::BI__builtin_arm_mve_vqdmlsdhxq_m_s8:
4186
    Param0 = 1;
4187
    Param1 = 0;
4188
    Param2 = 1;
4189
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4190
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
4191
    break;
4192
  case ARM::BI__builtin_arm_mve_vqrdmladhq_m_s16:
4193
    Param0 = 0;
4194
    Param1 = 1;
4195
    Param2 = 0;
4196
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4197
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
4198
    break;
4199
  case ARM::BI__builtin_arm_mve_vqrdmladhq_m_s32:
4200
    Param0 = 0;
4201
    Param1 = 1;
4202
    Param2 = 0;
4203
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4204
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
4205
    break;
4206
  case ARM::BI__builtin_arm_mve_vqrdmladhq_m_s8:
4207
    Param0 = 0;
4208
    Param1 = 1;
4209
    Param2 = 0;
4210
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4211
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
4212
    break;
4213
  case ARM::BI__builtin_arm_mve_vqrdmladhxq_m_s16:
4214
    Param0 = 1;
4215
    Param1 = 1;
4216
    Param2 = 0;
4217
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4218
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
4219
    break;
4220
  case ARM::BI__builtin_arm_mve_vqrdmladhxq_m_s32:
4221
    Param0 = 1;
4222
    Param1 = 1;
4223
    Param2 = 0;
4224
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4225
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
4226
    break;
4227
  case ARM::BI__builtin_arm_mve_vqrdmladhxq_m_s8:
4228
    Param0 = 1;
4229
    Param1 = 1;
4230
    Param2 = 0;
4231
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4232
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
4233
    break;
4234
  case ARM::BI__builtin_arm_mve_vqrdmlsdhq_m_s16:
4235
    Param0 = 0;
4236
    Param1 = 1;
4237
    Param2 = 1;
4238
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4239
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
4240
    break;
4241
  case ARM::BI__builtin_arm_mve_vqrdmlsdhq_m_s32:
4242
    Param0 = 0;
4243
    Param1 = 1;
4244
    Param2 = 1;
4245
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4246
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
4247
    break;
4248
  case ARM::BI__builtin_arm_mve_vqrdmlsdhq_m_s8:
4249
    Param0 = 0;
4250
    Param1 = 1;
4251
    Param2 = 1;
4252
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4253
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
4254
    break;
4255
  case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_m_s16:
4256
    Param0 = 1;
4257
    Param1 = 1;
4258
    Param2 = 1;
4259
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4260
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
4261
    break;
4262
  case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_m_s32:
4263
    Param0 = 1;
4264
    Param1 = 1;
4265
    Param2 = 1;
4266
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4267
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
4268
    break;
4269
  case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_m_s8:
4270
    Param0 = 1;
4271
    Param1 = 1;
4272
    Param2 = 1;
4273
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
4274
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
4275
    break;
4276
  }
4277
  Value *Val0 = EmitScalarExpr(E->getArg(0));
4278
  Value *Val1 = EmitScalarExpr(E->getArg(1));
4279
  Value *Val2 = EmitScalarExpr(E->getArg(2));
4280
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
4281
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param1);
4282
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param2);
4283
  Value *Val6 = EmitScalarExpr(E->getArg(3));
4284
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
4285
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val7});
4286
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vqdmlad_predicated, {Param4, Param3}), {Val0, Val1, Val2, Val3, Val4, Val5, Val8});
4287
}
4288
case ARM::BI__builtin_arm_mve_vqrshrnbq_m_n_s16:
4289
case ARM::BI__builtin_arm_mve_vqrshrnbq_m_n_s32:
4290
case ARM::BI__builtin_arm_mve_vqrshrnbq_m_n_u16:
4291
case ARM::BI__builtin_arm_mve_vqrshrnbq_m_n_u32:
4292
case ARM::BI__builtin_arm_mve_vqrshrntq_m_n_s16:
4293
case ARM::BI__builtin_arm_mve_vqrshrntq_m_n_s32:
4294
case ARM::BI__builtin_arm_mve_vqrshrntq_m_n_u16:
4295
case ARM::BI__builtin_arm_mve_vqrshrntq_m_n_u32:
4296
case ARM::BI__builtin_arm_mve_vqrshrunbq_m_n_s16:
4297
case ARM::BI__builtin_arm_mve_vqrshrunbq_m_n_s32:
4298
case ARM::BI__builtin_arm_mve_vqrshruntq_m_n_s16:
4299
case ARM::BI__builtin_arm_mve_vqrshruntq_m_n_s32:
4300
case ARM::BI__builtin_arm_mve_vqshrnbq_m_n_s16:
4301
case ARM::BI__builtin_arm_mve_vqshrnbq_m_n_s32:
4302
case ARM::BI__builtin_arm_mve_vqshrnbq_m_n_u16:
4303
case ARM::BI__builtin_arm_mve_vqshrnbq_m_n_u32:
4304
case ARM::BI__builtin_arm_mve_vqshrntq_m_n_s16:
4305
case ARM::BI__builtin_arm_mve_vqshrntq_m_n_s32:
4306
case ARM::BI__builtin_arm_mve_vqshrntq_m_n_u16:
4307
case ARM::BI__builtin_arm_mve_vqshrntq_m_n_u32:
4308
case ARM::BI__builtin_arm_mve_vqshrunbq_m_n_s16:
4309
case ARM::BI__builtin_arm_mve_vqshrunbq_m_n_s32:
4310
case ARM::BI__builtin_arm_mve_vqshruntq_m_n_s16:
4311
case ARM::BI__builtin_arm_mve_vqshruntq_m_n_s32:
4312
case ARM::BI__builtin_arm_mve_vrshrnbq_m_n_s16:
4313
case ARM::BI__builtin_arm_mve_vrshrnbq_m_n_s32:
4314
case ARM::BI__builtin_arm_mve_vrshrnbq_m_n_u16:
4315
case ARM::BI__builtin_arm_mve_vrshrnbq_m_n_u32:
4316
case ARM::BI__builtin_arm_mve_vrshrntq_m_n_s16:
4317
case ARM::BI__builtin_arm_mve_vrshrntq_m_n_s32:
4318
case ARM::BI__builtin_arm_mve_vrshrntq_m_n_u16:
4319
case ARM::BI__builtin_arm_mve_vrshrntq_m_n_u32:
4320
case ARM::BI__builtin_arm_mve_vshrnbq_m_n_s16:
4321
case ARM::BI__builtin_arm_mve_vshrnbq_m_n_s32:
4322
case ARM::BI__builtin_arm_mve_vshrnbq_m_n_u16:
4323
case ARM::BI__builtin_arm_mve_vshrnbq_m_n_u32:
4324
case ARM::BI__builtin_arm_mve_vshrntq_m_n_s16:
4325
case ARM::BI__builtin_arm_mve_vshrntq_m_n_s32:
4326
case ARM::BI__builtin_arm_mve_vshrntq_m_n_u16:
4327
case ARM::BI__builtin_arm_mve_vshrntq_m_n_u32: {
4328
  uint32_t  Param0;
4329
  uint32_t  Param1;
4330
  uint32_t  Param2;
4331
  uint32_t  Param3;
4332
  uint32_t  Param4;
4333
  llvm::Type * Param5;
4334
  llvm::Type * Param6;
4335
  llvm::Type * Param7;
4336
  switch (BuiltinID) {
4337
  case ARM::BI__builtin_arm_mve_vqrshrnbq_m_n_s16:
4338
    Param0 = 1;
4339
    Param1 = 1;
4340
    Param2 = 0;
4341
    Param3 = 0;
4342
    Param4 = 0;
4343
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4344
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4345
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4346
    break;
4347
  case ARM::BI__builtin_arm_mve_vqrshrnbq_m_n_s32:
4348
    Param0 = 1;
4349
    Param1 = 1;
4350
    Param2 = 0;
4351
    Param3 = 0;
4352
    Param4 = 0;
4353
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4354
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4355
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4356
    break;
4357
  case ARM::BI__builtin_arm_mve_vqrshrnbq_m_n_u16:
4358
    Param0 = 1;
4359
    Param1 = 1;
4360
    Param2 = 1;
4361
    Param3 = 1;
4362
    Param4 = 0;
4363
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4364
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4365
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4366
    break;
4367
  case ARM::BI__builtin_arm_mve_vqrshrnbq_m_n_u32:
4368
    Param0 = 1;
4369
    Param1 = 1;
4370
    Param2 = 1;
4371
    Param3 = 1;
4372
    Param4 = 0;
4373
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4374
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4375
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4376
    break;
4377
  case ARM::BI__builtin_arm_mve_vqrshrntq_m_n_s16:
4378
    Param0 = 1;
4379
    Param1 = 1;
4380
    Param2 = 0;
4381
    Param3 = 0;
4382
    Param4 = 1;
4383
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4384
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4385
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4386
    break;
4387
  case ARM::BI__builtin_arm_mve_vqrshrntq_m_n_s32:
4388
    Param0 = 1;
4389
    Param1 = 1;
4390
    Param2 = 0;
4391
    Param3 = 0;
4392
    Param4 = 1;
4393
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4394
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4395
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4396
    break;
4397
  case ARM::BI__builtin_arm_mve_vqrshrntq_m_n_u16:
4398
    Param0 = 1;
4399
    Param1 = 1;
4400
    Param2 = 1;
4401
    Param3 = 1;
4402
    Param4 = 1;
4403
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4404
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4405
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4406
    break;
4407
  case ARM::BI__builtin_arm_mve_vqrshrntq_m_n_u32:
4408
    Param0 = 1;
4409
    Param1 = 1;
4410
    Param2 = 1;
4411
    Param3 = 1;
4412
    Param4 = 1;
4413
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4414
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4415
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4416
    break;
4417
  case ARM::BI__builtin_arm_mve_vqrshrunbq_m_n_s16:
4418
    Param0 = 1;
4419
    Param1 = 1;
4420
    Param2 = 1;
4421
    Param3 = 0;
4422
    Param4 = 0;
4423
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4424
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4425
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4426
    break;
4427
  case ARM::BI__builtin_arm_mve_vqrshrunbq_m_n_s32:
4428
    Param0 = 1;
4429
    Param1 = 1;
4430
    Param2 = 1;
4431
    Param3 = 0;
4432
    Param4 = 0;
4433
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4434
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4435
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4436
    break;
4437
  case ARM::BI__builtin_arm_mve_vqrshruntq_m_n_s16:
4438
    Param0 = 1;
4439
    Param1 = 1;
4440
    Param2 = 1;
4441
    Param3 = 0;
4442
    Param4 = 1;
4443
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4444
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4445
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4446
    break;
4447
  case ARM::BI__builtin_arm_mve_vqrshruntq_m_n_s32:
4448
    Param0 = 1;
4449
    Param1 = 1;
4450
    Param2 = 1;
4451
    Param3 = 0;
4452
    Param4 = 1;
4453
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4454
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4455
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4456
    break;
4457
  case ARM::BI__builtin_arm_mve_vqshrnbq_m_n_s16:
4458
    Param0 = 1;
4459
    Param1 = 0;
4460
    Param2 = 0;
4461
    Param3 = 0;
4462
    Param4 = 0;
4463
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4464
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4465
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4466
    break;
4467
  case ARM::BI__builtin_arm_mve_vqshrnbq_m_n_s32:
4468
    Param0 = 1;
4469
    Param1 = 0;
4470
    Param2 = 0;
4471
    Param3 = 0;
4472
    Param4 = 0;
4473
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4474
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4475
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4476
    break;
4477
  case ARM::BI__builtin_arm_mve_vqshrnbq_m_n_u16:
4478
    Param0 = 1;
4479
    Param1 = 0;
4480
    Param2 = 1;
4481
    Param3 = 1;
4482
    Param4 = 0;
4483
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4484
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4485
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4486
    break;
4487
  case ARM::BI__builtin_arm_mve_vqshrnbq_m_n_u32:
4488
    Param0 = 1;
4489
    Param1 = 0;
4490
    Param2 = 1;
4491
    Param3 = 1;
4492
    Param4 = 0;
4493
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4494
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4495
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4496
    break;
4497
  case ARM::BI__builtin_arm_mve_vqshrntq_m_n_s16:
4498
    Param0 = 1;
4499
    Param1 = 0;
4500
    Param2 = 0;
4501
    Param3 = 0;
4502
    Param4 = 1;
4503
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4504
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4505
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4506
    break;
4507
  case ARM::BI__builtin_arm_mve_vqshrntq_m_n_s32:
4508
    Param0 = 1;
4509
    Param1 = 0;
4510
    Param2 = 0;
4511
    Param3 = 0;
4512
    Param4 = 1;
4513
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4514
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4515
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4516
    break;
4517
  case ARM::BI__builtin_arm_mve_vqshrntq_m_n_u16:
4518
    Param0 = 1;
4519
    Param1 = 0;
4520
    Param2 = 1;
4521
    Param3 = 1;
4522
    Param4 = 1;
4523
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4524
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4525
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4526
    break;
4527
  case ARM::BI__builtin_arm_mve_vqshrntq_m_n_u32:
4528
    Param0 = 1;
4529
    Param1 = 0;
4530
    Param2 = 1;
4531
    Param3 = 1;
4532
    Param4 = 1;
4533
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4534
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4535
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4536
    break;
4537
  case ARM::BI__builtin_arm_mve_vqshrunbq_m_n_s16:
4538
    Param0 = 1;
4539
    Param1 = 0;
4540
    Param2 = 1;
4541
    Param3 = 0;
4542
    Param4 = 0;
4543
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4544
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4545
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4546
    break;
4547
  case ARM::BI__builtin_arm_mve_vqshrunbq_m_n_s32:
4548
    Param0 = 1;
4549
    Param1 = 0;
4550
    Param2 = 1;
4551
    Param3 = 0;
4552
    Param4 = 0;
4553
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4554
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4555
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4556
    break;
4557
  case ARM::BI__builtin_arm_mve_vqshruntq_m_n_s16:
4558
    Param0 = 1;
4559
    Param1 = 0;
4560
    Param2 = 1;
4561
    Param3 = 0;
4562
    Param4 = 1;
4563
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4564
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4565
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4566
    break;
4567
  case ARM::BI__builtin_arm_mve_vqshruntq_m_n_s32:
4568
    Param0 = 1;
4569
    Param1 = 0;
4570
    Param2 = 1;
4571
    Param3 = 0;
4572
    Param4 = 1;
4573
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4574
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4575
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4576
    break;
4577
  case ARM::BI__builtin_arm_mve_vrshrnbq_m_n_s16:
4578
    Param0 = 0;
4579
    Param1 = 1;
4580
    Param2 = 0;
4581
    Param3 = 0;
4582
    Param4 = 0;
4583
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4584
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4585
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4586
    break;
4587
  case ARM::BI__builtin_arm_mve_vrshrnbq_m_n_s32:
4588
    Param0 = 0;
4589
    Param1 = 1;
4590
    Param2 = 0;
4591
    Param3 = 0;
4592
    Param4 = 0;
4593
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4594
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4595
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4596
    break;
4597
  case ARM::BI__builtin_arm_mve_vrshrnbq_m_n_u16:
4598
    Param0 = 0;
4599
    Param1 = 1;
4600
    Param2 = 1;
4601
    Param3 = 1;
4602
    Param4 = 0;
4603
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4604
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4605
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4606
    break;
4607
  case ARM::BI__builtin_arm_mve_vrshrnbq_m_n_u32:
4608
    Param0 = 0;
4609
    Param1 = 1;
4610
    Param2 = 1;
4611
    Param3 = 1;
4612
    Param4 = 0;
4613
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4614
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4615
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4616
    break;
4617
  case ARM::BI__builtin_arm_mve_vrshrntq_m_n_s16:
4618
    Param0 = 0;
4619
    Param1 = 1;
4620
    Param2 = 0;
4621
    Param3 = 0;
4622
    Param4 = 1;
4623
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4624
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4625
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4626
    break;
4627
  case ARM::BI__builtin_arm_mve_vrshrntq_m_n_s32:
4628
    Param0 = 0;
4629
    Param1 = 1;
4630
    Param2 = 0;
4631
    Param3 = 0;
4632
    Param4 = 1;
4633
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4634
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4635
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4636
    break;
4637
  case ARM::BI__builtin_arm_mve_vrshrntq_m_n_u16:
4638
    Param0 = 0;
4639
    Param1 = 1;
4640
    Param2 = 1;
4641
    Param3 = 1;
4642
    Param4 = 1;
4643
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4644
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4645
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4646
    break;
4647
  case ARM::BI__builtin_arm_mve_vrshrntq_m_n_u32:
4648
    Param0 = 0;
4649
    Param1 = 1;
4650
    Param2 = 1;
4651
    Param3 = 1;
4652
    Param4 = 1;
4653
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4654
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4655
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4656
    break;
4657
  case ARM::BI__builtin_arm_mve_vshrnbq_m_n_s16:
4658
    Param0 = 0;
4659
    Param1 = 0;
4660
    Param2 = 0;
4661
    Param3 = 0;
4662
    Param4 = 0;
4663
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4664
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4665
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4666
    break;
4667
  case ARM::BI__builtin_arm_mve_vshrnbq_m_n_s32:
4668
    Param0 = 0;
4669
    Param1 = 0;
4670
    Param2 = 0;
4671
    Param3 = 0;
4672
    Param4 = 0;
4673
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4674
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4675
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4676
    break;
4677
  case ARM::BI__builtin_arm_mve_vshrnbq_m_n_u16:
4678
    Param0 = 0;
4679
    Param1 = 0;
4680
    Param2 = 1;
4681
    Param3 = 1;
4682
    Param4 = 0;
4683
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4684
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4685
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4686
    break;
4687
  case ARM::BI__builtin_arm_mve_vshrnbq_m_n_u32:
4688
    Param0 = 0;
4689
    Param1 = 0;
4690
    Param2 = 1;
4691
    Param3 = 1;
4692
    Param4 = 0;
4693
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4694
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4695
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4696
    break;
4697
  case ARM::BI__builtin_arm_mve_vshrntq_m_n_s16:
4698
    Param0 = 0;
4699
    Param1 = 0;
4700
    Param2 = 0;
4701
    Param3 = 0;
4702
    Param4 = 1;
4703
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4704
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4705
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4706
    break;
4707
  case ARM::BI__builtin_arm_mve_vshrntq_m_n_s32:
4708
    Param0 = 0;
4709
    Param1 = 0;
4710
    Param2 = 0;
4711
    Param3 = 0;
4712
    Param4 = 1;
4713
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4714
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4715
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4716
    break;
4717
  case ARM::BI__builtin_arm_mve_vshrntq_m_n_u16:
4718
    Param0 = 0;
4719
    Param1 = 0;
4720
    Param2 = 1;
4721
    Param3 = 1;
4722
    Param4 = 1;
4723
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
4724
    Param6 = llvm::FixedVectorType::get(Int8Ty, 16);
4725
    Param7 = llvm::FixedVectorType::get(Int16Ty, 8);
4726
    break;
4727
  case ARM::BI__builtin_arm_mve_vshrntq_m_n_u32:
4728
    Param0 = 0;
4729
    Param1 = 0;
4730
    Param2 = 1;
4731
    Param3 = 1;
4732
    Param4 = 1;
4733
    Param5 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
4734
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4735
    Param7 = llvm::FixedVectorType::get(Int32Ty, 4);
4736
    break;
4737
  }
4738
  Value *Val0 = EmitScalarExpr(E->getArg(0));
4739
  Value *Val1 = EmitScalarExpr(E->getArg(1));
4740
  Value *Val2 = EmitScalarExpr(E->getArg(2));
4741
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
4742
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param1);
4743
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param2);
4744
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param3);
4745
  Value *Val7 = llvm::ConstantInt::get(Int32Ty, Param4);
4746
  Value *Val8 = EmitScalarExpr(E->getArg(3));
4747
  Value *Val9 = Builder.CreateIntCast(Val8, Int32Ty, false);
4748
  Value *Val10 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param5}), {Val9});
4749
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshrn_predicated, {Param6, Param7, Param5}), {Val0, Val1, Val2, Val3, Val4, Val5, Val6, Val7, Val10});
4750
}
4751
case ARM::BI__builtin_arm_mve_vqrshrnbq_n_s16:
4752
case ARM::BI__builtin_arm_mve_vqrshrnbq_n_s32:
4753
case ARM::BI__builtin_arm_mve_vqrshrnbq_n_u16:
4754
case ARM::BI__builtin_arm_mve_vqrshrnbq_n_u32:
4755
case ARM::BI__builtin_arm_mve_vqrshrntq_n_s16:
4756
case ARM::BI__builtin_arm_mve_vqrshrntq_n_s32:
4757
case ARM::BI__builtin_arm_mve_vqrshrntq_n_u16:
4758
case ARM::BI__builtin_arm_mve_vqrshrntq_n_u32:
4759
case ARM::BI__builtin_arm_mve_vqrshrunbq_n_s16:
4760
case ARM::BI__builtin_arm_mve_vqrshrunbq_n_s32:
4761
case ARM::BI__builtin_arm_mve_vqrshruntq_n_s16:
4762
case ARM::BI__builtin_arm_mve_vqrshruntq_n_s32:
4763
case ARM::BI__builtin_arm_mve_vqshrnbq_n_s16:
4764
case ARM::BI__builtin_arm_mve_vqshrnbq_n_s32:
4765
case ARM::BI__builtin_arm_mve_vqshrnbq_n_u16:
4766
case ARM::BI__builtin_arm_mve_vqshrnbq_n_u32:
4767
case ARM::BI__builtin_arm_mve_vqshrntq_n_s16:
4768
case ARM::BI__builtin_arm_mve_vqshrntq_n_s32:
4769
case ARM::BI__builtin_arm_mve_vqshrntq_n_u16:
4770
case ARM::BI__builtin_arm_mve_vqshrntq_n_u32:
4771
case ARM::BI__builtin_arm_mve_vqshrunbq_n_s16:
4772
case ARM::BI__builtin_arm_mve_vqshrunbq_n_s32:
4773
case ARM::BI__builtin_arm_mve_vqshruntq_n_s16:
4774
case ARM::BI__builtin_arm_mve_vqshruntq_n_s32:
4775
case ARM::BI__builtin_arm_mve_vrshrnbq_n_s16:
4776
case ARM::BI__builtin_arm_mve_vrshrnbq_n_s32:
4777
case ARM::BI__builtin_arm_mve_vrshrnbq_n_u16:
4778
case ARM::BI__builtin_arm_mve_vrshrnbq_n_u32:
4779
case ARM::BI__builtin_arm_mve_vrshrntq_n_s16:
4780
case ARM::BI__builtin_arm_mve_vrshrntq_n_s32:
4781
case ARM::BI__builtin_arm_mve_vrshrntq_n_u16:
4782
case ARM::BI__builtin_arm_mve_vrshrntq_n_u32:
4783
case ARM::BI__builtin_arm_mve_vshrnbq_n_s16:
4784
case ARM::BI__builtin_arm_mve_vshrnbq_n_s32:
4785
case ARM::BI__builtin_arm_mve_vshrnbq_n_u16:
4786
case ARM::BI__builtin_arm_mve_vshrnbq_n_u32:
4787
case ARM::BI__builtin_arm_mve_vshrntq_n_s16:
4788
case ARM::BI__builtin_arm_mve_vshrntq_n_s32:
4789
case ARM::BI__builtin_arm_mve_vshrntq_n_u16:
4790
case ARM::BI__builtin_arm_mve_vshrntq_n_u32: {
4791
  uint32_t  Param0;
4792
  uint32_t  Param1;
4793
  uint32_t  Param2;
4794
  uint32_t  Param3;
4795
  uint32_t  Param4;
4796
  llvm::Type * Param5;
4797
  llvm::Type * Param6;
4798
  switch (BuiltinID) {
4799
  case ARM::BI__builtin_arm_mve_vqrshrnbq_n_s16:
4800
    Param0 = 1;
4801
    Param1 = 1;
4802
    Param2 = 0;
4803
    Param3 = 0;
4804
    Param4 = 0;
4805
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4806
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4807
    break;
4808
  case ARM::BI__builtin_arm_mve_vqrshrnbq_n_s32:
4809
    Param0 = 1;
4810
    Param1 = 1;
4811
    Param2 = 0;
4812
    Param3 = 0;
4813
    Param4 = 0;
4814
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4815
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4816
    break;
4817
  case ARM::BI__builtin_arm_mve_vqrshrnbq_n_u16:
4818
    Param0 = 1;
4819
    Param1 = 1;
4820
    Param2 = 1;
4821
    Param3 = 1;
4822
    Param4 = 0;
4823
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4824
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4825
    break;
4826
  case ARM::BI__builtin_arm_mve_vqrshrnbq_n_u32:
4827
    Param0 = 1;
4828
    Param1 = 1;
4829
    Param2 = 1;
4830
    Param3 = 1;
4831
    Param4 = 0;
4832
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4833
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4834
    break;
4835
  case ARM::BI__builtin_arm_mve_vqrshrntq_n_s16:
4836
    Param0 = 1;
4837
    Param1 = 1;
4838
    Param2 = 0;
4839
    Param3 = 0;
4840
    Param4 = 1;
4841
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4842
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4843
    break;
4844
  case ARM::BI__builtin_arm_mve_vqrshrntq_n_s32:
4845
    Param0 = 1;
4846
    Param1 = 1;
4847
    Param2 = 0;
4848
    Param3 = 0;
4849
    Param4 = 1;
4850
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4851
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4852
    break;
4853
  case ARM::BI__builtin_arm_mve_vqrshrntq_n_u16:
4854
    Param0 = 1;
4855
    Param1 = 1;
4856
    Param2 = 1;
4857
    Param3 = 1;
4858
    Param4 = 1;
4859
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4860
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4861
    break;
4862
  case ARM::BI__builtin_arm_mve_vqrshrntq_n_u32:
4863
    Param0 = 1;
4864
    Param1 = 1;
4865
    Param2 = 1;
4866
    Param3 = 1;
4867
    Param4 = 1;
4868
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4869
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4870
    break;
4871
  case ARM::BI__builtin_arm_mve_vqrshrunbq_n_s16:
4872
    Param0 = 1;
4873
    Param1 = 1;
4874
    Param2 = 1;
4875
    Param3 = 0;
4876
    Param4 = 0;
4877
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4878
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4879
    break;
4880
  case ARM::BI__builtin_arm_mve_vqrshrunbq_n_s32:
4881
    Param0 = 1;
4882
    Param1 = 1;
4883
    Param2 = 1;
4884
    Param3 = 0;
4885
    Param4 = 0;
4886
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4887
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4888
    break;
4889
  case ARM::BI__builtin_arm_mve_vqrshruntq_n_s16:
4890
    Param0 = 1;
4891
    Param1 = 1;
4892
    Param2 = 1;
4893
    Param3 = 0;
4894
    Param4 = 1;
4895
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4896
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4897
    break;
4898
  case ARM::BI__builtin_arm_mve_vqrshruntq_n_s32:
4899
    Param0 = 1;
4900
    Param1 = 1;
4901
    Param2 = 1;
4902
    Param3 = 0;
4903
    Param4 = 1;
4904
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4905
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4906
    break;
4907
  case ARM::BI__builtin_arm_mve_vqshrnbq_n_s16:
4908
    Param0 = 1;
4909
    Param1 = 0;
4910
    Param2 = 0;
4911
    Param3 = 0;
4912
    Param4 = 0;
4913
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4914
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4915
    break;
4916
  case ARM::BI__builtin_arm_mve_vqshrnbq_n_s32:
4917
    Param0 = 1;
4918
    Param1 = 0;
4919
    Param2 = 0;
4920
    Param3 = 0;
4921
    Param4 = 0;
4922
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4923
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4924
    break;
4925
  case ARM::BI__builtin_arm_mve_vqshrnbq_n_u16:
4926
    Param0 = 1;
4927
    Param1 = 0;
4928
    Param2 = 1;
4929
    Param3 = 1;
4930
    Param4 = 0;
4931
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4932
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4933
    break;
4934
  case ARM::BI__builtin_arm_mve_vqshrnbq_n_u32:
4935
    Param0 = 1;
4936
    Param1 = 0;
4937
    Param2 = 1;
4938
    Param3 = 1;
4939
    Param4 = 0;
4940
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4941
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4942
    break;
4943
  case ARM::BI__builtin_arm_mve_vqshrntq_n_s16:
4944
    Param0 = 1;
4945
    Param1 = 0;
4946
    Param2 = 0;
4947
    Param3 = 0;
4948
    Param4 = 1;
4949
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4950
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4951
    break;
4952
  case ARM::BI__builtin_arm_mve_vqshrntq_n_s32:
4953
    Param0 = 1;
4954
    Param1 = 0;
4955
    Param2 = 0;
4956
    Param3 = 0;
4957
    Param4 = 1;
4958
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4959
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4960
    break;
4961
  case ARM::BI__builtin_arm_mve_vqshrntq_n_u16:
4962
    Param0 = 1;
4963
    Param1 = 0;
4964
    Param2 = 1;
4965
    Param3 = 1;
4966
    Param4 = 1;
4967
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4968
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4969
    break;
4970
  case ARM::BI__builtin_arm_mve_vqshrntq_n_u32:
4971
    Param0 = 1;
4972
    Param1 = 0;
4973
    Param2 = 1;
4974
    Param3 = 1;
4975
    Param4 = 1;
4976
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4977
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4978
    break;
4979
  case ARM::BI__builtin_arm_mve_vqshrunbq_n_s16:
4980
    Param0 = 1;
4981
    Param1 = 0;
4982
    Param2 = 1;
4983
    Param3 = 0;
4984
    Param4 = 0;
4985
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
4986
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
4987
    break;
4988
  case ARM::BI__builtin_arm_mve_vqshrunbq_n_s32:
4989
    Param0 = 1;
4990
    Param1 = 0;
4991
    Param2 = 1;
4992
    Param3 = 0;
4993
    Param4 = 0;
4994
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
4995
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
4996
    break;
4997
  case ARM::BI__builtin_arm_mve_vqshruntq_n_s16:
4998
    Param0 = 1;
4999
    Param1 = 0;
5000
    Param2 = 1;
5001
    Param3 = 0;
5002
    Param4 = 1;
5003
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5004
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5005
    break;
5006
  case ARM::BI__builtin_arm_mve_vqshruntq_n_s32:
5007
    Param0 = 1;
5008
    Param1 = 0;
5009
    Param2 = 1;
5010
    Param3 = 0;
5011
    Param4 = 1;
5012
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5013
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5014
    break;
5015
  case ARM::BI__builtin_arm_mve_vrshrnbq_n_s16:
5016
    Param0 = 0;
5017
    Param1 = 1;
5018
    Param2 = 0;
5019
    Param3 = 0;
5020
    Param4 = 0;
5021
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5022
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5023
    break;
5024
  case ARM::BI__builtin_arm_mve_vrshrnbq_n_s32:
5025
    Param0 = 0;
5026
    Param1 = 1;
5027
    Param2 = 0;
5028
    Param3 = 0;
5029
    Param4 = 0;
5030
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5031
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5032
    break;
5033
  case ARM::BI__builtin_arm_mve_vrshrnbq_n_u16:
5034
    Param0 = 0;
5035
    Param1 = 1;
5036
    Param2 = 1;
5037
    Param3 = 1;
5038
    Param4 = 0;
5039
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5040
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5041
    break;
5042
  case ARM::BI__builtin_arm_mve_vrshrnbq_n_u32:
5043
    Param0 = 0;
5044
    Param1 = 1;
5045
    Param2 = 1;
5046
    Param3 = 1;
5047
    Param4 = 0;
5048
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5049
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5050
    break;
5051
  case ARM::BI__builtin_arm_mve_vrshrntq_n_s16:
5052
    Param0 = 0;
5053
    Param1 = 1;
5054
    Param2 = 0;
5055
    Param3 = 0;
5056
    Param4 = 1;
5057
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5058
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5059
    break;
5060
  case ARM::BI__builtin_arm_mve_vrshrntq_n_s32:
5061
    Param0 = 0;
5062
    Param1 = 1;
5063
    Param2 = 0;
5064
    Param3 = 0;
5065
    Param4 = 1;
5066
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5067
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5068
    break;
5069
  case ARM::BI__builtin_arm_mve_vrshrntq_n_u16:
5070
    Param0 = 0;
5071
    Param1 = 1;
5072
    Param2 = 1;
5073
    Param3 = 1;
5074
    Param4 = 1;
5075
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5076
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5077
    break;
5078
  case ARM::BI__builtin_arm_mve_vrshrntq_n_u32:
5079
    Param0 = 0;
5080
    Param1 = 1;
5081
    Param2 = 1;
5082
    Param3 = 1;
5083
    Param4 = 1;
5084
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5085
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5086
    break;
5087
  case ARM::BI__builtin_arm_mve_vshrnbq_n_s16:
5088
    Param0 = 0;
5089
    Param1 = 0;
5090
    Param2 = 0;
5091
    Param3 = 0;
5092
    Param4 = 0;
5093
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5094
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5095
    break;
5096
  case ARM::BI__builtin_arm_mve_vshrnbq_n_s32:
5097
    Param0 = 0;
5098
    Param1 = 0;
5099
    Param2 = 0;
5100
    Param3 = 0;
5101
    Param4 = 0;
5102
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5103
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5104
    break;
5105
  case ARM::BI__builtin_arm_mve_vshrnbq_n_u16:
5106
    Param0 = 0;
5107
    Param1 = 0;
5108
    Param2 = 1;
5109
    Param3 = 1;
5110
    Param4 = 0;
5111
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5112
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5113
    break;
5114
  case ARM::BI__builtin_arm_mve_vshrnbq_n_u32:
5115
    Param0 = 0;
5116
    Param1 = 0;
5117
    Param2 = 1;
5118
    Param3 = 1;
5119
    Param4 = 0;
5120
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5121
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5122
    break;
5123
  case ARM::BI__builtin_arm_mve_vshrntq_n_s16:
5124
    Param0 = 0;
5125
    Param1 = 0;
5126
    Param2 = 0;
5127
    Param3 = 0;
5128
    Param4 = 1;
5129
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5130
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5131
    break;
5132
  case ARM::BI__builtin_arm_mve_vshrntq_n_s32:
5133
    Param0 = 0;
5134
    Param1 = 0;
5135
    Param2 = 0;
5136
    Param3 = 0;
5137
    Param4 = 1;
5138
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5139
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5140
    break;
5141
  case ARM::BI__builtin_arm_mve_vshrntq_n_u16:
5142
    Param0 = 0;
5143
    Param1 = 0;
5144
    Param2 = 1;
5145
    Param3 = 1;
5146
    Param4 = 1;
5147
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
5148
    Param6 = llvm::FixedVectorType::get(Int16Ty, 8);
5149
    break;
5150
  case ARM::BI__builtin_arm_mve_vshrntq_n_u32:
5151
    Param0 = 0;
5152
    Param1 = 0;
5153
    Param2 = 1;
5154
    Param3 = 1;
5155
    Param4 = 1;
5156
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5157
    Param6 = llvm::FixedVectorType::get(Int32Ty, 4);
5158
    break;
5159
  }
5160
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5161
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5162
  Value *Val2 = EmitScalarExpr(E->getArg(2));
5163
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
5164
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param1);
5165
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param2);
5166
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param3);
5167
  Value *Val7 = llvm::ConstantInt::get(Int32Ty, Param4);
5168
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshrn, {Param5, Param6}), {Val0, Val1, Val2, Val3, Val4, Val5, Val6, Val7});
5169
}
5170
case ARM::BI__builtin_arm_mve_vqdmladhq_s16:
5171
case ARM::BI__builtin_arm_mve_vqdmladhq_s32:
5172
case ARM::BI__builtin_arm_mve_vqdmladhq_s8:
5173
case ARM::BI__builtin_arm_mve_vqdmladhxq_s16:
5174
case ARM::BI__builtin_arm_mve_vqdmladhxq_s32:
5175
case ARM::BI__builtin_arm_mve_vqdmladhxq_s8:
5176
case ARM::BI__builtin_arm_mve_vqdmlsdhq_s16:
5177
case ARM::BI__builtin_arm_mve_vqdmlsdhq_s32:
5178
case ARM::BI__builtin_arm_mve_vqdmlsdhq_s8:
5179
case ARM::BI__builtin_arm_mve_vqdmlsdhxq_s16:
5180
case ARM::BI__builtin_arm_mve_vqdmlsdhxq_s32:
5181
case ARM::BI__builtin_arm_mve_vqdmlsdhxq_s8:
5182
case ARM::BI__builtin_arm_mve_vqrdmladhq_s16:
5183
case ARM::BI__builtin_arm_mve_vqrdmladhq_s32:
5184
case ARM::BI__builtin_arm_mve_vqrdmladhq_s8:
5185
case ARM::BI__builtin_arm_mve_vqrdmladhxq_s16:
5186
case ARM::BI__builtin_arm_mve_vqrdmladhxq_s32:
5187
case ARM::BI__builtin_arm_mve_vqrdmladhxq_s8:
5188
case ARM::BI__builtin_arm_mve_vqrdmlsdhq_s16:
5189
case ARM::BI__builtin_arm_mve_vqrdmlsdhq_s32:
5190
case ARM::BI__builtin_arm_mve_vqrdmlsdhq_s8:
5191
case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_s16:
5192
case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_s32:
5193
case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_s8: {
5194
  uint32_t  Param0;
5195
  uint32_t  Param1;
5196
  uint32_t  Param2;
5197
  llvm::Type * Param3;
5198
  switch (BuiltinID) {
5199
  case ARM::BI__builtin_arm_mve_vqdmladhq_s16:
5200
    Param0 = 0;
5201
    Param1 = 0;
5202
    Param2 = 0;
5203
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5204
    break;
5205
  case ARM::BI__builtin_arm_mve_vqdmladhq_s32:
5206
    Param0 = 0;
5207
    Param1 = 0;
5208
    Param2 = 0;
5209
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5210
    break;
5211
  case ARM::BI__builtin_arm_mve_vqdmladhq_s8:
5212
    Param0 = 0;
5213
    Param1 = 0;
5214
    Param2 = 0;
5215
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
5216
    break;
5217
  case ARM::BI__builtin_arm_mve_vqdmladhxq_s16:
5218
    Param0 = 1;
5219
    Param1 = 0;
5220
    Param2 = 0;
5221
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5222
    break;
5223
  case ARM::BI__builtin_arm_mve_vqdmladhxq_s32:
5224
    Param0 = 1;
5225
    Param1 = 0;
5226
    Param2 = 0;
5227
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5228
    break;
5229
  case ARM::BI__builtin_arm_mve_vqdmladhxq_s8:
5230
    Param0 = 1;
5231
    Param1 = 0;
5232
    Param2 = 0;
5233
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
5234
    break;
5235
  case ARM::BI__builtin_arm_mve_vqdmlsdhq_s16:
5236
    Param0 = 0;
5237
    Param1 = 0;
5238
    Param2 = 1;
5239
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5240
    break;
5241
  case ARM::BI__builtin_arm_mve_vqdmlsdhq_s32:
5242
    Param0 = 0;
5243
    Param1 = 0;
5244
    Param2 = 1;
5245
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5246
    break;
5247
  case ARM::BI__builtin_arm_mve_vqdmlsdhq_s8:
5248
    Param0 = 0;
5249
    Param1 = 0;
5250
    Param2 = 1;
5251
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
5252
    break;
5253
  case ARM::BI__builtin_arm_mve_vqdmlsdhxq_s16:
5254
    Param0 = 1;
5255
    Param1 = 0;
5256
    Param2 = 1;
5257
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5258
    break;
5259
  case ARM::BI__builtin_arm_mve_vqdmlsdhxq_s32:
5260
    Param0 = 1;
5261
    Param1 = 0;
5262
    Param2 = 1;
5263
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5264
    break;
5265
  case ARM::BI__builtin_arm_mve_vqdmlsdhxq_s8:
5266
    Param0 = 1;
5267
    Param1 = 0;
5268
    Param2 = 1;
5269
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
5270
    break;
5271
  case ARM::BI__builtin_arm_mve_vqrdmladhq_s16:
5272
    Param0 = 0;
5273
    Param1 = 1;
5274
    Param2 = 0;
5275
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5276
    break;
5277
  case ARM::BI__builtin_arm_mve_vqrdmladhq_s32:
5278
    Param0 = 0;
5279
    Param1 = 1;
5280
    Param2 = 0;
5281
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5282
    break;
5283
  case ARM::BI__builtin_arm_mve_vqrdmladhq_s8:
5284
    Param0 = 0;
5285
    Param1 = 1;
5286
    Param2 = 0;
5287
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
5288
    break;
5289
  case ARM::BI__builtin_arm_mve_vqrdmladhxq_s16:
5290
    Param0 = 1;
5291
    Param1 = 1;
5292
    Param2 = 0;
5293
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5294
    break;
5295
  case ARM::BI__builtin_arm_mve_vqrdmladhxq_s32:
5296
    Param0 = 1;
5297
    Param1 = 1;
5298
    Param2 = 0;
5299
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5300
    break;
5301
  case ARM::BI__builtin_arm_mve_vqrdmladhxq_s8:
5302
    Param0 = 1;
5303
    Param1 = 1;
5304
    Param2 = 0;
5305
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
5306
    break;
5307
  case ARM::BI__builtin_arm_mve_vqrdmlsdhq_s16:
5308
    Param0 = 0;
5309
    Param1 = 1;
5310
    Param2 = 1;
5311
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5312
    break;
5313
  case ARM::BI__builtin_arm_mve_vqrdmlsdhq_s32:
5314
    Param0 = 0;
5315
    Param1 = 1;
5316
    Param2 = 1;
5317
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5318
    break;
5319
  case ARM::BI__builtin_arm_mve_vqrdmlsdhq_s8:
5320
    Param0 = 0;
5321
    Param1 = 1;
5322
    Param2 = 1;
5323
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
5324
    break;
5325
  case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_s16:
5326
    Param0 = 1;
5327
    Param1 = 1;
5328
    Param2 = 1;
5329
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5330
    break;
5331
  case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_s32:
5332
    Param0 = 1;
5333
    Param1 = 1;
5334
    Param2 = 1;
5335
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5336
    break;
5337
  case ARM::BI__builtin_arm_mve_vqrdmlsdhxq_s8:
5338
    Param0 = 1;
5339
    Param1 = 1;
5340
    Param2 = 1;
5341
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
5342
    break;
5343
  }
5344
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5345
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5346
  Value *Val2 = EmitScalarExpr(E->getArg(2));
5347
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
5348
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param1);
5349
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param2);
5350
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vqdmlad, {Param3}), {Val0, Val1, Val2, Val3, Val4, Val5});
5351
}
5352
case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_s64:
5353
case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_u64:
5354
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_f32:
5355
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_s32:
5356
case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_u32: {
5357
  llvm::Type * Param0;
5358
  llvm::Type * Param1;
5359
  switch (BuiltinID) {
5360
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_s64:
5361
    Param0 = llvm::FixedVectorType::get(Int64Ty, 2);
5362
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
5363
    break;
5364
  case ARM::BI__builtin_arm_mve_vstrdq_scatter_base_u64:
5365
    Param0 = llvm::FixedVectorType::get(Int64Ty, 2);
5366
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
5367
    break;
5368
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_f32:
5369
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
5370
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
5371
    break;
5372
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_s32:
5373
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
5374
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5375
    break;
5376
  case ARM::BI__builtin_arm_mve_vstrwq_scatter_base_u32:
5377
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
5378
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5379
    break;
5380
  }
5381
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5382
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5383
  Value *Val2 = EmitScalarExpr(E->getArg(2));
5384
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vstr_scatter_base, {Param0, Param1}), {Val0, Val1, Val2});
5385
}
5386
case ARM::BI__builtin_arm_mve_vqdmlahq_n_s32:
5387
case ARM::BI__builtin_arm_mve_vqdmlashq_n_s32:
5388
case ARM::BI__builtin_arm_mve_vqrdmlahq_n_s32:
5389
case ARM::BI__builtin_arm_mve_vqrdmlashq_n_s32:
5390
case ARM::BI__builtin_arm_mve_vsliq_n_s16:
5391
case ARM::BI__builtin_arm_mve_vsliq_n_s32:
5392
case ARM::BI__builtin_arm_mve_vsliq_n_s8:
5393
case ARM::BI__builtin_arm_mve_vsliq_n_u16:
5394
case ARM::BI__builtin_arm_mve_vsliq_n_u32:
5395
case ARM::BI__builtin_arm_mve_vsliq_n_u8:
5396
case ARM::BI__builtin_arm_mve_vsriq_n_s16:
5397
case ARM::BI__builtin_arm_mve_vsriq_n_s32:
5398
case ARM::BI__builtin_arm_mve_vsriq_n_s8:
5399
case ARM::BI__builtin_arm_mve_vsriq_n_u16:
5400
case ARM::BI__builtin_arm_mve_vsriq_n_u32:
5401
case ARM::BI__builtin_arm_mve_vsriq_n_u8: {
5402
  Intrinsic::ID  Param0;
5403
  llvm::Type * Param1;
5404
  switch (BuiltinID) {
5405
  case ARM::BI__builtin_arm_mve_vqdmlahq_n_s32:
5406
    Param0 = Intrinsic::arm_mve_vqdmlah;
5407
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5408
    break;
5409
  case ARM::BI__builtin_arm_mve_vqdmlashq_n_s32:
5410
    Param0 = Intrinsic::arm_mve_vqdmlash;
5411
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5412
    break;
5413
  case ARM::BI__builtin_arm_mve_vqrdmlahq_n_s32:
5414
    Param0 = Intrinsic::arm_mve_vqrdmlah;
5415
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5416
    break;
5417
  case ARM::BI__builtin_arm_mve_vqrdmlashq_n_s32:
5418
    Param0 = Intrinsic::arm_mve_vqrdmlash;
5419
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5420
    break;
5421
  case ARM::BI__builtin_arm_mve_vsliq_n_s16:
5422
    Param0 = Intrinsic::arm_mve_vsli;
5423
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
5424
    break;
5425
  case ARM::BI__builtin_arm_mve_vsliq_n_s32:
5426
    Param0 = Intrinsic::arm_mve_vsli;
5427
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5428
    break;
5429
  case ARM::BI__builtin_arm_mve_vsliq_n_s8:
5430
    Param0 = Intrinsic::arm_mve_vsli;
5431
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
5432
    break;
5433
  case ARM::BI__builtin_arm_mve_vsliq_n_u16:
5434
    Param0 = Intrinsic::arm_mve_vsli;
5435
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
5436
    break;
5437
  case ARM::BI__builtin_arm_mve_vsliq_n_u32:
5438
    Param0 = Intrinsic::arm_mve_vsli;
5439
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5440
    break;
5441
  case ARM::BI__builtin_arm_mve_vsliq_n_u8:
5442
    Param0 = Intrinsic::arm_mve_vsli;
5443
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
5444
    break;
5445
  case ARM::BI__builtin_arm_mve_vsriq_n_s16:
5446
    Param0 = Intrinsic::arm_mve_vsri;
5447
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
5448
    break;
5449
  case ARM::BI__builtin_arm_mve_vsriq_n_s32:
5450
    Param0 = Intrinsic::arm_mve_vsri;
5451
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5452
    break;
5453
  case ARM::BI__builtin_arm_mve_vsriq_n_s8:
5454
    Param0 = Intrinsic::arm_mve_vsri;
5455
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
5456
    break;
5457
  case ARM::BI__builtin_arm_mve_vsriq_n_u16:
5458
    Param0 = Intrinsic::arm_mve_vsri;
5459
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
5460
    break;
5461
  case ARM::BI__builtin_arm_mve_vsriq_n_u32:
5462
    Param0 = Intrinsic::arm_mve_vsri;
5463
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
5464
    break;
5465
  case ARM::BI__builtin_arm_mve_vsriq_n_u8:
5466
    Param0 = Intrinsic::arm_mve_vsri;
5467
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
5468
    break;
5469
  }
5470
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5471
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5472
  Value *Val2 = EmitScalarExpr(E->getArg(2));
5473
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val0, Val1, Val2});
5474
}
5475
case ARM::BI__builtin_arm_mve_vadciq_s32:
5476
case ARM::BI__builtin_arm_mve_vadciq_u32:
5477
case ARM::BI__builtin_arm_mve_vsbciq_s32:
5478
case ARM::BI__builtin_arm_mve_vsbciq_u32: {
5479
  Intrinsic::ID  Param0;
5480
  switch (BuiltinID) {
5481
  case ARM::BI__builtin_arm_mve_vadciq_s32:
5482
    Param0 = Intrinsic::arm_mve_vadc;
5483
    break;
5484
  case ARM::BI__builtin_arm_mve_vadciq_u32:
5485
    Param0 = Intrinsic::arm_mve_vadc;
5486
    break;
5487
  case ARM::BI__builtin_arm_mve_vsbciq_s32:
5488
    Param0 = Intrinsic::arm_mve_vsbc;
5489
    break;
5490
  case ARM::BI__builtin_arm_mve_vsbciq_u32:
5491
    Param0 = Intrinsic::arm_mve_vsbc;
5492
    break;
5493
  }
5494
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5495
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5496
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 0);
5497
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4)}), {Val0, Val1, Val2});
5498
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, 1);
5499
  Value *Val5 = Builder.CreateExtractValue(Val3, static_cast<unsigned>(1));
5500
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, 29);
5501
  Value *Val7 = Builder.CreateLShr(Val5, Val6);
5502
  Value *Val8 = Builder.CreateAnd(Val4, Val7);
5503
  Address Val9 = EmitPointerWithAlignment(E->getArg(2));
5504
  Builder.CreateStore(Val8, Val9);
5505
  return Builder.CreateExtractValue(Val3, static_cast<unsigned>(0));
5506
}
5507
case ARM::BI__builtin_arm_mve_vmaxvq_s32:
5508
case ARM::BI__builtin_arm_mve_vmaxvq_u32:
5509
case ARM::BI__builtin_arm_mve_vminvq_s32:
5510
case ARM::BI__builtin_arm_mve_vminvq_u32: {
5511
  uint32_t  Param0;
5512
  Intrinsic::ID  Param1;
5513
  bool  Param2;
5514
  switch (BuiltinID) {
5515
  case ARM::BI__builtin_arm_mve_vmaxvq_s32:
5516
    Param0 = 0;
5517
    Param1 = Intrinsic::arm_mve_maxv;
5518
    Param2 = true;
5519
    break;
5520
  case ARM::BI__builtin_arm_mve_vmaxvq_u32:
5521
    Param0 = 1;
5522
    Param1 = Intrinsic::arm_mve_maxv;
5523
    Param2 = false;
5524
    break;
5525
  case ARM::BI__builtin_arm_mve_vminvq_s32:
5526
    Param0 = 0;
5527
    Param1 = Intrinsic::arm_mve_minv;
5528
    Param2 = true;
5529
    break;
5530
  case ARM::BI__builtin_arm_mve_vminvq_u32:
5531
    Param0 = 1;
5532
    Param1 = Intrinsic::arm_mve_minv;
5533
    Param2 = false;
5534
    break;
5535
  }
5536
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5537
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5538
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
5539
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int32Ty, 4)}), {Val0, Val1, Val2});
5540
  return Builder.CreateIntCast(Val3, Int32Ty, Param2);
5541
}
5542
case ARM::BI__builtin_arm_mve_vmovnbq_m_s16:
5543
case ARM::BI__builtin_arm_mve_vmovnbq_m_s32:
5544
case ARM::BI__builtin_arm_mve_vmovnbq_m_u16:
5545
case ARM::BI__builtin_arm_mve_vmovnbq_m_u32:
5546
case ARM::BI__builtin_arm_mve_vmovntq_m_s16:
5547
case ARM::BI__builtin_arm_mve_vmovntq_m_s32:
5548
case ARM::BI__builtin_arm_mve_vmovntq_m_u16:
5549
case ARM::BI__builtin_arm_mve_vmovntq_m_u32: {
5550
  uint32_t  Param0;
5551
  llvm::Type * Param1;
5552
  llvm::Type * Param2;
5553
  llvm::Type * Param3;
5554
  switch (BuiltinID) {
5555
  case ARM::BI__builtin_arm_mve_vmovnbq_m_s16:
5556
    Param0 = 0;
5557
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5558
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
5559
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5560
    break;
5561
  case ARM::BI__builtin_arm_mve_vmovnbq_m_s32:
5562
    Param0 = 0;
5563
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5564
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
5565
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5566
    break;
5567
  case ARM::BI__builtin_arm_mve_vmovnbq_m_u16:
5568
    Param0 = 0;
5569
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5570
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
5571
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5572
    break;
5573
  case ARM::BI__builtin_arm_mve_vmovnbq_m_u32:
5574
    Param0 = 0;
5575
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5576
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
5577
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5578
    break;
5579
  case ARM::BI__builtin_arm_mve_vmovntq_m_s16:
5580
    Param0 = 1;
5581
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5582
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
5583
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5584
    break;
5585
  case ARM::BI__builtin_arm_mve_vmovntq_m_s32:
5586
    Param0 = 1;
5587
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5588
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
5589
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5590
    break;
5591
  case ARM::BI__builtin_arm_mve_vmovntq_m_u16:
5592
    Param0 = 1;
5593
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5594
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
5595
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
5596
    break;
5597
  case ARM::BI__builtin_arm_mve_vmovntq_m_u32:
5598
    Param0 = 1;
5599
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5600
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
5601
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
5602
    break;
5603
  }
5604
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5605
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5606
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
5607
  Value *Val3 = EmitScalarExpr(E->getArg(2));
5608
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
5609
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val4});
5610
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vmovn_predicated, {Param2, Param3, Param1}), {Val0, Val1, Val2, Val5});
5611
}
5612
case ARM::BI__builtin_arm_mve_vmaxvq_p_s32:
5613
case ARM::BI__builtin_arm_mve_vmaxvq_p_u32:
5614
case ARM::BI__builtin_arm_mve_vminvq_p_s32:
5615
case ARM::BI__builtin_arm_mve_vminvq_p_u32: {
5616
  uint32_t  Param0;
5617
  Intrinsic::ID  Param1;
5618
  bool  Param2;
5619
  switch (BuiltinID) {
5620
  case ARM::BI__builtin_arm_mve_vmaxvq_p_s32:
5621
    Param0 = 0;
5622
    Param1 = Intrinsic::arm_mve_maxv_predicated;
5623
    Param2 = true;
5624
    break;
5625
  case ARM::BI__builtin_arm_mve_vmaxvq_p_u32:
5626
    Param0 = 1;
5627
    Param1 = Intrinsic::arm_mve_maxv_predicated;
5628
    Param2 = false;
5629
    break;
5630
  case ARM::BI__builtin_arm_mve_vminvq_p_s32:
5631
    Param0 = 0;
5632
    Param1 = Intrinsic::arm_mve_minv_predicated;
5633
    Param2 = true;
5634
    break;
5635
  case ARM::BI__builtin_arm_mve_vminvq_p_u32:
5636
    Param0 = 1;
5637
    Param1 = Intrinsic::arm_mve_minv_predicated;
5638
    Param2 = false;
5639
    break;
5640
  }
5641
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5642
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5643
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
5644
  Value *Val3 = EmitScalarExpr(E->getArg(2));
5645
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
5646
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4});
5647
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val0, Val1, Val2, Val5});
5648
  return Builder.CreateIntCast(Val6, Int32Ty, Param2);
5649
}
5650
case ARM::BI__builtin_arm_mve_vcvtbq_m_f16_f32:
5651
case ARM::BI__builtin_arm_mve_vcvtbq_m_f32_f16:
5652
case ARM::BI__builtin_arm_mve_vcvttq_m_f16_f32:
5653
case ARM::BI__builtin_arm_mve_vcvttq_m_f32_f16: {
5654
  uint32_t  Param0;
5655
  Intrinsic::ID  Param1;
5656
  switch (BuiltinID) {
5657
  case ARM::BI__builtin_arm_mve_vcvtbq_m_f16_f32:
5658
    Param0 = 0;
5659
    Param1 = Intrinsic::arm_mve_vcvt_narrow_predicated;
5660
    break;
5661
  case ARM::BI__builtin_arm_mve_vcvtbq_m_f32_f16:
5662
    Param0 = 0;
5663
    Param1 = Intrinsic::arm_mve_vcvt_widen_predicated;
5664
    break;
5665
  case ARM::BI__builtin_arm_mve_vcvttq_m_f16_f32:
5666
    Param0 = 1;
5667
    Param1 = Intrinsic::arm_mve_vcvt_narrow_predicated;
5668
    break;
5669
  case ARM::BI__builtin_arm_mve_vcvttq_m_f32_f16:
5670
    Param0 = 1;
5671
    Param1 = Intrinsic::arm_mve_vcvt_widen_predicated;
5672
    break;
5673
  }
5674
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5675
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5676
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
5677
  Value *Val3 = EmitScalarExpr(E->getArg(2));
5678
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
5679
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4});
5680
  return Builder.CreateCall(CGM.getIntrinsic(Param1), {Val0, Val1, Val2, Val5});
5681
}
5682
case ARM::BI__builtin_arm_mve_vqmovnbq_m_s16:
5683
case ARM::BI__builtin_arm_mve_vqmovnbq_m_s32:
5684
case ARM::BI__builtin_arm_mve_vqmovnbq_m_u16:
5685
case ARM::BI__builtin_arm_mve_vqmovnbq_m_u32:
5686
case ARM::BI__builtin_arm_mve_vqmovntq_m_s16:
5687
case ARM::BI__builtin_arm_mve_vqmovntq_m_s32:
5688
case ARM::BI__builtin_arm_mve_vqmovntq_m_u16:
5689
case ARM::BI__builtin_arm_mve_vqmovntq_m_u32:
5690
case ARM::BI__builtin_arm_mve_vqmovunbq_m_s16:
5691
case ARM::BI__builtin_arm_mve_vqmovunbq_m_s32:
5692
case ARM::BI__builtin_arm_mve_vqmovuntq_m_s16:
5693
case ARM::BI__builtin_arm_mve_vqmovuntq_m_s32: {
5694
  uint32_t  Param0;
5695
  uint32_t  Param1;
5696
  uint32_t  Param2;
5697
  llvm::Type * Param3;
5698
  llvm::Type * Param4;
5699
  llvm::Type * Param5;
5700
  switch (BuiltinID) {
5701
  case ARM::BI__builtin_arm_mve_vqmovnbq_m_s16:
5702
    Param0 = 0;
5703
    Param1 = 0;
5704
    Param2 = 0;
5705
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5706
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5707
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5708
    break;
5709
  case ARM::BI__builtin_arm_mve_vqmovnbq_m_s32:
5710
    Param0 = 0;
5711
    Param1 = 0;
5712
    Param2 = 0;
5713
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5714
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5715
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
5716
    break;
5717
  case ARM::BI__builtin_arm_mve_vqmovnbq_m_u16:
5718
    Param0 = 1;
5719
    Param1 = 1;
5720
    Param2 = 0;
5721
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5722
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5723
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5724
    break;
5725
  case ARM::BI__builtin_arm_mve_vqmovnbq_m_u32:
5726
    Param0 = 1;
5727
    Param1 = 1;
5728
    Param2 = 0;
5729
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5730
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5731
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
5732
    break;
5733
  case ARM::BI__builtin_arm_mve_vqmovntq_m_s16:
5734
    Param0 = 0;
5735
    Param1 = 0;
5736
    Param2 = 1;
5737
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5738
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5739
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5740
    break;
5741
  case ARM::BI__builtin_arm_mve_vqmovntq_m_s32:
5742
    Param0 = 0;
5743
    Param1 = 0;
5744
    Param2 = 1;
5745
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5746
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5747
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
5748
    break;
5749
  case ARM::BI__builtin_arm_mve_vqmovntq_m_u16:
5750
    Param0 = 1;
5751
    Param1 = 1;
5752
    Param2 = 1;
5753
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5754
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5755
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5756
    break;
5757
  case ARM::BI__builtin_arm_mve_vqmovntq_m_u32:
5758
    Param0 = 1;
5759
    Param1 = 1;
5760
    Param2 = 1;
5761
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5762
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5763
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
5764
    break;
5765
  case ARM::BI__builtin_arm_mve_vqmovunbq_m_s16:
5766
    Param0 = 1;
5767
    Param1 = 0;
5768
    Param2 = 0;
5769
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5770
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5771
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5772
    break;
5773
  case ARM::BI__builtin_arm_mve_vqmovunbq_m_s32:
5774
    Param0 = 1;
5775
    Param1 = 0;
5776
    Param2 = 0;
5777
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5778
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5779
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
5780
    break;
5781
  case ARM::BI__builtin_arm_mve_vqmovuntq_m_s16:
5782
    Param0 = 1;
5783
    Param1 = 0;
5784
    Param2 = 1;
5785
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5786
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5787
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
5788
    break;
5789
  case ARM::BI__builtin_arm_mve_vqmovuntq_m_s32:
5790
    Param0 = 1;
5791
    Param1 = 0;
5792
    Param2 = 1;
5793
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5794
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5795
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
5796
    break;
5797
  }
5798
  Value *Val0 = EmitScalarExpr(E->getArg(0));
5799
  Value *Val1 = EmitScalarExpr(E->getArg(1));
5800
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
5801
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
5802
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param2);
5803
  Value *Val5 = EmitScalarExpr(E->getArg(2));
5804
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
5805
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val6});
5806
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vqmovn_predicated, {Param4, Param5, Param3}), {Val0, Val1, Val2, Val3, Val4, Val7});
5807
}
5808
case ARM::BI__builtin_arm_mve_vqrshlq_m_n_s16:
5809
case ARM::BI__builtin_arm_mve_vqrshlq_m_n_s32:
5810
case ARM::BI__builtin_arm_mve_vqrshlq_m_n_s8:
5811
case ARM::BI__builtin_arm_mve_vqrshlq_m_n_u16:
5812
case ARM::BI__builtin_arm_mve_vqrshlq_m_n_u32:
5813
case ARM::BI__builtin_arm_mve_vqrshlq_m_n_u8:
5814
case ARM::BI__builtin_arm_mve_vqshlq_m_r_s16:
5815
case ARM::BI__builtin_arm_mve_vqshlq_m_r_s32:
5816
case ARM::BI__builtin_arm_mve_vqshlq_m_r_s8:
5817
case ARM::BI__builtin_arm_mve_vqshlq_m_r_u16:
5818
case ARM::BI__builtin_arm_mve_vqshlq_m_r_u32:
5819
case ARM::BI__builtin_arm_mve_vqshlq_m_r_u8:
5820
case ARM::BI__builtin_arm_mve_vrshlq_m_n_s16:
5821
case ARM::BI__builtin_arm_mve_vrshlq_m_n_s32:
5822
case ARM::BI__builtin_arm_mve_vrshlq_m_n_s8:
5823
case ARM::BI__builtin_arm_mve_vrshlq_m_n_u16:
5824
case ARM::BI__builtin_arm_mve_vrshlq_m_n_u32:
5825
case ARM::BI__builtin_arm_mve_vrshlq_m_n_u8:
5826
case ARM::BI__builtin_arm_mve_vshlq_m_r_s16:
5827
case ARM::BI__builtin_arm_mve_vshlq_m_r_s32:
5828
case ARM::BI__builtin_arm_mve_vshlq_m_r_s8:
5829
case ARM::BI__builtin_arm_mve_vshlq_m_r_u16:
5830
case ARM::BI__builtin_arm_mve_vshlq_m_r_u32:
5831
case ARM::BI__builtin_arm_mve_vshlq_m_r_u8: {
5832
  uint32_t  Param0;
5833
  uint32_t  Param1;
5834
  uint32_t  Param2;
5835
  llvm::Type * Param3;
5836
  llvm::Type * Param4;
5837
  switch (BuiltinID) {
5838
  case ARM::BI__builtin_arm_mve_vqrshlq_m_n_s16:
5839
    Param0 = 1;
5840
    Param1 = 1;
5841
    Param2 = 0;
5842
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5843
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5844
    break;
5845
  case ARM::BI__builtin_arm_mve_vqrshlq_m_n_s32:
5846
    Param0 = 1;
5847
    Param1 = 1;
5848
    Param2 = 0;
5849
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5850
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
5851
    break;
5852
  case ARM::BI__builtin_arm_mve_vqrshlq_m_n_s8:
5853
    Param0 = 1;
5854
    Param1 = 1;
5855
    Param2 = 0;
5856
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
5857
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5858
    break;
5859
  case ARM::BI__builtin_arm_mve_vqrshlq_m_n_u16:
5860
    Param0 = 1;
5861
    Param1 = 1;
5862
    Param2 = 1;
5863
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5864
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5865
    break;
5866
  case ARM::BI__builtin_arm_mve_vqrshlq_m_n_u32:
5867
    Param0 = 1;
5868
    Param1 = 1;
5869
    Param2 = 1;
5870
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5871
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
5872
    break;
5873
  case ARM::BI__builtin_arm_mve_vqrshlq_m_n_u8:
5874
    Param0 = 1;
5875
    Param1 = 1;
5876
    Param2 = 1;
5877
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
5878
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5879
    break;
5880
  case ARM::BI__builtin_arm_mve_vqshlq_m_r_s16:
5881
    Param0 = 1;
5882
    Param1 = 0;
5883
    Param2 = 0;
5884
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5885
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5886
    break;
5887
  case ARM::BI__builtin_arm_mve_vqshlq_m_r_s32:
5888
    Param0 = 1;
5889
    Param1 = 0;
5890
    Param2 = 0;
5891
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5892
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
5893
    break;
5894
  case ARM::BI__builtin_arm_mve_vqshlq_m_r_s8:
5895
    Param0 = 1;
5896
    Param1 = 0;
5897
    Param2 = 0;
5898
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
5899
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5900
    break;
5901
  case ARM::BI__builtin_arm_mve_vqshlq_m_r_u16:
5902
    Param0 = 1;
5903
    Param1 = 0;
5904
    Param2 = 1;
5905
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5906
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5907
    break;
5908
  case ARM::BI__builtin_arm_mve_vqshlq_m_r_u32:
5909
    Param0 = 1;
5910
    Param1 = 0;
5911
    Param2 = 1;
5912
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5913
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
5914
    break;
5915
  case ARM::BI__builtin_arm_mve_vqshlq_m_r_u8:
5916
    Param0 = 1;
5917
    Param1 = 0;
5918
    Param2 = 1;
5919
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
5920
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5921
    break;
5922
  case ARM::BI__builtin_arm_mve_vrshlq_m_n_s16:
5923
    Param0 = 0;
5924
    Param1 = 1;
5925
    Param2 = 0;
5926
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5927
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5928
    break;
5929
  case ARM::BI__builtin_arm_mve_vrshlq_m_n_s32:
5930
    Param0 = 0;
5931
    Param1 = 1;
5932
    Param2 = 0;
5933
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5934
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
5935
    break;
5936
  case ARM::BI__builtin_arm_mve_vrshlq_m_n_s8:
5937
    Param0 = 0;
5938
    Param1 = 1;
5939
    Param2 = 0;
5940
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
5941
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5942
    break;
5943
  case ARM::BI__builtin_arm_mve_vrshlq_m_n_u16:
5944
    Param0 = 0;
5945
    Param1 = 1;
5946
    Param2 = 1;
5947
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5948
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5949
    break;
5950
  case ARM::BI__builtin_arm_mve_vrshlq_m_n_u32:
5951
    Param0 = 0;
5952
    Param1 = 1;
5953
    Param2 = 1;
5954
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5955
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
5956
    break;
5957
  case ARM::BI__builtin_arm_mve_vrshlq_m_n_u8:
5958
    Param0 = 0;
5959
    Param1 = 1;
5960
    Param2 = 1;
5961
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
5962
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5963
    break;
5964
  case ARM::BI__builtin_arm_mve_vshlq_m_r_s16:
5965
    Param0 = 0;
5966
    Param1 = 0;
5967
    Param2 = 0;
5968
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5969
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5970
    break;
5971
  case ARM::BI__builtin_arm_mve_vshlq_m_r_s32:
5972
    Param0 = 0;
5973
    Param1 = 0;
5974
    Param2 = 0;
5975
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5976
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
5977
    break;
5978
  case ARM::BI__builtin_arm_mve_vshlq_m_r_s8:
5979
    Param0 = 0;
5980
    Param1 = 0;
5981
    Param2 = 0;
5982
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
5983
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
5984
    break;
5985
  case ARM::BI__builtin_arm_mve_vshlq_m_r_u16:
5986
    Param0 = 0;
5987
    Param1 = 0;
5988
    Param2 = 1;
5989
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
5990
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
5991
    break;
5992
  case ARM::BI__builtin_arm_mve_vshlq_m_r_u32:
5993
    Param0 = 0;
5994
    Param1 = 0;
5995
    Param2 = 1;
5996
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
5997
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
5998
    break;
5999
  case ARM::BI__builtin_arm_mve_vshlq_m_r_u8:
6000
    Param0 = 0;
6001
    Param1 = 0;
6002
    Param2 = 1;
6003
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
6004
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6005
    break;
6006
  }
6007
  Value *Val0 = EmitScalarExpr(E->getArg(0));
6008
  Value *Val1 = EmitScalarExpr(E->getArg(1));
6009
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
6010
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
6011
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param2);
6012
  Value *Val5 = EmitScalarExpr(E->getArg(2));
6013
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
6014
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val6});
6015
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshl_scalar_predicated, {Param4, Param3}), {Val0, Val1, Val2, Val3, Val4, Val7});
6016
}
6017
case ARM::BI__builtin_arm_mve_vqrshlq_n_s16:
6018
case ARM::BI__builtin_arm_mve_vqrshlq_n_s32:
6019
case ARM::BI__builtin_arm_mve_vqrshlq_n_s8:
6020
case ARM::BI__builtin_arm_mve_vqrshlq_n_u16:
6021
case ARM::BI__builtin_arm_mve_vqrshlq_n_u32:
6022
case ARM::BI__builtin_arm_mve_vqrshlq_n_u8:
6023
case ARM::BI__builtin_arm_mve_vqshlq_r_s16:
6024
case ARM::BI__builtin_arm_mve_vqshlq_r_s32:
6025
case ARM::BI__builtin_arm_mve_vqshlq_r_s8:
6026
case ARM::BI__builtin_arm_mve_vqshlq_r_u16:
6027
case ARM::BI__builtin_arm_mve_vqshlq_r_u32:
6028
case ARM::BI__builtin_arm_mve_vqshlq_r_u8:
6029
case ARM::BI__builtin_arm_mve_vrshlq_n_s16:
6030
case ARM::BI__builtin_arm_mve_vrshlq_n_s32:
6031
case ARM::BI__builtin_arm_mve_vrshlq_n_s8:
6032
case ARM::BI__builtin_arm_mve_vrshlq_n_u16:
6033
case ARM::BI__builtin_arm_mve_vrshlq_n_u32:
6034
case ARM::BI__builtin_arm_mve_vrshlq_n_u8:
6035
case ARM::BI__builtin_arm_mve_vshlq_r_s16:
6036
case ARM::BI__builtin_arm_mve_vshlq_r_s32:
6037
case ARM::BI__builtin_arm_mve_vshlq_r_s8:
6038
case ARM::BI__builtin_arm_mve_vshlq_r_u16:
6039
case ARM::BI__builtin_arm_mve_vshlq_r_u32:
6040
case ARM::BI__builtin_arm_mve_vshlq_r_u8: {
6041
  uint32_t  Param0;
6042
  uint32_t  Param1;
6043
  uint32_t  Param2;
6044
  llvm::Type * Param3;
6045
  switch (BuiltinID) {
6046
  case ARM::BI__builtin_arm_mve_vqrshlq_n_s16:
6047
    Param0 = 1;
6048
    Param1 = 1;
6049
    Param2 = 0;
6050
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6051
    break;
6052
  case ARM::BI__builtin_arm_mve_vqrshlq_n_s32:
6053
    Param0 = 1;
6054
    Param1 = 1;
6055
    Param2 = 0;
6056
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6057
    break;
6058
  case ARM::BI__builtin_arm_mve_vqrshlq_n_s8:
6059
    Param0 = 1;
6060
    Param1 = 1;
6061
    Param2 = 0;
6062
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6063
    break;
6064
  case ARM::BI__builtin_arm_mve_vqrshlq_n_u16:
6065
    Param0 = 1;
6066
    Param1 = 1;
6067
    Param2 = 1;
6068
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6069
    break;
6070
  case ARM::BI__builtin_arm_mve_vqrshlq_n_u32:
6071
    Param0 = 1;
6072
    Param1 = 1;
6073
    Param2 = 1;
6074
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6075
    break;
6076
  case ARM::BI__builtin_arm_mve_vqrshlq_n_u8:
6077
    Param0 = 1;
6078
    Param1 = 1;
6079
    Param2 = 1;
6080
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6081
    break;
6082
  case ARM::BI__builtin_arm_mve_vqshlq_r_s16:
6083
    Param0 = 1;
6084
    Param1 = 0;
6085
    Param2 = 0;
6086
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6087
    break;
6088
  case ARM::BI__builtin_arm_mve_vqshlq_r_s32:
6089
    Param0 = 1;
6090
    Param1 = 0;
6091
    Param2 = 0;
6092
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6093
    break;
6094
  case ARM::BI__builtin_arm_mve_vqshlq_r_s8:
6095
    Param0 = 1;
6096
    Param1 = 0;
6097
    Param2 = 0;
6098
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6099
    break;
6100
  case ARM::BI__builtin_arm_mve_vqshlq_r_u16:
6101
    Param0 = 1;
6102
    Param1 = 0;
6103
    Param2 = 1;
6104
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6105
    break;
6106
  case ARM::BI__builtin_arm_mve_vqshlq_r_u32:
6107
    Param0 = 1;
6108
    Param1 = 0;
6109
    Param2 = 1;
6110
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6111
    break;
6112
  case ARM::BI__builtin_arm_mve_vqshlq_r_u8:
6113
    Param0 = 1;
6114
    Param1 = 0;
6115
    Param2 = 1;
6116
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6117
    break;
6118
  case ARM::BI__builtin_arm_mve_vrshlq_n_s16:
6119
    Param0 = 0;
6120
    Param1 = 1;
6121
    Param2 = 0;
6122
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6123
    break;
6124
  case ARM::BI__builtin_arm_mve_vrshlq_n_s32:
6125
    Param0 = 0;
6126
    Param1 = 1;
6127
    Param2 = 0;
6128
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6129
    break;
6130
  case ARM::BI__builtin_arm_mve_vrshlq_n_s8:
6131
    Param0 = 0;
6132
    Param1 = 1;
6133
    Param2 = 0;
6134
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6135
    break;
6136
  case ARM::BI__builtin_arm_mve_vrshlq_n_u16:
6137
    Param0 = 0;
6138
    Param1 = 1;
6139
    Param2 = 1;
6140
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6141
    break;
6142
  case ARM::BI__builtin_arm_mve_vrshlq_n_u32:
6143
    Param0 = 0;
6144
    Param1 = 1;
6145
    Param2 = 1;
6146
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6147
    break;
6148
  case ARM::BI__builtin_arm_mve_vrshlq_n_u8:
6149
    Param0 = 0;
6150
    Param1 = 1;
6151
    Param2 = 1;
6152
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6153
    break;
6154
  case ARM::BI__builtin_arm_mve_vshlq_r_s16:
6155
    Param0 = 0;
6156
    Param1 = 0;
6157
    Param2 = 0;
6158
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6159
    break;
6160
  case ARM::BI__builtin_arm_mve_vshlq_r_s32:
6161
    Param0 = 0;
6162
    Param1 = 0;
6163
    Param2 = 0;
6164
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6165
    break;
6166
  case ARM::BI__builtin_arm_mve_vshlq_r_s8:
6167
    Param0 = 0;
6168
    Param1 = 0;
6169
    Param2 = 0;
6170
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6171
    break;
6172
  case ARM::BI__builtin_arm_mve_vshlq_r_u16:
6173
    Param0 = 0;
6174
    Param1 = 0;
6175
    Param2 = 1;
6176
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6177
    break;
6178
  case ARM::BI__builtin_arm_mve_vshlq_r_u32:
6179
    Param0 = 0;
6180
    Param1 = 0;
6181
    Param2 = 1;
6182
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6183
    break;
6184
  case ARM::BI__builtin_arm_mve_vshlq_r_u8:
6185
    Param0 = 0;
6186
    Param1 = 0;
6187
    Param2 = 1;
6188
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6189
    break;
6190
  }
6191
  Value *Val0 = EmitScalarExpr(E->getArg(0));
6192
  Value *Val1 = EmitScalarExpr(E->getArg(1));
6193
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
6194
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
6195
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param2);
6196
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshl_scalar, {Param3}), {Val0, Val1, Val2, Val3, Val4});
6197
}
6198
case ARM::BI__builtin_arm_mve_vqmovnbq_s16:
6199
case ARM::BI__builtin_arm_mve_vqmovnbq_s32:
6200
case ARM::BI__builtin_arm_mve_vqmovnbq_u16:
6201
case ARM::BI__builtin_arm_mve_vqmovnbq_u32:
6202
case ARM::BI__builtin_arm_mve_vqmovntq_s16:
6203
case ARM::BI__builtin_arm_mve_vqmovntq_s32:
6204
case ARM::BI__builtin_arm_mve_vqmovntq_u16:
6205
case ARM::BI__builtin_arm_mve_vqmovntq_u32:
6206
case ARM::BI__builtin_arm_mve_vqmovunbq_s16:
6207
case ARM::BI__builtin_arm_mve_vqmovunbq_s32:
6208
case ARM::BI__builtin_arm_mve_vqmovuntq_s16:
6209
case ARM::BI__builtin_arm_mve_vqmovuntq_s32:
6210
case ARM::BI__builtin_arm_mve_vqrshlq_s16:
6211
case ARM::BI__builtin_arm_mve_vqrshlq_s32:
6212
case ARM::BI__builtin_arm_mve_vqrshlq_s8:
6213
case ARM::BI__builtin_arm_mve_vqrshlq_u16:
6214
case ARM::BI__builtin_arm_mve_vqrshlq_u32:
6215
case ARM::BI__builtin_arm_mve_vqrshlq_u8:
6216
case ARM::BI__builtin_arm_mve_vqshlq_s16:
6217
case ARM::BI__builtin_arm_mve_vqshlq_s32:
6218
case ARM::BI__builtin_arm_mve_vqshlq_s8:
6219
case ARM::BI__builtin_arm_mve_vqshlq_u16:
6220
case ARM::BI__builtin_arm_mve_vqshlq_u32:
6221
case ARM::BI__builtin_arm_mve_vqshlq_u8:
6222
case ARM::BI__builtin_arm_mve_vrshlq_s16:
6223
case ARM::BI__builtin_arm_mve_vrshlq_s32:
6224
case ARM::BI__builtin_arm_mve_vrshlq_s8:
6225
case ARM::BI__builtin_arm_mve_vrshlq_u16:
6226
case ARM::BI__builtin_arm_mve_vrshlq_u32:
6227
case ARM::BI__builtin_arm_mve_vrshlq_u8:
6228
case ARM::BI__builtin_arm_mve_vshlq_s16:
6229
case ARM::BI__builtin_arm_mve_vshlq_s32:
6230
case ARM::BI__builtin_arm_mve_vshlq_s8:
6231
case ARM::BI__builtin_arm_mve_vshlq_u16:
6232
case ARM::BI__builtin_arm_mve_vshlq_u32:
6233
case ARM::BI__builtin_arm_mve_vshlq_u8: {
6234
  uint32_t  Param0;
6235
  uint32_t  Param1;
6236
  uint32_t  Param2;
6237
  Intrinsic::ID  Param3;
6238
  llvm::Type * Param4;
6239
  llvm::Type * Param5;
6240
  switch (BuiltinID) {
6241
  case ARM::BI__builtin_arm_mve_vqmovnbq_s16:
6242
    Param0 = 0;
6243
    Param1 = 0;
6244
    Param2 = 0;
6245
    Param3 = Intrinsic::arm_mve_vqmovn;
6246
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6247
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6248
    break;
6249
  case ARM::BI__builtin_arm_mve_vqmovnbq_s32:
6250
    Param0 = 0;
6251
    Param1 = 0;
6252
    Param2 = 0;
6253
    Param3 = Intrinsic::arm_mve_vqmovn;
6254
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6255
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6256
    break;
6257
  case ARM::BI__builtin_arm_mve_vqmovnbq_u16:
6258
    Param0 = 1;
6259
    Param1 = 1;
6260
    Param2 = 0;
6261
    Param3 = Intrinsic::arm_mve_vqmovn;
6262
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6263
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6264
    break;
6265
  case ARM::BI__builtin_arm_mve_vqmovnbq_u32:
6266
    Param0 = 1;
6267
    Param1 = 1;
6268
    Param2 = 0;
6269
    Param3 = Intrinsic::arm_mve_vqmovn;
6270
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6271
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6272
    break;
6273
  case ARM::BI__builtin_arm_mve_vqmovntq_s16:
6274
    Param0 = 0;
6275
    Param1 = 0;
6276
    Param2 = 1;
6277
    Param3 = Intrinsic::arm_mve_vqmovn;
6278
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6279
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6280
    break;
6281
  case ARM::BI__builtin_arm_mve_vqmovntq_s32:
6282
    Param0 = 0;
6283
    Param1 = 0;
6284
    Param2 = 1;
6285
    Param3 = Intrinsic::arm_mve_vqmovn;
6286
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6287
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6288
    break;
6289
  case ARM::BI__builtin_arm_mve_vqmovntq_u16:
6290
    Param0 = 1;
6291
    Param1 = 1;
6292
    Param2 = 1;
6293
    Param3 = Intrinsic::arm_mve_vqmovn;
6294
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6295
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6296
    break;
6297
  case ARM::BI__builtin_arm_mve_vqmovntq_u32:
6298
    Param0 = 1;
6299
    Param1 = 1;
6300
    Param2 = 1;
6301
    Param3 = Intrinsic::arm_mve_vqmovn;
6302
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6303
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6304
    break;
6305
  case ARM::BI__builtin_arm_mve_vqmovunbq_s16:
6306
    Param0 = 1;
6307
    Param1 = 0;
6308
    Param2 = 0;
6309
    Param3 = Intrinsic::arm_mve_vqmovn;
6310
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6311
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6312
    break;
6313
  case ARM::BI__builtin_arm_mve_vqmovunbq_s32:
6314
    Param0 = 1;
6315
    Param1 = 0;
6316
    Param2 = 0;
6317
    Param3 = Intrinsic::arm_mve_vqmovn;
6318
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6319
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6320
    break;
6321
  case ARM::BI__builtin_arm_mve_vqmovuntq_s16:
6322
    Param0 = 1;
6323
    Param1 = 0;
6324
    Param2 = 1;
6325
    Param3 = Intrinsic::arm_mve_vqmovn;
6326
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6327
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6328
    break;
6329
  case ARM::BI__builtin_arm_mve_vqmovuntq_s32:
6330
    Param0 = 1;
6331
    Param1 = 0;
6332
    Param2 = 1;
6333
    Param3 = Intrinsic::arm_mve_vqmovn;
6334
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6335
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6336
    break;
6337
  case ARM::BI__builtin_arm_mve_vqrshlq_s16:
6338
    Param0 = 1;
6339
    Param1 = 1;
6340
    Param2 = 0;
6341
    Param3 = Intrinsic::arm_mve_vshl_vector;
6342
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6343
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6344
    break;
6345
  case ARM::BI__builtin_arm_mve_vqrshlq_s32:
6346
    Param0 = 1;
6347
    Param1 = 1;
6348
    Param2 = 0;
6349
    Param3 = Intrinsic::arm_mve_vshl_vector;
6350
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6351
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6352
    break;
6353
  case ARM::BI__builtin_arm_mve_vqrshlq_s8:
6354
    Param0 = 1;
6355
    Param1 = 1;
6356
    Param2 = 0;
6357
    Param3 = Intrinsic::arm_mve_vshl_vector;
6358
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6359
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
6360
    break;
6361
  case ARM::BI__builtin_arm_mve_vqrshlq_u16:
6362
    Param0 = 1;
6363
    Param1 = 1;
6364
    Param2 = 1;
6365
    Param3 = Intrinsic::arm_mve_vshl_vector;
6366
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6367
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6368
    break;
6369
  case ARM::BI__builtin_arm_mve_vqrshlq_u32:
6370
    Param0 = 1;
6371
    Param1 = 1;
6372
    Param2 = 1;
6373
    Param3 = Intrinsic::arm_mve_vshl_vector;
6374
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6375
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6376
    break;
6377
  case ARM::BI__builtin_arm_mve_vqrshlq_u8:
6378
    Param0 = 1;
6379
    Param1 = 1;
6380
    Param2 = 1;
6381
    Param3 = Intrinsic::arm_mve_vshl_vector;
6382
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6383
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
6384
    break;
6385
  case ARM::BI__builtin_arm_mve_vqshlq_s16:
6386
    Param0 = 1;
6387
    Param1 = 0;
6388
    Param2 = 0;
6389
    Param3 = Intrinsic::arm_mve_vshl_vector;
6390
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6391
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6392
    break;
6393
  case ARM::BI__builtin_arm_mve_vqshlq_s32:
6394
    Param0 = 1;
6395
    Param1 = 0;
6396
    Param2 = 0;
6397
    Param3 = Intrinsic::arm_mve_vshl_vector;
6398
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6399
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6400
    break;
6401
  case ARM::BI__builtin_arm_mve_vqshlq_s8:
6402
    Param0 = 1;
6403
    Param1 = 0;
6404
    Param2 = 0;
6405
    Param3 = Intrinsic::arm_mve_vshl_vector;
6406
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6407
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
6408
    break;
6409
  case ARM::BI__builtin_arm_mve_vqshlq_u16:
6410
    Param0 = 1;
6411
    Param1 = 0;
6412
    Param2 = 1;
6413
    Param3 = Intrinsic::arm_mve_vshl_vector;
6414
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6415
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6416
    break;
6417
  case ARM::BI__builtin_arm_mve_vqshlq_u32:
6418
    Param0 = 1;
6419
    Param1 = 0;
6420
    Param2 = 1;
6421
    Param3 = Intrinsic::arm_mve_vshl_vector;
6422
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6423
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6424
    break;
6425
  case ARM::BI__builtin_arm_mve_vqshlq_u8:
6426
    Param0 = 1;
6427
    Param1 = 0;
6428
    Param2 = 1;
6429
    Param3 = Intrinsic::arm_mve_vshl_vector;
6430
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6431
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
6432
    break;
6433
  case ARM::BI__builtin_arm_mve_vrshlq_s16:
6434
    Param0 = 0;
6435
    Param1 = 1;
6436
    Param2 = 0;
6437
    Param3 = Intrinsic::arm_mve_vshl_vector;
6438
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6439
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6440
    break;
6441
  case ARM::BI__builtin_arm_mve_vrshlq_s32:
6442
    Param0 = 0;
6443
    Param1 = 1;
6444
    Param2 = 0;
6445
    Param3 = Intrinsic::arm_mve_vshl_vector;
6446
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6447
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6448
    break;
6449
  case ARM::BI__builtin_arm_mve_vrshlq_s8:
6450
    Param0 = 0;
6451
    Param1 = 1;
6452
    Param2 = 0;
6453
    Param3 = Intrinsic::arm_mve_vshl_vector;
6454
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6455
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
6456
    break;
6457
  case ARM::BI__builtin_arm_mve_vrshlq_u16:
6458
    Param0 = 0;
6459
    Param1 = 1;
6460
    Param2 = 1;
6461
    Param3 = Intrinsic::arm_mve_vshl_vector;
6462
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6463
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6464
    break;
6465
  case ARM::BI__builtin_arm_mve_vrshlq_u32:
6466
    Param0 = 0;
6467
    Param1 = 1;
6468
    Param2 = 1;
6469
    Param3 = Intrinsic::arm_mve_vshl_vector;
6470
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6471
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6472
    break;
6473
  case ARM::BI__builtin_arm_mve_vrshlq_u8:
6474
    Param0 = 0;
6475
    Param1 = 1;
6476
    Param2 = 1;
6477
    Param3 = Intrinsic::arm_mve_vshl_vector;
6478
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6479
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
6480
    break;
6481
  case ARM::BI__builtin_arm_mve_vshlq_s16:
6482
    Param0 = 0;
6483
    Param1 = 0;
6484
    Param2 = 0;
6485
    Param3 = Intrinsic::arm_mve_vshl_vector;
6486
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6487
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6488
    break;
6489
  case ARM::BI__builtin_arm_mve_vshlq_s32:
6490
    Param0 = 0;
6491
    Param1 = 0;
6492
    Param2 = 0;
6493
    Param3 = Intrinsic::arm_mve_vshl_vector;
6494
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6495
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6496
    break;
6497
  case ARM::BI__builtin_arm_mve_vshlq_s8:
6498
    Param0 = 0;
6499
    Param1 = 0;
6500
    Param2 = 0;
6501
    Param3 = Intrinsic::arm_mve_vshl_vector;
6502
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6503
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
6504
    break;
6505
  case ARM::BI__builtin_arm_mve_vshlq_u16:
6506
    Param0 = 0;
6507
    Param1 = 0;
6508
    Param2 = 1;
6509
    Param3 = Intrinsic::arm_mve_vshl_vector;
6510
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6511
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
6512
    break;
6513
  case ARM::BI__builtin_arm_mve_vshlq_u32:
6514
    Param0 = 0;
6515
    Param1 = 0;
6516
    Param2 = 1;
6517
    Param3 = Intrinsic::arm_mve_vshl_vector;
6518
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6519
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
6520
    break;
6521
  case ARM::BI__builtin_arm_mve_vshlq_u8:
6522
    Param0 = 0;
6523
    Param1 = 0;
6524
    Param2 = 1;
6525
    Param3 = Intrinsic::arm_mve_vshl_vector;
6526
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6527
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
6528
    break;
6529
  }
6530
  Value *Val0 = EmitScalarExpr(E->getArg(0));
6531
  Value *Val1 = EmitScalarExpr(E->getArg(1));
6532
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
6533
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
6534
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param2);
6535
  return Builder.CreateCall(CGM.getIntrinsic(Param3, {Param4, Param5}), {Val0, Val1, Val2, Val3, Val4});
6536
}
6537
case ARM::BI__builtin_arm_mve_vmullbq_int_s16:
6538
case ARM::BI__builtin_arm_mve_vmullbq_int_s32:
6539
case ARM::BI__builtin_arm_mve_vmullbq_int_s8:
6540
case ARM::BI__builtin_arm_mve_vmullbq_int_u16:
6541
case ARM::BI__builtin_arm_mve_vmullbq_int_u32:
6542
case ARM::BI__builtin_arm_mve_vmullbq_int_u8:
6543
case ARM::BI__builtin_arm_mve_vmulltq_int_s16:
6544
case ARM::BI__builtin_arm_mve_vmulltq_int_s32:
6545
case ARM::BI__builtin_arm_mve_vmulltq_int_s8:
6546
case ARM::BI__builtin_arm_mve_vmulltq_int_u16:
6547
case ARM::BI__builtin_arm_mve_vmulltq_int_u32:
6548
case ARM::BI__builtin_arm_mve_vmulltq_int_u8:
6549
case ARM::BI__builtin_arm_mve_vshllbq_n_s16:
6550
case ARM::BI__builtin_arm_mve_vshllbq_n_s8:
6551
case ARM::BI__builtin_arm_mve_vshllbq_n_u16:
6552
case ARM::BI__builtin_arm_mve_vshllbq_n_u8:
6553
case ARM::BI__builtin_arm_mve_vshlltq_n_s16:
6554
case ARM::BI__builtin_arm_mve_vshlltq_n_s8:
6555
case ARM::BI__builtin_arm_mve_vshlltq_n_u16:
6556
case ARM::BI__builtin_arm_mve_vshlltq_n_u8: {
6557
  uint32_t  Param0;
6558
  uint32_t  Param1;
6559
  Intrinsic::ID  Param2;
6560
  llvm::Type * Param3;
6561
  llvm::Type * Param4;
6562
  switch (BuiltinID) {
6563
  case ARM::BI__builtin_arm_mve_vmullbq_int_s16:
6564
    Param0 = 0;
6565
    Param1 = 0;
6566
    Param2 = Intrinsic::arm_mve_vmull;
6567
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6568
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6569
    break;
6570
  case ARM::BI__builtin_arm_mve_vmullbq_int_s32:
6571
    Param0 = 0;
6572
    Param1 = 0;
6573
    Param2 = Intrinsic::arm_mve_vmull;
6574
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
6575
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6576
    break;
6577
  case ARM::BI__builtin_arm_mve_vmullbq_int_s8:
6578
    Param0 = 0;
6579
    Param1 = 0;
6580
    Param2 = Intrinsic::arm_mve_vmull;
6581
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6582
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6583
    break;
6584
  case ARM::BI__builtin_arm_mve_vmullbq_int_u16:
6585
    Param0 = 1;
6586
    Param1 = 0;
6587
    Param2 = Intrinsic::arm_mve_vmull;
6588
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6589
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6590
    break;
6591
  case ARM::BI__builtin_arm_mve_vmullbq_int_u32:
6592
    Param0 = 1;
6593
    Param1 = 0;
6594
    Param2 = Intrinsic::arm_mve_vmull;
6595
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
6596
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6597
    break;
6598
  case ARM::BI__builtin_arm_mve_vmullbq_int_u8:
6599
    Param0 = 1;
6600
    Param1 = 0;
6601
    Param2 = Intrinsic::arm_mve_vmull;
6602
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6603
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6604
    break;
6605
  case ARM::BI__builtin_arm_mve_vmulltq_int_s16:
6606
    Param0 = 0;
6607
    Param1 = 1;
6608
    Param2 = Intrinsic::arm_mve_vmull;
6609
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6610
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6611
    break;
6612
  case ARM::BI__builtin_arm_mve_vmulltq_int_s32:
6613
    Param0 = 0;
6614
    Param1 = 1;
6615
    Param2 = Intrinsic::arm_mve_vmull;
6616
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
6617
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6618
    break;
6619
  case ARM::BI__builtin_arm_mve_vmulltq_int_s8:
6620
    Param0 = 0;
6621
    Param1 = 1;
6622
    Param2 = Intrinsic::arm_mve_vmull;
6623
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6624
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6625
    break;
6626
  case ARM::BI__builtin_arm_mve_vmulltq_int_u16:
6627
    Param0 = 1;
6628
    Param1 = 1;
6629
    Param2 = Intrinsic::arm_mve_vmull;
6630
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6631
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6632
    break;
6633
  case ARM::BI__builtin_arm_mve_vmulltq_int_u32:
6634
    Param0 = 1;
6635
    Param1 = 1;
6636
    Param2 = Intrinsic::arm_mve_vmull;
6637
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
6638
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
6639
    break;
6640
  case ARM::BI__builtin_arm_mve_vmulltq_int_u8:
6641
    Param0 = 1;
6642
    Param1 = 1;
6643
    Param2 = Intrinsic::arm_mve_vmull;
6644
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6645
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6646
    break;
6647
  case ARM::BI__builtin_arm_mve_vshllbq_n_s16:
6648
    Param0 = 0;
6649
    Param1 = 0;
6650
    Param2 = Intrinsic::arm_mve_vshll_imm;
6651
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6652
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6653
    break;
6654
  case ARM::BI__builtin_arm_mve_vshllbq_n_s8:
6655
    Param0 = 0;
6656
    Param1 = 0;
6657
    Param2 = Intrinsic::arm_mve_vshll_imm;
6658
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6659
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6660
    break;
6661
  case ARM::BI__builtin_arm_mve_vshllbq_n_u16:
6662
    Param0 = 1;
6663
    Param1 = 0;
6664
    Param2 = Intrinsic::arm_mve_vshll_imm;
6665
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6666
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6667
    break;
6668
  case ARM::BI__builtin_arm_mve_vshllbq_n_u8:
6669
    Param0 = 1;
6670
    Param1 = 0;
6671
    Param2 = Intrinsic::arm_mve_vshll_imm;
6672
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6673
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6674
    break;
6675
  case ARM::BI__builtin_arm_mve_vshlltq_n_s16:
6676
    Param0 = 0;
6677
    Param1 = 1;
6678
    Param2 = Intrinsic::arm_mve_vshll_imm;
6679
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6680
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6681
    break;
6682
  case ARM::BI__builtin_arm_mve_vshlltq_n_s8:
6683
    Param0 = 0;
6684
    Param1 = 1;
6685
    Param2 = Intrinsic::arm_mve_vshll_imm;
6686
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6687
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6688
    break;
6689
  case ARM::BI__builtin_arm_mve_vshlltq_n_u16:
6690
    Param0 = 1;
6691
    Param1 = 1;
6692
    Param2 = Intrinsic::arm_mve_vshll_imm;
6693
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6694
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
6695
    break;
6696
  case ARM::BI__builtin_arm_mve_vshlltq_n_u8:
6697
    Param0 = 1;
6698
    Param1 = 1;
6699
    Param2 = Intrinsic::arm_mve_vshll_imm;
6700
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6701
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
6702
    break;
6703
  }
6704
  Value *Val0 = EmitScalarExpr(E->getArg(0));
6705
  Value *Val1 = EmitScalarExpr(E->getArg(1));
6706
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
6707
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
6708
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param4}), {Val0, Val1, Val2, Val3});
6709
}
6710
case ARM::BI__builtin_arm_mve_vcvtbq_f16_f32:
6711
case ARM::BI__builtin_arm_mve_vcvttq_f16_f32: {
6712
  uint32_t  Param0;
6713
  switch (BuiltinID) {
6714
  case ARM::BI__builtin_arm_mve_vcvtbq_f16_f32:
6715
    Param0 = 0;
6716
    break;
6717
  case ARM::BI__builtin_arm_mve_vcvttq_f16_f32:
6718
    Param0 = 1;
6719
    break;
6720
  }
6721
  Value *Val0 = EmitScalarExpr(E->getArg(0));
6722
  Value *Val1 = EmitScalarExpr(E->getArg(1));
6723
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
6724
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_narrow), {Val0, Val1, Val2});
6725
}
6726
case ARM::BI__builtin_arm_mve_vmullbq_poly_p16:
6727
case ARM::BI__builtin_arm_mve_vmullbq_poly_p8:
6728
case ARM::BI__builtin_arm_mve_vmulltq_poly_p16:
6729
case ARM::BI__builtin_arm_mve_vmulltq_poly_p8:
6730
case ARM::BI__builtin_arm_mve_vqdmullbq_s16:
6731
case ARM::BI__builtin_arm_mve_vqdmullbq_s32:
6732
case ARM::BI__builtin_arm_mve_vqdmulltq_s16:
6733
case ARM::BI__builtin_arm_mve_vqdmulltq_s32: {
6734
  uint32_t  Param0;
6735
  Intrinsic::ID  Param1;
6736
  llvm::Type * Param2;
6737
  llvm::Type * Param3;
6738
  switch (BuiltinID) {
6739
  case ARM::BI__builtin_arm_mve_vmullbq_poly_p16:
6740
    Param0 = 0;
6741
    Param1 = Intrinsic::arm_mve_vmull_poly;
6742
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6743
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6744
    break;
6745
  case ARM::BI__builtin_arm_mve_vmullbq_poly_p8:
6746
    Param0 = 0;
6747
    Param1 = Intrinsic::arm_mve_vmull_poly;
6748
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6749
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6750
    break;
6751
  case ARM::BI__builtin_arm_mve_vmulltq_poly_p16:
6752
    Param0 = 1;
6753
    Param1 = Intrinsic::arm_mve_vmull_poly;
6754
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6755
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6756
    break;
6757
  case ARM::BI__builtin_arm_mve_vmulltq_poly_p8:
6758
    Param0 = 1;
6759
    Param1 = Intrinsic::arm_mve_vmull_poly;
6760
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6761
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
6762
    break;
6763
  case ARM::BI__builtin_arm_mve_vqdmullbq_s16:
6764
    Param0 = 0;
6765
    Param1 = Intrinsic::arm_mve_vqdmull;
6766
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6767
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6768
    break;
6769
  case ARM::BI__builtin_arm_mve_vqdmullbq_s32:
6770
    Param0 = 0;
6771
    Param1 = Intrinsic::arm_mve_vqdmull;
6772
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
6773
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6774
    break;
6775
  case ARM::BI__builtin_arm_mve_vqdmulltq_s16:
6776
    Param0 = 1;
6777
    Param1 = Intrinsic::arm_mve_vqdmull;
6778
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6779
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
6780
    break;
6781
  case ARM::BI__builtin_arm_mve_vqdmulltq_s32:
6782
    Param0 = 1;
6783
    Param1 = Intrinsic::arm_mve_vqdmull;
6784
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
6785
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
6786
    break;
6787
  }
6788
  Value *Val0 = EmitScalarExpr(E->getArg(0));
6789
  Value *Val1 = EmitScalarExpr(E->getArg(1));
6790
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
6791
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param3}), {Val0, Val1, Val2});
6792
}
6793
case ARM::BI__builtin_arm_mve_vabdq_f16:
6794
case ARM::BI__builtin_arm_mve_vabdq_f32:
6795
case ARM::BI__builtin_arm_mve_vabdq_s16:
6796
case ARM::BI__builtin_arm_mve_vabdq_s32:
6797
case ARM::BI__builtin_arm_mve_vabdq_s8:
6798
case ARM::BI__builtin_arm_mve_vabdq_u16:
6799
case ARM::BI__builtin_arm_mve_vabdq_u32:
6800
case ARM::BI__builtin_arm_mve_vabdq_u8:
6801
case ARM::BI__builtin_arm_mve_vhaddq_s16:
6802
case ARM::BI__builtin_arm_mve_vhaddq_s32:
6803
case ARM::BI__builtin_arm_mve_vhaddq_s8:
6804
case ARM::BI__builtin_arm_mve_vhaddq_u16:
6805
case ARM::BI__builtin_arm_mve_vhaddq_u32:
6806
case ARM::BI__builtin_arm_mve_vhaddq_u8:
6807
case ARM::BI__builtin_arm_mve_vhsubq_s16:
6808
case ARM::BI__builtin_arm_mve_vhsubq_s32:
6809
case ARM::BI__builtin_arm_mve_vhsubq_s8:
6810
case ARM::BI__builtin_arm_mve_vhsubq_u16:
6811
case ARM::BI__builtin_arm_mve_vhsubq_u32:
6812
case ARM::BI__builtin_arm_mve_vhsubq_u8:
6813
case ARM::BI__builtin_arm_mve_vmulhq_s16:
6814
case ARM::BI__builtin_arm_mve_vmulhq_s32:
6815
case ARM::BI__builtin_arm_mve_vmulhq_s8:
6816
case ARM::BI__builtin_arm_mve_vmulhq_u16:
6817
case ARM::BI__builtin_arm_mve_vmulhq_u32:
6818
case ARM::BI__builtin_arm_mve_vmulhq_u8:
6819
case ARM::BI__builtin_arm_mve_vqshlq_n_s16:
6820
case ARM::BI__builtin_arm_mve_vqshlq_n_s32:
6821
case ARM::BI__builtin_arm_mve_vqshlq_n_s8:
6822
case ARM::BI__builtin_arm_mve_vqshlq_n_u16:
6823
case ARM::BI__builtin_arm_mve_vqshlq_n_u32:
6824
case ARM::BI__builtin_arm_mve_vqshlq_n_u8:
6825
case ARM::BI__builtin_arm_mve_vrhaddq_s16:
6826
case ARM::BI__builtin_arm_mve_vrhaddq_s32:
6827
case ARM::BI__builtin_arm_mve_vrhaddq_s8:
6828
case ARM::BI__builtin_arm_mve_vrhaddq_u16:
6829
case ARM::BI__builtin_arm_mve_vrhaddq_u32:
6830
case ARM::BI__builtin_arm_mve_vrhaddq_u8:
6831
case ARM::BI__builtin_arm_mve_vrmulhq_s16:
6832
case ARM::BI__builtin_arm_mve_vrmulhq_s32:
6833
case ARM::BI__builtin_arm_mve_vrmulhq_s8:
6834
case ARM::BI__builtin_arm_mve_vrmulhq_u16:
6835
case ARM::BI__builtin_arm_mve_vrmulhq_u32:
6836
case ARM::BI__builtin_arm_mve_vrmulhq_u8:
6837
case ARM::BI__builtin_arm_mve_vrshrq_n_s16:
6838
case ARM::BI__builtin_arm_mve_vrshrq_n_s32:
6839
case ARM::BI__builtin_arm_mve_vrshrq_n_s8:
6840
case ARM::BI__builtin_arm_mve_vrshrq_n_u16:
6841
case ARM::BI__builtin_arm_mve_vrshrq_n_u32:
6842
case ARM::BI__builtin_arm_mve_vrshrq_n_u8: {
6843
  uint32_t  Param0;
6844
  Intrinsic::ID  Param1;
6845
  llvm::Type * Param2;
6846
  switch (BuiltinID) {
6847
  case ARM::BI__builtin_arm_mve_vabdq_f16:
6848
    Param0 = 0;
6849
    Param1 = Intrinsic::arm_mve_vabd;
6850
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
6851
    break;
6852
  case ARM::BI__builtin_arm_mve_vabdq_f32:
6853
    Param0 = 0;
6854
    Param1 = Intrinsic::arm_mve_vabd;
6855
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
6856
    break;
6857
  case ARM::BI__builtin_arm_mve_vabdq_s16:
6858
    Param0 = 0;
6859
    Param1 = Intrinsic::arm_mve_vabd;
6860
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6861
    break;
6862
  case ARM::BI__builtin_arm_mve_vabdq_s32:
6863
    Param0 = 0;
6864
    Param1 = Intrinsic::arm_mve_vabd;
6865
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6866
    break;
6867
  case ARM::BI__builtin_arm_mve_vabdq_s8:
6868
    Param0 = 0;
6869
    Param1 = Intrinsic::arm_mve_vabd;
6870
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6871
    break;
6872
  case ARM::BI__builtin_arm_mve_vabdq_u16:
6873
    Param0 = 1;
6874
    Param1 = Intrinsic::arm_mve_vabd;
6875
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6876
    break;
6877
  case ARM::BI__builtin_arm_mve_vabdq_u32:
6878
    Param0 = 1;
6879
    Param1 = Intrinsic::arm_mve_vabd;
6880
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6881
    break;
6882
  case ARM::BI__builtin_arm_mve_vabdq_u8:
6883
    Param0 = 1;
6884
    Param1 = Intrinsic::arm_mve_vabd;
6885
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6886
    break;
6887
  case ARM::BI__builtin_arm_mve_vhaddq_s16:
6888
    Param0 = 0;
6889
    Param1 = Intrinsic::arm_mve_vhadd;
6890
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6891
    break;
6892
  case ARM::BI__builtin_arm_mve_vhaddq_s32:
6893
    Param0 = 0;
6894
    Param1 = Intrinsic::arm_mve_vhadd;
6895
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6896
    break;
6897
  case ARM::BI__builtin_arm_mve_vhaddq_s8:
6898
    Param0 = 0;
6899
    Param1 = Intrinsic::arm_mve_vhadd;
6900
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6901
    break;
6902
  case ARM::BI__builtin_arm_mve_vhaddq_u16:
6903
    Param0 = 1;
6904
    Param1 = Intrinsic::arm_mve_vhadd;
6905
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6906
    break;
6907
  case ARM::BI__builtin_arm_mve_vhaddq_u32:
6908
    Param0 = 1;
6909
    Param1 = Intrinsic::arm_mve_vhadd;
6910
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6911
    break;
6912
  case ARM::BI__builtin_arm_mve_vhaddq_u8:
6913
    Param0 = 1;
6914
    Param1 = Intrinsic::arm_mve_vhadd;
6915
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6916
    break;
6917
  case ARM::BI__builtin_arm_mve_vhsubq_s16:
6918
    Param0 = 0;
6919
    Param1 = Intrinsic::arm_mve_vhsub;
6920
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6921
    break;
6922
  case ARM::BI__builtin_arm_mve_vhsubq_s32:
6923
    Param0 = 0;
6924
    Param1 = Intrinsic::arm_mve_vhsub;
6925
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6926
    break;
6927
  case ARM::BI__builtin_arm_mve_vhsubq_s8:
6928
    Param0 = 0;
6929
    Param1 = Intrinsic::arm_mve_vhsub;
6930
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6931
    break;
6932
  case ARM::BI__builtin_arm_mve_vhsubq_u16:
6933
    Param0 = 1;
6934
    Param1 = Intrinsic::arm_mve_vhsub;
6935
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6936
    break;
6937
  case ARM::BI__builtin_arm_mve_vhsubq_u32:
6938
    Param0 = 1;
6939
    Param1 = Intrinsic::arm_mve_vhsub;
6940
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6941
    break;
6942
  case ARM::BI__builtin_arm_mve_vhsubq_u8:
6943
    Param0 = 1;
6944
    Param1 = Intrinsic::arm_mve_vhsub;
6945
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6946
    break;
6947
  case ARM::BI__builtin_arm_mve_vmulhq_s16:
6948
    Param0 = 0;
6949
    Param1 = Intrinsic::arm_mve_vmulh;
6950
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6951
    break;
6952
  case ARM::BI__builtin_arm_mve_vmulhq_s32:
6953
    Param0 = 0;
6954
    Param1 = Intrinsic::arm_mve_vmulh;
6955
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6956
    break;
6957
  case ARM::BI__builtin_arm_mve_vmulhq_s8:
6958
    Param0 = 0;
6959
    Param1 = Intrinsic::arm_mve_vmulh;
6960
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6961
    break;
6962
  case ARM::BI__builtin_arm_mve_vmulhq_u16:
6963
    Param0 = 1;
6964
    Param1 = Intrinsic::arm_mve_vmulh;
6965
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6966
    break;
6967
  case ARM::BI__builtin_arm_mve_vmulhq_u32:
6968
    Param0 = 1;
6969
    Param1 = Intrinsic::arm_mve_vmulh;
6970
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6971
    break;
6972
  case ARM::BI__builtin_arm_mve_vmulhq_u8:
6973
    Param0 = 1;
6974
    Param1 = Intrinsic::arm_mve_vmulh;
6975
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6976
    break;
6977
  case ARM::BI__builtin_arm_mve_vqshlq_n_s16:
6978
    Param0 = 0;
6979
    Param1 = Intrinsic::arm_mve_vqshl_imm;
6980
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6981
    break;
6982
  case ARM::BI__builtin_arm_mve_vqshlq_n_s32:
6983
    Param0 = 0;
6984
    Param1 = Intrinsic::arm_mve_vqshl_imm;
6985
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
6986
    break;
6987
  case ARM::BI__builtin_arm_mve_vqshlq_n_s8:
6988
    Param0 = 0;
6989
    Param1 = Intrinsic::arm_mve_vqshl_imm;
6990
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
6991
    break;
6992
  case ARM::BI__builtin_arm_mve_vqshlq_n_u16:
6993
    Param0 = 1;
6994
    Param1 = Intrinsic::arm_mve_vqshl_imm;
6995
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
6996
    break;
6997
  case ARM::BI__builtin_arm_mve_vqshlq_n_u32:
6998
    Param0 = 1;
6999
    Param1 = Intrinsic::arm_mve_vqshl_imm;
7000
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7001
    break;
7002
  case ARM::BI__builtin_arm_mve_vqshlq_n_u8:
7003
    Param0 = 1;
7004
    Param1 = Intrinsic::arm_mve_vqshl_imm;
7005
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7006
    break;
7007
  case ARM::BI__builtin_arm_mve_vrhaddq_s16:
7008
    Param0 = 0;
7009
    Param1 = Intrinsic::arm_mve_vrhadd;
7010
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
7011
    break;
7012
  case ARM::BI__builtin_arm_mve_vrhaddq_s32:
7013
    Param0 = 0;
7014
    Param1 = Intrinsic::arm_mve_vrhadd;
7015
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7016
    break;
7017
  case ARM::BI__builtin_arm_mve_vrhaddq_s8:
7018
    Param0 = 0;
7019
    Param1 = Intrinsic::arm_mve_vrhadd;
7020
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7021
    break;
7022
  case ARM::BI__builtin_arm_mve_vrhaddq_u16:
7023
    Param0 = 1;
7024
    Param1 = Intrinsic::arm_mve_vrhadd;
7025
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
7026
    break;
7027
  case ARM::BI__builtin_arm_mve_vrhaddq_u32:
7028
    Param0 = 1;
7029
    Param1 = Intrinsic::arm_mve_vrhadd;
7030
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7031
    break;
7032
  case ARM::BI__builtin_arm_mve_vrhaddq_u8:
7033
    Param0 = 1;
7034
    Param1 = Intrinsic::arm_mve_vrhadd;
7035
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7036
    break;
7037
  case ARM::BI__builtin_arm_mve_vrmulhq_s16:
7038
    Param0 = 0;
7039
    Param1 = Intrinsic::arm_mve_vrmulh;
7040
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
7041
    break;
7042
  case ARM::BI__builtin_arm_mve_vrmulhq_s32:
7043
    Param0 = 0;
7044
    Param1 = Intrinsic::arm_mve_vrmulh;
7045
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7046
    break;
7047
  case ARM::BI__builtin_arm_mve_vrmulhq_s8:
7048
    Param0 = 0;
7049
    Param1 = Intrinsic::arm_mve_vrmulh;
7050
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7051
    break;
7052
  case ARM::BI__builtin_arm_mve_vrmulhq_u16:
7053
    Param0 = 1;
7054
    Param1 = Intrinsic::arm_mve_vrmulh;
7055
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
7056
    break;
7057
  case ARM::BI__builtin_arm_mve_vrmulhq_u32:
7058
    Param0 = 1;
7059
    Param1 = Intrinsic::arm_mve_vrmulh;
7060
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7061
    break;
7062
  case ARM::BI__builtin_arm_mve_vrmulhq_u8:
7063
    Param0 = 1;
7064
    Param1 = Intrinsic::arm_mve_vrmulh;
7065
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7066
    break;
7067
  case ARM::BI__builtin_arm_mve_vrshrq_n_s16:
7068
    Param0 = 0;
7069
    Param1 = Intrinsic::arm_mve_vrshr_imm;
7070
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
7071
    break;
7072
  case ARM::BI__builtin_arm_mve_vrshrq_n_s32:
7073
    Param0 = 0;
7074
    Param1 = Intrinsic::arm_mve_vrshr_imm;
7075
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7076
    break;
7077
  case ARM::BI__builtin_arm_mve_vrshrq_n_s8:
7078
    Param0 = 0;
7079
    Param1 = Intrinsic::arm_mve_vrshr_imm;
7080
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7081
    break;
7082
  case ARM::BI__builtin_arm_mve_vrshrq_n_u16:
7083
    Param0 = 1;
7084
    Param1 = Intrinsic::arm_mve_vrshr_imm;
7085
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
7086
    break;
7087
  case ARM::BI__builtin_arm_mve_vrshrq_n_u32:
7088
    Param0 = 1;
7089
    Param1 = Intrinsic::arm_mve_vrshr_imm;
7090
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7091
    break;
7092
  case ARM::BI__builtin_arm_mve_vrshrq_n_u8:
7093
    Param0 = 1;
7094
    Param1 = Intrinsic::arm_mve_vrshr_imm;
7095
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7096
    break;
7097
  }
7098
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7099
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7100
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
7101
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2}), {Val0, Val1, Val2});
7102
}
7103
case ARM::BI__builtin_arm_mve_vaddq_s16:
7104
case ARM::BI__builtin_arm_mve_vaddq_s32:
7105
case ARM::BI__builtin_arm_mve_vaddq_s8:
7106
case ARM::BI__builtin_arm_mve_vaddq_u16:
7107
case ARM::BI__builtin_arm_mve_vaddq_u32:
7108
case ARM::BI__builtin_arm_mve_vaddq_u8: {
7109
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7110
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7111
  return Builder.CreateAdd(Val0, Val1);
7112
}
7113
case ARM::BI__builtin_arm_mve_vandq_s16:
7114
case ARM::BI__builtin_arm_mve_vandq_s32:
7115
case ARM::BI__builtin_arm_mve_vandq_s8:
7116
case ARM::BI__builtin_arm_mve_vandq_u16:
7117
case ARM::BI__builtin_arm_mve_vandq_u32:
7118
case ARM::BI__builtin_arm_mve_vandq_u8: {
7119
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7120
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7121
  return Builder.CreateAnd(Val0, Val1);
7122
}
7123
case ARM::BI__builtin_arm_mve_vldrdq_gather_base_s64:
7124
case ARM::BI__builtin_arm_mve_vldrdq_gather_base_u64:
7125
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_f32:
7126
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_s32:
7127
case ARM::BI__builtin_arm_mve_vldrwq_gather_base_u32: {
7128
  llvm::Type * Param0;
7129
  llvm::Type * Param1;
7130
  switch (BuiltinID) {
7131
  case ARM::BI__builtin_arm_mve_vldrdq_gather_base_s64:
7132
    Param0 = llvm::FixedVectorType::get(Int64Ty, 2);
7133
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
7134
    break;
7135
  case ARM::BI__builtin_arm_mve_vldrdq_gather_base_u64:
7136
    Param0 = llvm::FixedVectorType::get(Int64Ty, 2);
7137
    Param1 = llvm::FixedVectorType::get(Int64Ty, 2);
7138
    break;
7139
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_f32:
7140
    Param0 = llvm::FixedVectorType::get(FloatTy, 4);
7141
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7142
    break;
7143
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_s32:
7144
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
7145
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7146
    break;
7147
  case ARM::BI__builtin_arm_mve_vldrwq_gather_base_u32:
7148
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
7149
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7150
    break;
7151
  }
7152
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7153
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7154
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vldr_gather_base, {Param0, Param1}), {Val0, Val1});
7155
}
7156
case ARM::BI__builtin_arm_mve_sqrshr:
7157
case ARM::BI__builtin_arm_mve_sqshl:
7158
case ARM::BI__builtin_arm_mve_srshr:
7159
case ARM::BI__builtin_arm_mve_uqrshl:
7160
case ARM::BI__builtin_arm_mve_uqshl:
7161
case ARM::BI__builtin_arm_mve_urshr: {
7162
  Intrinsic::ID  Param0;
7163
  switch (BuiltinID) {
7164
  case ARM::BI__builtin_arm_mve_sqrshr:
7165
    Param0 = Intrinsic::arm_mve_sqrshr;
7166
    break;
7167
  case ARM::BI__builtin_arm_mve_sqshl:
7168
    Param0 = Intrinsic::arm_mve_sqshl;
7169
    break;
7170
  case ARM::BI__builtin_arm_mve_srshr:
7171
    Param0 = Intrinsic::arm_mve_srshr;
7172
    break;
7173
  case ARM::BI__builtin_arm_mve_uqrshl:
7174
    Param0 = Intrinsic::arm_mve_uqrshl;
7175
    break;
7176
  case ARM::BI__builtin_arm_mve_uqshl:
7177
    Param0 = Intrinsic::arm_mve_uqshl;
7178
    break;
7179
  case ARM::BI__builtin_arm_mve_urshr:
7180
    Param0 = Intrinsic::arm_mve_urshr;
7181
    break;
7182
  }
7183
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7184
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7185
  return Builder.CreateCall(CGM.getIntrinsic(Param0), {Val0, Val1});
7186
}
7187
case ARM::BI__builtin_arm_mve_vbrsrq_n_f16:
7188
case ARM::BI__builtin_arm_mve_vbrsrq_n_f32:
7189
case ARM::BI__builtin_arm_mve_vbrsrq_n_s16:
7190
case ARM::BI__builtin_arm_mve_vbrsrq_n_s32:
7191
case ARM::BI__builtin_arm_mve_vbrsrq_n_s8:
7192
case ARM::BI__builtin_arm_mve_vbrsrq_n_u16:
7193
case ARM::BI__builtin_arm_mve_vbrsrq_n_u32:
7194
case ARM::BI__builtin_arm_mve_vbrsrq_n_u8:
7195
case ARM::BI__builtin_arm_mve_vmaxnmq_f16:
7196
case ARM::BI__builtin_arm_mve_vmaxnmq_f32:
7197
case ARM::BI__builtin_arm_mve_vminnmq_f16:
7198
case ARM::BI__builtin_arm_mve_vminnmq_f32:
7199
case ARM::BI__builtin_arm_mve_vqaddq_s16:
7200
case ARM::BI__builtin_arm_mve_vqaddq_s32:
7201
case ARM::BI__builtin_arm_mve_vqaddq_s8:
7202
case ARM::BI__builtin_arm_mve_vqaddq_u16:
7203
case ARM::BI__builtin_arm_mve_vqaddq_u32:
7204
case ARM::BI__builtin_arm_mve_vqaddq_u8:
7205
case ARM::BI__builtin_arm_mve_vqdmulhq_s16:
7206
case ARM::BI__builtin_arm_mve_vqdmulhq_s32:
7207
case ARM::BI__builtin_arm_mve_vqdmulhq_s8:
7208
case ARM::BI__builtin_arm_mve_vqrdmulhq_s16:
7209
case ARM::BI__builtin_arm_mve_vqrdmulhq_s32:
7210
case ARM::BI__builtin_arm_mve_vqrdmulhq_s8:
7211
case ARM::BI__builtin_arm_mve_vqshluq_n_s16:
7212
case ARM::BI__builtin_arm_mve_vqshluq_n_s32:
7213
case ARM::BI__builtin_arm_mve_vqshluq_n_s8:
7214
case ARM::BI__builtin_arm_mve_vqsubq_s16:
7215
case ARM::BI__builtin_arm_mve_vqsubq_s32:
7216
case ARM::BI__builtin_arm_mve_vqsubq_s8:
7217
case ARM::BI__builtin_arm_mve_vqsubq_u16:
7218
case ARM::BI__builtin_arm_mve_vqsubq_u32:
7219
case ARM::BI__builtin_arm_mve_vqsubq_u8: {
7220
  Intrinsic::ID  Param0;
7221
  llvm::Type * Param1;
7222
  switch (BuiltinID) {
7223
  case ARM::BI__builtin_arm_mve_vbrsrq_n_f16:
7224
    Param0 = Intrinsic::arm_mve_vbrsr;
7225
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
7226
    break;
7227
  case ARM::BI__builtin_arm_mve_vbrsrq_n_f32:
7228
    Param0 = Intrinsic::arm_mve_vbrsr;
7229
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
7230
    break;
7231
  case ARM::BI__builtin_arm_mve_vbrsrq_n_s16:
7232
    Param0 = Intrinsic::arm_mve_vbrsr;
7233
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7234
    break;
7235
  case ARM::BI__builtin_arm_mve_vbrsrq_n_s32:
7236
    Param0 = Intrinsic::arm_mve_vbrsr;
7237
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7238
    break;
7239
  case ARM::BI__builtin_arm_mve_vbrsrq_n_s8:
7240
    Param0 = Intrinsic::arm_mve_vbrsr;
7241
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7242
    break;
7243
  case ARM::BI__builtin_arm_mve_vbrsrq_n_u16:
7244
    Param0 = Intrinsic::arm_mve_vbrsr;
7245
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7246
    break;
7247
  case ARM::BI__builtin_arm_mve_vbrsrq_n_u32:
7248
    Param0 = Intrinsic::arm_mve_vbrsr;
7249
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7250
    break;
7251
  case ARM::BI__builtin_arm_mve_vbrsrq_n_u8:
7252
    Param0 = Intrinsic::arm_mve_vbrsr;
7253
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7254
    break;
7255
  case ARM::BI__builtin_arm_mve_vmaxnmq_f16:
7256
    Param0 = Intrinsic::maxnum;
7257
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
7258
    break;
7259
  case ARM::BI__builtin_arm_mve_vmaxnmq_f32:
7260
    Param0 = Intrinsic::maxnum;
7261
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
7262
    break;
7263
  case ARM::BI__builtin_arm_mve_vminnmq_f16:
7264
    Param0 = Intrinsic::minnum;
7265
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
7266
    break;
7267
  case ARM::BI__builtin_arm_mve_vminnmq_f32:
7268
    Param0 = Intrinsic::minnum;
7269
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
7270
    break;
7271
  case ARM::BI__builtin_arm_mve_vqaddq_s16:
7272
    Param0 = Intrinsic::sadd_sat;
7273
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7274
    break;
7275
  case ARM::BI__builtin_arm_mve_vqaddq_s32:
7276
    Param0 = Intrinsic::sadd_sat;
7277
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7278
    break;
7279
  case ARM::BI__builtin_arm_mve_vqaddq_s8:
7280
    Param0 = Intrinsic::sadd_sat;
7281
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7282
    break;
7283
  case ARM::BI__builtin_arm_mve_vqaddq_u16:
7284
    Param0 = Intrinsic::uadd_sat;
7285
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7286
    break;
7287
  case ARM::BI__builtin_arm_mve_vqaddq_u32:
7288
    Param0 = Intrinsic::uadd_sat;
7289
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7290
    break;
7291
  case ARM::BI__builtin_arm_mve_vqaddq_u8:
7292
    Param0 = Intrinsic::uadd_sat;
7293
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7294
    break;
7295
  case ARM::BI__builtin_arm_mve_vqdmulhq_s16:
7296
    Param0 = Intrinsic::arm_mve_vqdmulh;
7297
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7298
    break;
7299
  case ARM::BI__builtin_arm_mve_vqdmulhq_s32:
7300
    Param0 = Intrinsic::arm_mve_vqdmulh;
7301
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7302
    break;
7303
  case ARM::BI__builtin_arm_mve_vqdmulhq_s8:
7304
    Param0 = Intrinsic::arm_mve_vqdmulh;
7305
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7306
    break;
7307
  case ARM::BI__builtin_arm_mve_vqrdmulhq_s16:
7308
    Param0 = Intrinsic::arm_mve_vqrdmulh;
7309
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7310
    break;
7311
  case ARM::BI__builtin_arm_mve_vqrdmulhq_s32:
7312
    Param0 = Intrinsic::arm_mve_vqrdmulh;
7313
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7314
    break;
7315
  case ARM::BI__builtin_arm_mve_vqrdmulhq_s8:
7316
    Param0 = Intrinsic::arm_mve_vqrdmulh;
7317
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7318
    break;
7319
  case ARM::BI__builtin_arm_mve_vqshluq_n_s16:
7320
    Param0 = Intrinsic::arm_mve_vqshlu_imm;
7321
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7322
    break;
7323
  case ARM::BI__builtin_arm_mve_vqshluq_n_s32:
7324
    Param0 = Intrinsic::arm_mve_vqshlu_imm;
7325
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7326
    break;
7327
  case ARM::BI__builtin_arm_mve_vqshluq_n_s8:
7328
    Param0 = Intrinsic::arm_mve_vqshlu_imm;
7329
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7330
    break;
7331
  case ARM::BI__builtin_arm_mve_vqsubq_s16:
7332
    Param0 = Intrinsic::ssub_sat;
7333
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7334
    break;
7335
  case ARM::BI__builtin_arm_mve_vqsubq_s32:
7336
    Param0 = Intrinsic::ssub_sat;
7337
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7338
    break;
7339
  case ARM::BI__builtin_arm_mve_vqsubq_s8:
7340
    Param0 = Intrinsic::ssub_sat;
7341
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7342
    break;
7343
  case ARM::BI__builtin_arm_mve_vqsubq_u16:
7344
    Param0 = Intrinsic::usub_sat;
7345
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
7346
    break;
7347
  case ARM::BI__builtin_arm_mve_vqsubq_u32:
7348
    Param0 = Intrinsic::usub_sat;
7349
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
7350
    break;
7351
  case ARM::BI__builtin_arm_mve_vqsubq_u8:
7352
    Param0 = Intrinsic::usub_sat;
7353
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
7354
    break;
7355
  }
7356
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7357
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7358
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val0, Val1});
7359
}
7360
case ARM::BI__builtin_arm_mve_vgetq_lane_f16:
7361
case ARM::BI__builtin_arm_mve_vgetq_lane_f32:
7362
case ARM::BI__builtin_arm_mve_vgetq_lane_s16:
7363
case ARM::BI__builtin_arm_mve_vgetq_lane_s32:
7364
case ARM::BI__builtin_arm_mve_vgetq_lane_s64:
7365
case ARM::BI__builtin_arm_mve_vgetq_lane_s8:
7366
case ARM::BI__builtin_arm_mve_vgetq_lane_u16:
7367
case ARM::BI__builtin_arm_mve_vgetq_lane_u32:
7368
case ARM::BI__builtin_arm_mve_vgetq_lane_u64:
7369
case ARM::BI__builtin_arm_mve_vgetq_lane_u8: {
7370
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7371
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7372
  return Builder.CreateExtractElement(Val0, Val1);
7373
}
7374
case ARM::BI__builtin_arm_mve_vaddq_f16:
7375
case ARM::BI__builtin_arm_mve_vaddq_f32: {
7376
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7377
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7378
  return Builder.CreateFAdd(Val0, Val1);
7379
}
7380
case ARM::BI__builtin_arm_mve_vmulq_f16:
7381
case ARM::BI__builtin_arm_mve_vmulq_f32: {
7382
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7383
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7384
  return Builder.CreateFMul(Val0, Val1);
7385
}
7386
case ARM::BI__builtin_arm_mve_vsubq_f16:
7387
case ARM::BI__builtin_arm_mve_vsubq_f32: {
7388
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7389
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7390
  return Builder.CreateFSub(Val0, Val1);
7391
}
7392
case ARM::BI__builtin_arm_mve_vmulq_s16:
7393
case ARM::BI__builtin_arm_mve_vmulq_s32:
7394
case ARM::BI__builtin_arm_mve_vmulq_s8:
7395
case ARM::BI__builtin_arm_mve_vmulq_u16:
7396
case ARM::BI__builtin_arm_mve_vmulq_u32:
7397
case ARM::BI__builtin_arm_mve_vmulq_u8: {
7398
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7399
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7400
  return Builder.CreateMul(Val0, Val1);
7401
}
7402
case ARM::BI__builtin_arm_mve_vorrq_s16:
7403
case ARM::BI__builtin_arm_mve_vorrq_s32:
7404
case ARM::BI__builtin_arm_mve_vorrq_s8:
7405
case ARM::BI__builtin_arm_mve_vorrq_u16:
7406
case ARM::BI__builtin_arm_mve_vorrq_u32:
7407
case ARM::BI__builtin_arm_mve_vorrq_u8: {
7408
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7409
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7410
  return Builder.CreateOr(Val0, Val1);
7411
}
7412
case ARM::BI__builtin_arm_mve_vsubq_s16:
7413
case ARM::BI__builtin_arm_mve_vsubq_s32:
7414
case ARM::BI__builtin_arm_mve_vsubq_s8:
7415
case ARM::BI__builtin_arm_mve_vsubq_u16:
7416
case ARM::BI__builtin_arm_mve_vsubq_u32:
7417
case ARM::BI__builtin_arm_mve_vsubq_u8: {
7418
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7419
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7420
  return Builder.CreateSub(Val0, Val1);
7421
}
7422
case ARM::BI__builtin_arm_mve_veorq_s16:
7423
case ARM::BI__builtin_arm_mve_veorq_s32:
7424
case ARM::BI__builtin_arm_mve_veorq_s8:
7425
case ARM::BI__builtin_arm_mve_veorq_u16:
7426
case ARM::BI__builtin_arm_mve_veorq_u32:
7427
case ARM::BI__builtin_arm_mve_veorq_u8: {
7428
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7429
  Value *Val1 = EmitScalarExpr(E->getArg(1));
7430
  return Builder.CreateXor(Val0, Val1);
7431
}
7432
case ARM::BI__builtin_arm_mve_vmovlbq_s8:
7433
case ARM::BI__builtin_arm_mve_vmovlbq_u8:
7434
case ARM::BI__builtin_arm_mve_vmovltq_s8:
7435
case ARM::BI__builtin_arm_mve_vmovltq_u8: {
7436
  bool  Param0;
7437
  bool  Param1;
7438
  switch (BuiltinID) {
7439
  case ARM::BI__builtin_arm_mve_vmovlbq_s8:
7440
    Param0 = 0;
7441
    Param1 = 0;
7442
    break;
7443
  case ARM::BI__builtin_arm_mve_vmovlbq_u8:
7444
    Param0 = 0;
7445
    Param1 = 1;
7446
    break;
7447
  case ARM::BI__builtin_arm_mve_vmovltq_s8:
7448
    Param0 = 1;
7449
    Param1 = 0;
7450
    break;
7451
  case ARM::BI__builtin_arm_mve_vmovltq_u8:
7452
    Param0 = 1;
7453
    Param1 = 1;
7454
    break;
7455
  }
7456
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7457
  Value *Val1 = VectorUnzip(Builder, Val0, static_cast<bool>(Param0));
7458
  llvm::Type *Val2 = llvm::FixedVectorType::get(Int16Ty, 8);
7459
  return SignOrZeroExtend(Builder, Val1, Val2, static_cast<bool>(Param1));
7460
}
7461
case ARM::BI__builtin_arm_mve_vmovlbq_s16:
7462
case ARM::BI__builtin_arm_mve_vmovlbq_u16:
7463
case ARM::BI__builtin_arm_mve_vmovltq_s16:
7464
case ARM::BI__builtin_arm_mve_vmovltq_u16: {
7465
  bool  Param0;
7466
  bool  Param1;
7467
  switch (BuiltinID) {
7468
  case ARM::BI__builtin_arm_mve_vmovlbq_s16:
7469
    Param0 = 0;
7470
    Param1 = 0;
7471
    break;
7472
  case ARM::BI__builtin_arm_mve_vmovlbq_u16:
7473
    Param0 = 0;
7474
    Param1 = 1;
7475
    break;
7476
  case ARM::BI__builtin_arm_mve_vmovltq_s16:
7477
    Param0 = 1;
7478
    Param1 = 0;
7479
    break;
7480
  case ARM::BI__builtin_arm_mve_vmovltq_u16:
7481
    Param0 = 1;
7482
    Param1 = 1;
7483
    break;
7484
  }
7485
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7486
  Value *Val1 = VectorUnzip(Builder, Val0, static_cast<bool>(Param0));
7487
  llvm::Type *Val2 = llvm::FixedVectorType::get(Int32Ty, 4);
7488
  return SignOrZeroExtend(Builder, Val1, Val2, static_cast<bool>(Param1));
7489
}
7490
case ARM::BI__builtin_arm_mve_vclzq_s16:
7491
case ARM::BI__builtin_arm_mve_vclzq_s32:
7492
case ARM::BI__builtin_arm_mve_vclzq_s8:
7493
case ARM::BI__builtin_arm_mve_vclzq_u16:
7494
case ARM::BI__builtin_arm_mve_vclzq_u32:
7495
case ARM::BI__builtin_arm_mve_vclzq_u8: {
7496
  llvm::Type * Param0;
7497
  switch (BuiltinID) {
7498
  case ARM::BI__builtin_arm_mve_vclzq_s16:
7499
    Param0 = llvm::FixedVectorType::get(Int16Ty, 8);
7500
    break;
7501
  case ARM::BI__builtin_arm_mve_vclzq_s32:
7502
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
7503
    break;
7504
  case ARM::BI__builtin_arm_mve_vclzq_s8:
7505
    Param0 = llvm::FixedVectorType::get(Int8Ty, 16);
7506
    break;
7507
  case ARM::BI__builtin_arm_mve_vclzq_u16:
7508
    Param0 = llvm::FixedVectorType::get(Int16Ty, 8);
7509
    break;
7510
  case ARM::BI__builtin_arm_mve_vclzq_u32:
7511
    Param0 = llvm::FixedVectorType::get(Int32Ty, 4);
7512
    break;
7513
  case ARM::BI__builtin_arm_mve_vclzq_u8:
7514
    Param0 = llvm::FixedVectorType::get(Int8Ty, 16);
7515
    break;
7516
  }
7517
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7518
  Value *Val1 = llvm::ConstantInt::get(Builder.getInt1Ty(), static_cast<bool>(0));
7519
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::ctlz, {Param0}), {Val0, Val1});
7520
}
7521
case ARM::BI__builtin_arm_mve_vpnot: {
7522
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7523
  Value *Val1 = llvm::ConstantInt::get(Int16Ty, 65535);
7524
  return Builder.CreateXor(Val0, Val1);
7525
}
7526
case ARM::BI__builtin_arm_mve_vaddlvq_p_s32:
7527
case ARM::BI__builtin_arm_mve_vaddlvq_p_u32:
7528
case ARM::BI__builtin_arm_mve_vaddvq_p_s16:
7529
case ARM::BI__builtin_arm_mve_vaddvq_p_s32:
7530
case ARM::BI__builtin_arm_mve_vaddvq_p_s8:
7531
case ARM::BI__builtin_arm_mve_vaddvq_p_u16:
7532
case ARM::BI__builtin_arm_mve_vaddvq_p_u32:
7533
case ARM::BI__builtin_arm_mve_vaddvq_p_u8: {
7534
  uint32_t  Param0;
7535
  llvm::Type * Param1;
7536
  Intrinsic::ID  Param2;
7537
  llvm::Type * Param3;
7538
  switch (BuiltinID) {
7539
  case ARM::BI__builtin_arm_mve_vaddlvq_p_s32:
7540
    Param0 = 0;
7541
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
7542
    Param2 = Intrinsic::arm_mve_addlv_predicated;
7543
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
7544
    break;
7545
  case ARM::BI__builtin_arm_mve_vaddlvq_p_u32:
7546
    Param0 = 1;
7547
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
7548
    Param2 = Intrinsic::arm_mve_addlv_predicated;
7549
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
7550
    break;
7551
  case ARM::BI__builtin_arm_mve_vaddvq_p_s16:
7552
    Param0 = 0;
7553
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
7554
    Param2 = Intrinsic::arm_mve_addv_predicated;
7555
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
7556
    break;
7557
  case ARM::BI__builtin_arm_mve_vaddvq_p_s32:
7558
    Param0 = 0;
7559
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
7560
    Param2 = Intrinsic::arm_mve_addv_predicated;
7561
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
7562
    break;
7563
  case ARM::BI__builtin_arm_mve_vaddvq_p_s8:
7564
    Param0 = 0;
7565
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
7566
    Param2 = Intrinsic::arm_mve_addv_predicated;
7567
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
7568
    break;
7569
  case ARM::BI__builtin_arm_mve_vaddvq_p_u16:
7570
    Param0 = 1;
7571
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
7572
    Param2 = Intrinsic::arm_mve_addv_predicated;
7573
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
7574
    break;
7575
  case ARM::BI__builtin_arm_mve_vaddvq_p_u32:
7576
    Param0 = 1;
7577
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
7578
    Param2 = Intrinsic::arm_mve_addv_predicated;
7579
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
7580
    break;
7581
  case ARM::BI__builtin_arm_mve_vaddvq_p_u8:
7582
    Param0 = 1;
7583
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
7584
    Param2 = Intrinsic::arm_mve_addv_predicated;
7585
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
7586
    break;
7587
  }
7588
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7589
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param0);
7590
  Value *Val2 = EmitScalarExpr(E->getArg(1));
7591
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
7592
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val3});
7593
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param1}), {Val0, Val1, Val4});
7594
}
7595
case ARM::BI__builtin_arm_mve_vcvtbq_f32_f16:
7596
case ARM::BI__builtin_arm_mve_vcvttq_f32_f16: {
7597
  uint32_t  Param0;
7598
  switch (BuiltinID) {
7599
  case ARM::BI__builtin_arm_mve_vcvtbq_f32_f16:
7600
    Param0 = 0;
7601
    break;
7602
  case ARM::BI__builtin_arm_mve_vcvttq_f32_f16:
7603
    Param0 = 1;
7604
    break;
7605
  }
7606
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7607
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param0);
7608
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_widen), {Val0, Val1});
7609
}
7610
case ARM::BI__builtin_arm_mve_vaddlvq_s32:
7611
case ARM::BI__builtin_arm_mve_vaddlvq_u32:
7612
case ARM::BI__builtin_arm_mve_vaddvq_s16:
7613
case ARM::BI__builtin_arm_mve_vaddvq_s32:
7614
case ARM::BI__builtin_arm_mve_vaddvq_s8:
7615
case ARM::BI__builtin_arm_mve_vaddvq_u16:
7616
case ARM::BI__builtin_arm_mve_vaddvq_u32:
7617
case ARM::BI__builtin_arm_mve_vaddvq_u8: {
7618
  uint32_t  Param0;
7619
  Intrinsic::ID  Param1;
7620
  llvm::Type * Param2;
7621
  switch (BuiltinID) {
7622
  case ARM::BI__builtin_arm_mve_vaddlvq_s32:
7623
    Param0 = 0;
7624
    Param1 = Intrinsic::arm_mve_addlv;
7625
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7626
    break;
7627
  case ARM::BI__builtin_arm_mve_vaddlvq_u32:
7628
    Param0 = 1;
7629
    Param1 = Intrinsic::arm_mve_addlv;
7630
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7631
    break;
7632
  case ARM::BI__builtin_arm_mve_vaddvq_s16:
7633
    Param0 = 0;
7634
    Param1 = Intrinsic::arm_mve_addv;
7635
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
7636
    break;
7637
  case ARM::BI__builtin_arm_mve_vaddvq_s32:
7638
    Param0 = 0;
7639
    Param1 = Intrinsic::arm_mve_addv;
7640
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7641
    break;
7642
  case ARM::BI__builtin_arm_mve_vaddvq_s8:
7643
    Param0 = 0;
7644
    Param1 = Intrinsic::arm_mve_addv;
7645
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7646
    break;
7647
  case ARM::BI__builtin_arm_mve_vaddvq_u16:
7648
    Param0 = 1;
7649
    Param1 = Intrinsic::arm_mve_addv;
7650
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
7651
    break;
7652
  case ARM::BI__builtin_arm_mve_vaddvq_u32:
7653
    Param0 = 1;
7654
    Param1 = Intrinsic::arm_mve_addv;
7655
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
7656
    break;
7657
  case ARM::BI__builtin_arm_mve_vaddvq_u8:
7658
    Param0 = 1;
7659
    Param1 = Intrinsic::arm_mve_addv;
7660
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
7661
    break;
7662
  }
7663
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7664
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param0);
7665
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2}), {Val0, Val1});
7666
}
7667
case ARM::BI__builtin_arm_mve_asrl:
7668
case ARM::BI__builtin_arm_mve_lsll:
7669
case ARM::BI__builtin_arm_mve_sqshll:
7670
case ARM::BI__builtin_arm_mve_srshrl:
7671
case ARM::BI__builtin_arm_mve_uqshll:
7672
case ARM::BI__builtin_arm_mve_urshrl: {
7673
  Intrinsic::ID  Param0;
7674
  switch (BuiltinID) {
7675
  case ARM::BI__builtin_arm_mve_asrl:
7676
    Param0 = Intrinsic::arm_mve_asrl;
7677
    break;
7678
  case ARM::BI__builtin_arm_mve_lsll:
7679
    Param0 = Intrinsic::arm_mve_lsll;
7680
    break;
7681
  case ARM::BI__builtin_arm_mve_sqshll:
7682
    Param0 = Intrinsic::arm_mve_sqshll;
7683
    break;
7684
  case ARM::BI__builtin_arm_mve_srshrl:
7685
    Param0 = Intrinsic::arm_mve_srshrl;
7686
    break;
7687
  case ARM::BI__builtin_arm_mve_uqshll:
7688
    Param0 = Intrinsic::arm_mve_uqshll;
7689
    break;
7690
  case ARM::BI__builtin_arm_mve_urshrl:
7691
    Param0 = Intrinsic::arm_mve_urshrl;
7692
    break;
7693
  }
7694
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7695
  Value *Val1 = llvm::ConstantInt::get(Int64Ty, 32);
7696
  Value *Val2 = Builder.CreateLShr(Val0, Val1);
7697
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
7698
  Value *Val4 = Builder.CreateIntCast(Val0, Int32Ty, false);
7699
  Value *Val5 = EmitScalarExpr(E->getArg(1));
7700
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Param0), {Val4, Val3, Val5});
7701
  Value *Val7 = Builder.CreateExtractValue(Val6, static_cast<unsigned>(1));
7702
  Value *Val8 = Builder.CreateIntCast(Val7, Int64Ty, false);
7703
  Value *Val9 = llvm::ConstantInt::get(Int64Ty, 32);
7704
  Value *Val10 = Builder.CreateShl(Val8, Val9);
7705
  Value *Val11 = Builder.CreateExtractValue(Val6, static_cast<unsigned>(0));
7706
  Value *Val12 = Builder.CreateIntCast(Val11, Int64Ty, false);
7707
  return Builder.CreateOr(Val10, Val12);
7708
}
7709
case ARM::BI__builtin_arm_mve_sqrshrl:
7710
case ARM::BI__builtin_arm_mve_sqrshrl_sat48: {
7711
  uint32_t  Param0;
7712
  switch (BuiltinID) {
7713
  case ARM::BI__builtin_arm_mve_sqrshrl:
7714
    Param0 = 64;
7715
    break;
7716
  case ARM::BI__builtin_arm_mve_sqrshrl_sat48:
7717
    Param0 = 48;
7718
    break;
7719
  }
7720
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7721
  Value *Val1 = llvm::ConstantInt::get(Int64Ty, 32);
7722
  Value *Val2 = Builder.CreateLShr(Val0, Val1);
7723
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
7724
  Value *Val4 = Builder.CreateIntCast(Val0, Int32Ty, false);
7725
  Value *Val5 = EmitScalarExpr(E->getArg(1));
7726
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param0);
7727
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_sqrshrl), {Val4, Val3, Val5, Val6});
7728
  Value *Val8 = Builder.CreateExtractValue(Val7, static_cast<unsigned>(1));
7729
  Value *Val9 = Builder.CreateIntCast(Val8, Int64Ty, false);
7730
  Value *Val10 = llvm::ConstantInt::get(Int64Ty, 32);
7731
  Value *Val11 = Builder.CreateShl(Val9, Val10);
7732
  Value *Val12 = Builder.CreateExtractValue(Val7, static_cast<unsigned>(0));
7733
  Value *Val13 = Builder.CreateIntCast(Val12, Int64Ty, false);
7734
  return Builder.CreateOr(Val11, Val13);
7735
}
7736
case ARM::BI__builtin_arm_mve_uqrshll:
7737
case ARM::BI__builtin_arm_mve_uqrshll_sat48: {
7738
  uint32_t  Param0;
7739
  switch (BuiltinID) {
7740
  case ARM::BI__builtin_arm_mve_uqrshll:
7741
    Param0 = 64;
7742
    break;
7743
  case ARM::BI__builtin_arm_mve_uqrshll_sat48:
7744
    Param0 = 48;
7745
    break;
7746
  }
7747
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7748
  Value *Val1 = llvm::ConstantInt::get(Int64Ty, 32);
7749
  Value *Val2 = Builder.CreateLShr(Val0, Val1);
7750
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
7751
  Value *Val4 = Builder.CreateIntCast(Val0, Int32Ty, false);
7752
  Value *Val5 = EmitScalarExpr(E->getArg(1));
7753
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param0);
7754
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_uqrshll), {Val4, Val3, Val5, Val6});
7755
  Value *Val8 = Builder.CreateExtractValue(Val7, static_cast<unsigned>(1));
7756
  Value *Val9 = Builder.CreateIntCast(Val8, Int64Ty, false);
7757
  Value *Val10 = llvm::ConstantInt::get(Int64Ty, 32);
7758
  Value *Val11 = Builder.CreateShl(Val9, Val10);
7759
  Value *Val12 = Builder.CreateExtractValue(Val7, static_cast<unsigned>(0));
7760
  Value *Val13 = Builder.CreateIntCast(Val12, Int64Ty, false);
7761
  return Builder.CreateOr(Val11, Val13);
7762
}
7763
case ARM::BI__builtin_arm_mve_vmlaldavaq_s16:
7764
case ARM::BI__builtin_arm_mve_vmlaldavaq_s32:
7765
case ARM::BI__builtin_arm_mve_vmlaldavaq_u16:
7766
case ARM::BI__builtin_arm_mve_vmlaldavaq_u32:
7767
case ARM::BI__builtin_arm_mve_vmlaldavaxq_s16:
7768
case ARM::BI__builtin_arm_mve_vmlaldavaxq_s32:
7769
case ARM::BI__builtin_arm_mve_vmlsldavaq_s16:
7770
case ARM::BI__builtin_arm_mve_vmlsldavaq_s32:
7771
case ARM::BI__builtin_arm_mve_vmlsldavaxq_s16:
7772
case ARM::BI__builtin_arm_mve_vmlsldavaxq_s32:
7773
case ARM::BI__builtin_arm_mve_vrmlaldavhaq_s32:
7774
case ARM::BI__builtin_arm_mve_vrmlaldavhaq_u32:
7775
case ARM::BI__builtin_arm_mve_vrmlaldavhaxq_s32:
7776
case ARM::BI__builtin_arm_mve_vrmlsldavhaq_s32:
7777
case ARM::BI__builtin_arm_mve_vrmlsldavhaxq_s32: {
7778
  uint32_t  Param0;
7779
  uint32_t  Param1;
7780
  uint32_t  Param2;
7781
  Intrinsic::ID  Param3;
7782
  llvm::Type * Param4;
7783
  switch (BuiltinID) {
7784
  case ARM::BI__builtin_arm_mve_vmlaldavaq_s16:
7785
    Param0 = 0;
7786
    Param1 = 0;
7787
    Param2 = 0;
7788
    Param3 = Intrinsic::arm_mve_vmlldava;
7789
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
7790
    break;
7791
  case ARM::BI__builtin_arm_mve_vmlaldavaq_s32:
7792
    Param0 = 0;
7793
    Param1 = 0;
7794
    Param2 = 0;
7795
    Param3 = Intrinsic::arm_mve_vmlldava;
7796
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7797
    break;
7798
  case ARM::BI__builtin_arm_mve_vmlaldavaq_u16:
7799
    Param0 = 1;
7800
    Param1 = 0;
7801
    Param2 = 0;
7802
    Param3 = Intrinsic::arm_mve_vmlldava;
7803
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
7804
    break;
7805
  case ARM::BI__builtin_arm_mve_vmlaldavaq_u32:
7806
    Param0 = 1;
7807
    Param1 = 0;
7808
    Param2 = 0;
7809
    Param3 = Intrinsic::arm_mve_vmlldava;
7810
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7811
    break;
7812
  case ARM::BI__builtin_arm_mve_vmlaldavaxq_s16:
7813
    Param0 = 0;
7814
    Param1 = 0;
7815
    Param2 = 1;
7816
    Param3 = Intrinsic::arm_mve_vmlldava;
7817
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
7818
    break;
7819
  case ARM::BI__builtin_arm_mve_vmlaldavaxq_s32:
7820
    Param0 = 0;
7821
    Param1 = 0;
7822
    Param2 = 1;
7823
    Param3 = Intrinsic::arm_mve_vmlldava;
7824
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7825
    break;
7826
  case ARM::BI__builtin_arm_mve_vmlsldavaq_s16:
7827
    Param0 = 0;
7828
    Param1 = 1;
7829
    Param2 = 0;
7830
    Param3 = Intrinsic::arm_mve_vmlldava;
7831
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
7832
    break;
7833
  case ARM::BI__builtin_arm_mve_vmlsldavaq_s32:
7834
    Param0 = 0;
7835
    Param1 = 1;
7836
    Param2 = 0;
7837
    Param3 = Intrinsic::arm_mve_vmlldava;
7838
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7839
    break;
7840
  case ARM::BI__builtin_arm_mve_vmlsldavaxq_s16:
7841
    Param0 = 0;
7842
    Param1 = 1;
7843
    Param2 = 1;
7844
    Param3 = Intrinsic::arm_mve_vmlldava;
7845
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
7846
    break;
7847
  case ARM::BI__builtin_arm_mve_vmlsldavaxq_s32:
7848
    Param0 = 0;
7849
    Param1 = 1;
7850
    Param2 = 1;
7851
    Param3 = Intrinsic::arm_mve_vmlldava;
7852
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7853
    break;
7854
  case ARM::BI__builtin_arm_mve_vrmlaldavhaq_s32:
7855
    Param0 = 0;
7856
    Param1 = 0;
7857
    Param2 = 0;
7858
    Param3 = Intrinsic::arm_mve_vrmlldavha;
7859
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7860
    break;
7861
  case ARM::BI__builtin_arm_mve_vrmlaldavhaq_u32:
7862
    Param0 = 1;
7863
    Param1 = 0;
7864
    Param2 = 0;
7865
    Param3 = Intrinsic::arm_mve_vrmlldavha;
7866
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7867
    break;
7868
  case ARM::BI__builtin_arm_mve_vrmlaldavhaxq_s32:
7869
    Param0 = 0;
7870
    Param1 = 0;
7871
    Param2 = 1;
7872
    Param3 = Intrinsic::arm_mve_vrmlldavha;
7873
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7874
    break;
7875
  case ARM::BI__builtin_arm_mve_vrmlsldavhaq_s32:
7876
    Param0 = 0;
7877
    Param1 = 1;
7878
    Param2 = 0;
7879
    Param3 = Intrinsic::arm_mve_vrmlldavha;
7880
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7881
    break;
7882
  case ARM::BI__builtin_arm_mve_vrmlsldavhaxq_s32:
7883
    Param0 = 0;
7884
    Param1 = 1;
7885
    Param2 = 1;
7886
    Param3 = Intrinsic::arm_mve_vrmlldavha;
7887
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
7888
    break;
7889
  }
7890
  Value *Val0 = EmitScalarExpr(E->getArg(0));
7891
  Value *Val1 = llvm::ConstantInt::get(Int64Ty, 32);
7892
  Value *Val2 = Builder.CreateLShr(Val0, Val1);
7893
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
7894
  Value *Val4 = Builder.CreateIntCast(Val0, Int32Ty, false);
7895
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param0);
7896
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param1);
7897
  Value *Val7 = llvm::ConstantInt::get(Int32Ty, Param2);
7898
  Value *Val8 = EmitScalarExpr(E->getArg(1));
7899
  Value *Val9 = EmitScalarExpr(E->getArg(2));
7900
  Value *Val10 = Builder.CreateCall(CGM.getIntrinsic(Param3, {Param4}), {Val5, Val6, Val7, Val4, Val3, Val8, Val9});
7901
  Value *Val11 = Builder.CreateExtractValue(Val10, static_cast<unsigned>(1));
7902
  Value *Val12 = Builder.CreateIntCast(Val11, Int64Ty, false);
7903
  Value *Val13 = llvm::ConstantInt::get(Int64Ty, 32);
7904
  Value *Val14 = Builder.CreateShl(Val12, Val13);
7905
  Value *Val15 = Builder.CreateExtractValue(Val10, static_cast<unsigned>(0));
7906
  Value *Val16 = Builder.CreateIntCast(Val15, Int64Ty, false);
7907
  return Builder.CreateOr(Val14, Val16);
7908
}
7909
case ARM::BI__builtin_arm_mve_vmlaldavaq_p_s16:
7910
case ARM::BI__builtin_arm_mve_vmlaldavaq_p_s32:
7911
case ARM::BI__builtin_arm_mve_vmlaldavaq_p_u16:
7912
case ARM::BI__builtin_arm_mve_vmlaldavaq_p_u32:
7913
case ARM::BI__builtin_arm_mve_vmlaldavaxq_p_s16:
7914
case ARM::BI__builtin_arm_mve_vmlaldavaxq_p_s32:
7915
case ARM::BI__builtin_arm_mve_vmlsldavaq_p_s16:
7916
case ARM::BI__builtin_arm_mve_vmlsldavaq_p_s32:
7917
case ARM::BI__builtin_arm_mve_vmlsldavaxq_p_s16:
7918
case ARM::BI__builtin_arm_mve_vmlsldavaxq_p_s32:
7919
case ARM::BI__builtin_arm_mve_vrmlaldavhaq_p_s32:
7920
case ARM::BI__builtin_arm_mve_vrmlaldavhaq_p_u32:
7921
case ARM::BI__builtin_arm_mve_vrmlaldavhaxq_p_s32:
7922
case ARM::BI__builtin_arm_mve_vrmlsldavhaq_p_s32:
7923
case ARM::BI__builtin_arm_mve_vrmlsldavhaxq_p_s32: {
7924
  uint32_t  Param0;
7925
  uint32_t  Param1;
7926
  uint32_t  Param2;
7927
  llvm::Type * Param3;
7928
  Intrinsic::ID  Param4;
7929
  llvm::Type * Param5;
7930
  switch (BuiltinID) {
7931
  case ARM::BI__builtin_arm_mve_vmlaldavaq_p_s16:
7932
    Param0 = 0;
7933
    Param1 = 0;
7934
    Param2 = 0;
7935
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
7936
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
7937
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
7938
    break;
7939
  case ARM::BI__builtin_arm_mve_vmlaldavaq_p_s32:
7940
    Param0 = 0;
7941
    Param1 = 0;
7942
    Param2 = 0;
7943
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
7944
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
7945
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
7946
    break;
7947
  case ARM::BI__builtin_arm_mve_vmlaldavaq_p_u16:
7948
    Param0 = 1;
7949
    Param1 = 0;
7950
    Param2 = 0;
7951
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
7952
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
7953
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
7954
    break;
7955
  case ARM::BI__builtin_arm_mve_vmlaldavaq_p_u32:
7956
    Param0 = 1;
7957
    Param1 = 0;
7958
    Param2 = 0;
7959
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
7960
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
7961
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
7962
    break;
7963
  case ARM::BI__builtin_arm_mve_vmlaldavaxq_p_s16:
7964
    Param0 = 0;
7965
    Param1 = 0;
7966
    Param2 = 1;
7967
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
7968
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
7969
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
7970
    break;
7971
  case ARM::BI__builtin_arm_mve_vmlaldavaxq_p_s32:
7972
    Param0 = 0;
7973
    Param1 = 0;
7974
    Param2 = 1;
7975
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
7976
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
7977
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
7978
    break;
7979
  case ARM::BI__builtin_arm_mve_vmlsldavaq_p_s16:
7980
    Param0 = 0;
7981
    Param1 = 1;
7982
    Param2 = 0;
7983
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
7984
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
7985
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
7986
    break;
7987
  case ARM::BI__builtin_arm_mve_vmlsldavaq_p_s32:
7988
    Param0 = 0;
7989
    Param1 = 1;
7990
    Param2 = 0;
7991
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
7992
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
7993
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
7994
    break;
7995
  case ARM::BI__builtin_arm_mve_vmlsldavaxq_p_s16:
7996
    Param0 = 0;
7997
    Param1 = 1;
7998
    Param2 = 1;
7999
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8000
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
8001
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
8002
    break;
8003
  case ARM::BI__builtin_arm_mve_vmlsldavaxq_p_s32:
8004
    Param0 = 0;
8005
    Param1 = 1;
8006
    Param2 = 1;
8007
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8008
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
8009
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
8010
    break;
8011
  case ARM::BI__builtin_arm_mve_vrmlaldavhaq_p_s32:
8012
    Param0 = 0;
8013
    Param1 = 0;
8014
    Param2 = 0;
8015
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8016
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
8017
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
8018
    break;
8019
  case ARM::BI__builtin_arm_mve_vrmlaldavhaq_p_u32:
8020
    Param0 = 1;
8021
    Param1 = 0;
8022
    Param2 = 0;
8023
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8024
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
8025
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
8026
    break;
8027
  case ARM::BI__builtin_arm_mve_vrmlaldavhaxq_p_s32:
8028
    Param0 = 0;
8029
    Param1 = 0;
8030
    Param2 = 1;
8031
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8032
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
8033
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
8034
    break;
8035
  case ARM::BI__builtin_arm_mve_vrmlsldavhaq_p_s32:
8036
    Param0 = 0;
8037
    Param1 = 1;
8038
    Param2 = 0;
8039
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8040
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
8041
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
8042
    break;
8043
  case ARM::BI__builtin_arm_mve_vrmlsldavhaxq_p_s32:
8044
    Param0 = 0;
8045
    Param1 = 1;
8046
    Param2 = 1;
8047
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8048
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
8049
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
8050
    break;
8051
  }
8052
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8053
  Value *Val1 = llvm::ConstantInt::get(Int64Ty, 32);
8054
  Value *Val2 = Builder.CreateLShr(Val0, Val1);
8055
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
8056
  Value *Val4 = Builder.CreateIntCast(Val0, Int32Ty, false);
8057
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param0);
8058
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param1);
8059
  Value *Val7 = llvm::ConstantInt::get(Int32Ty, Param2);
8060
  Value *Val8 = EmitScalarExpr(E->getArg(1));
8061
  Value *Val9 = EmitScalarExpr(E->getArg(2));
8062
  Value *Val10 = EmitScalarExpr(E->getArg(3));
8063
  Value *Val11 = Builder.CreateIntCast(Val10, Int32Ty, false);
8064
  Value *Val12 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val11});
8065
  Value *Val13 = Builder.CreateCall(CGM.getIntrinsic(Param4, {Param5, Param3}), {Val5, Val6, Val7, Val4, Val3, Val8, Val9, Val12});
8066
  Value *Val14 = Builder.CreateExtractValue(Val13, static_cast<unsigned>(1));
8067
  Value *Val15 = Builder.CreateIntCast(Val14, Int64Ty, false);
8068
  Value *Val16 = llvm::ConstantInt::get(Int64Ty, 32);
8069
  Value *Val17 = Builder.CreateShl(Val15, Val16);
8070
  Value *Val18 = Builder.CreateExtractValue(Val13, static_cast<unsigned>(0));
8071
  Value *Val19 = Builder.CreateIntCast(Val18, Int64Ty, false);
8072
  return Builder.CreateOr(Val17, Val19);
8073
}
8074
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_f16:
8075
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_s16:
8076
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_s32:
8077
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_s64:
8078
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_s8:
8079
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_u16:
8080
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_u32:
8081
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_u64:
8082
case ARM::BI__builtin_arm_mve_vreinterpretq_f32_u8: {
8083
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8084
  llvm::Type *Val1 = llvm::FixedVectorType::get(FloatTy, 4);
8085
  return ARMMVEVectorReinterpret(Builder, this, Val0, Val1);
8086
}
8087
case ARM::BI__builtin_arm_mve_vcvtq_f32_s32: {
8088
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8089
  llvm::Type *Val1 = llvm::FixedVectorType::get(FloatTy, 4);
8090
  return Builder.CreateSIToFP(Val0, Val1);
8091
}
8092
case ARM::BI__builtin_arm_mve_vcvtq_f32_u32: {
8093
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8094
  llvm::Type *Val1 = llvm::FixedVectorType::get(FloatTy, 4);
8095
  return Builder.CreateUIToFP(Val0, Val1);
8096
}
8097
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_f32:
8098
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_s16:
8099
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_s32:
8100
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_s64:
8101
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_s8:
8102
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_u16:
8103
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_u32:
8104
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_u64:
8105
case ARM::BI__builtin_arm_mve_vreinterpretq_f16_u8: {
8106
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8107
  llvm::Type *Val1 = llvm::FixedVectorType::get(HalfTy, 8);
8108
  return ARMMVEVectorReinterpret(Builder, this, Val0, Val1);
8109
}
8110
case ARM::BI__builtin_arm_mve_vcvtq_f16_s16: {
8111
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8112
  llvm::Type *Val1 = llvm::FixedVectorType::get(HalfTy, 8);
8113
  return Builder.CreateSIToFP(Val0, Val1);
8114
}
8115
case ARM::BI__builtin_arm_mve_vcvtq_f16_u16: {
8116
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8117
  llvm::Type *Val1 = llvm::FixedVectorType::get(HalfTy, 8);
8118
  return Builder.CreateUIToFP(Val0, Val1);
8119
}
8120
case ARM::BI__builtin_arm_mve_vqnegq_s16: {
8121
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8122
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8123
  Value *Val2 = ARMMVEConstantSplat<1,0>(Builder, Val1);
8124
  Value *Val3 = Builder.CreateICmpEQ(Val0, Val2);
8125
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
8126
  Value *Val5 = ARMMVEConstantSplat<0,1>(Builder, Val4);
8127
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int16Ty, 8);
8128
  Value *Val7 = llvm::Constant::getNullValue(Val6);
8129
  Value *Val8 = Builder.CreateSub(Val7, Val0);
8130
  return Builder.CreateSelect(Val3, Val5, Val8);
8131
}
8132
case ARM::BI__builtin_arm_mve_vmvnq_s16:
8133
case ARM::BI__builtin_arm_mve_vmvnq_u16: {
8134
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8135
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8136
  Value *Val2 = ARMMVEConstantSplat<1,1>(Builder, Val1);
8137
  return Builder.CreateXor(Val0, Val2);
8138
}
8139
case ARM::BI__builtin_arm_mve_vmovntq_s16:
8140
case ARM::BI__builtin_arm_mve_vmovntq_u16: {
8141
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8142
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8143
  Value *Val2 = ARMMVEVectorReinterpret(Builder, this, Val0, Val1);
8144
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8145
  Value *Val4 = VectorZip(Builder, Val2, Val3);
8146
  llvm::Type *Val5 = llvm::FixedVectorType::get(Int8Ty, 16);
8147
  return Builder.CreateTrunc(Val4, Val5);
8148
}
8149
case ARM::BI__builtin_arm_mve_vandq_f16: {
8150
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8151
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8152
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8153
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8154
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
8155
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8156
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
8157
  llvm::Type *Val7 = llvm::FixedVectorType::get(HalfTy, 8);
8158
  return Builder.CreateBitCast(Val6, Val7);
8159
}
8160
case ARM::BI__builtin_arm_mve_vbicq_f16: {
8161
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8162
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8163
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8164
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8165
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
8166
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8167
  Value *Val6 = Builder.CreateNot(Val5);
8168
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
8169
  llvm::Type *Val8 = llvm::FixedVectorType::get(HalfTy, 8);
8170
  return Builder.CreateBitCast(Val7, Val8);
8171
}
8172
case ARM::BI__builtin_arm_mve_vornq_f16: {
8173
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8174
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8175
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8176
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8177
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
8178
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8179
  Value *Val6 = Builder.CreateNot(Val5);
8180
  Value *Val7 = Builder.CreateOr(Val2, Val6);
8181
  llvm::Type *Val8 = llvm::FixedVectorType::get(HalfTy, 8);
8182
  return Builder.CreateBitCast(Val7, Val8);
8183
}
8184
case ARM::BI__builtin_arm_mve_vorrq_f16: {
8185
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8186
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8187
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8188
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8189
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
8190
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8191
  Value *Val6 = Builder.CreateOr(Val2, Val5);
8192
  llvm::Type *Val7 = llvm::FixedVectorType::get(HalfTy, 8);
8193
  return Builder.CreateBitCast(Val6, Val7);
8194
}
8195
case ARM::BI__builtin_arm_mve_veorq_f16: {
8196
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8197
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8198
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8199
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8200
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
8201
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8202
  Value *Val6 = Builder.CreateXor(Val2, Val5);
8203
  llvm::Type *Val7 = llvm::FixedVectorType::get(HalfTy, 8);
8204
  return Builder.CreateBitCast(Val6, Val7);
8205
}
8206
case ARM::BI__builtin_arm_mve_vqabsq_s16: {
8207
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8208
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8209
  Value *Val2 = llvm::Constant::getNullValue(Val1);
8210
  Value *Val3 = Builder.CreateICmpSGT(Val0, Val2);
8211
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
8212
  Value *Val5 = ARMMVEConstantSplat<1,0>(Builder, Val4);
8213
  Value *Val6 = Builder.CreateICmpEQ(Val0, Val5);
8214
  llvm::Type *Val7 = llvm::FixedVectorType::get(Int16Ty, 8);
8215
  Value *Val8 = ARMMVEConstantSplat<0,1>(Builder, Val7);
8216
  llvm::Type *Val9 = llvm::FixedVectorType::get(Int16Ty, 8);
8217
  Value *Val10 = llvm::Constant::getNullValue(Val9);
8218
  Value *Val11 = Builder.CreateSub(Val10, Val0);
8219
  Value *Val12 = Builder.CreateSelect(Val6, Val8, Val11);
8220
  return Builder.CreateSelect(Val3, Val0, Val12);
8221
}
8222
case ARM::BI__builtin_arm_mve_vabsq_s16: {
8223
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8224
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8225
  Value *Val2 = llvm::Constant::getNullValue(Val1);
8226
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
8227
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
8228
  Value *Val5 = llvm::Constant::getNullValue(Val4);
8229
  Value *Val6 = Builder.CreateSub(Val5, Val0);
8230
  return Builder.CreateSelect(Val3, Val6, Val0);
8231
}
8232
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_f16:
8233
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_f32:
8234
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_s32:
8235
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_s64:
8236
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_s8:
8237
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_u16:
8238
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_u32:
8239
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_u64:
8240
case ARM::BI__builtin_arm_mve_vreinterpretq_s16_u8:
8241
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_f16:
8242
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_f32:
8243
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_s16:
8244
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_s32:
8245
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_s64:
8246
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_s8:
8247
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_u32:
8248
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_u64:
8249
case ARM::BI__builtin_arm_mve_vreinterpretq_u16_u8: {
8250
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8251
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8252
  return ARMMVEVectorReinterpret(Builder, this, Val0, Val1);
8253
}
8254
case ARM::BI__builtin_arm_mve_vcvtq_s16_f16: {
8255
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8256
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8257
  return Builder.CreateFPToSI(Val0, Val1);
8258
}
8259
case ARM::BI__builtin_arm_mve_vcvtq_u16_f16: {
8260
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8261
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
8262
  return Builder.CreateFPToUI(Val0, Val1);
8263
}
8264
case ARM::BI__builtin_arm_mve_vqnegq_s32: {
8265
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8266
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8267
  Value *Val2 = ARMMVEConstantSplat<1,0>(Builder, Val1);
8268
  Value *Val3 = Builder.CreateICmpEQ(Val0, Val2);
8269
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
8270
  Value *Val5 = ARMMVEConstantSplat<0,1>(Builder, Val4);
8271
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int32Ty, 4);
8272
  Value *Val7 = llvm::Constant::getNullValue(Val6);
8273
  Value *Val8 = Builder.CreateSub(Val7, Val0);
8274
  return Builder.CreateSelect(Val3, Val5, Val8);
8275
}
8276
case ARM::BI__builtin_arm_mve_vmvnq_s32:
8277
case ARM::BI__builtin_arm_mve_vmvnq_u32: {
8278
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8279
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8280
  Value *Val2 = ARMMVEConstantSplat<1,1>(Builder, Val1);
8281
  return Builder.CreateXor(Val0, Val2);
8282
}
8283
case ARM::BI__builtin_arm_mve_vmovntq_s32:
8284
case ARM::BI__builtin_arm_mve_vmovntq_u32: {
8285
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8286
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8287
  Value *Val2 = ARMMVEVectorReinterpret(Builder, this, Val0, Val1);
8288
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8289
  Value *Val4 = VectorZip(Builder, Val2, Val3);
8290
  llvm::Type *Val5 = llvm::FixedVectorType::get(Int16Ty, 8);
8291
  return Builder.CreateTrunc(Val4, Val5);
8292
}
8293
case ARM::BI__builtin_arm_mve_vandq_f32: {
8294
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8295
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8296
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8297
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8298
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
8299
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8300
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
8301
  llvm::Type *Val7 = llvm::FixedVectorType::get(FloatTy, 4);
8302
  return Builder.CreateBitCast(Val6, Val7);
8303
}
8304
case ARM::BI__builtin_arm_mve_vbicq_f32: {
8305
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8306
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8307
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8308
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8309
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
8310
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8311
  Value *Val6 = Builder.CreateNot(Val5);
8312
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
8313
  llvm::Type *Val8 = llvm::FixedVectorType::get(FloatTy, 4);
8314
  return Builder.CreateBitCast(Val7, Val8);
8315
}
8316
case ARM::BI__builtin_arm_mve_vornq_f32: {
8317
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8318
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8319
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8320
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8321
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
8322
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8323
  Value *Val6 = Builder.CreateNot(Val5);
8324
  Value *Val7 = Builder.CreateOr(Val2, Val6);
8325
  llvm::Type *Val8 = llvm::FixedVectorType::get(FloatTy, 4);
8326
  return Builder.CreateBitCast(Val7, Val8);
8327
}
8328
case ARM::BI__builtin_arm_mve_vorrq_f32: {
8329
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8330
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8331
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8332
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8333
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
8334
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8335
  Value *Val6 = Builder.CreateOr(Val2, Val5);
8336
  llvm::Type *Val7 = llvm::FixedVectorType::get(FloatTy, 4);
8337
  return Builder.CreateBitCast(Val6, Val7);
8338
}
8339
case ARM::BI__builtin_arm_mve_veorq_f32: {
8340
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8341
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8342
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
8343
  Value *Val3 = EmitScalarExpr(E->getArg(1));
8344
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
8345
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
8346
  Value *Val6 = Builder.CreateXor(Val2, Val5);
8347
  llvm::Type *Val7 = llvm::FixedVectorType::get(FloatTy, 4);
8348
  return Builder.CreateBitCast(Val6, Val7);
8349
}
8350
case ARM::BI__builtin_arm_mve_vqabsq_s32: {
8351
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8352
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8353
  Value *Val2 = llvm::Constant::getNullValue(Val1);
8354
  Value *Val3 = Builder.CreateICmpSGT(Val0, Val2);
8355
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
8356
  Value *Val5 = ARMMVEConstantSplat<1,0>(Builder, Val4);
8357
  Value *Val6 = Builder.CreateICmpEQ(Val0, Val5);
8358
  llvm::Type *Val7 = llvm::FixedVectorType::get(Int32Ty, 4);
8359
  Value *Val8 = ARMMVEConstantSplat<0,1>(Builder, Val7);
8360
  llvm::Type *Val9 = llvm::FixedVectorType::get(Int32Ty, 4);
8361
  Value *Val10 = llvm::Constant::getNullValue(Val9);
8362
  Value *Val11 = Builder.CreateSub(Val10, Val0);
8363
  Value *Val12 = Builder.CreateSelect(Val6, Val8, Val11);
8364
  return Builder.CreateSelect(Val3, Val0, Val12);
8365
}
8366
case ARM::BI__builtin_arm_mve_vabsq_s32: {
8367
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8368
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8369
  Value *Val2 = llvm::Constant::getNullValue(Val1);
8370
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
8371
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
8372
  Value *Val5 = llvm::Constant::getNullValue(Val4);
8373
  Value *Val6 = Builder.CreateSub(Val5, Val0);
8374
  return Builder.CreateSelect(Val3, Val6, Val0);
8375
}
8376
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_f16:
8377
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_f32:
8378
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_s16:
8379
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_s64:
8380
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_s8:
8381
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_u16:
8382
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_u32:
8383
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_u64:
8384
case ARM::BI__builtin_arm_mve_vreinterpretq_s32_u8:
8385
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_f16:
8386
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_f32:
8387
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_s16:
8388
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_s32:
8389
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_s64:
8390
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_s8:
8391
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_u16:
8392
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_u64:
8393
case ARM::BI__builtin_arm_mve_vreinterpretq_u32_u8: {
8394
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8395
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8396
  return ARMMVEVectorReinterpret(Builder, this, Val0, Val1);
8397
}
8398
case ARM::BI__builtin_arm_mve_vcvtq_s32_f32: {
8399
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8400
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8401
  return Builder.CreateFPToSI(Val0, Val1);
8402
}
8403
case ARM::BI__builtin_arm_mve_vcvtq_u32_f32: {
8404
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8405
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
8406
  return Builder.CreateFPToUI(Val0, Val1);
8407
}
8408
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_f16:
8409
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_f32:
8410
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_s16:
8411
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_s32:
8412
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_s8:
8413
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_u16:
8414
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_u32:
8415
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_u64:
8416
case ARM::BI__builtin_arm_mve_vreinterpretq_s64_u8:
8417
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_f16:
8418
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_f32:
8419
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_s16:
8420
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_s32:
8421
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_s64:
8422
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_s8:
8423
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_u16:
8424
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_u32:
8425
case ARM::BI__builtin_arm_mve_vreinterpretq_u64_u8: {
8426
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8427
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int64Ty, 2);
8428
  return ARMMVEVectorReinterpret(Builder, this, Val0, Val1);
8429
}
8430
case ARM::BI__builtin_arm_mve_vqnegq_s8: {
8431
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8432
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 16);
8433
  Value *Val2 = ARMMVEConstantSplat<1,0>(Builder, Val1);
8434
  Value *Val3 = Builder.CreateICmpEQ(Val0, Val2);
8435
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int8Ty, 16);
8436
  Value *Val5 = ARMMVEConstantSplat<0,1>(Builder, Val4);
8437
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int8Ty, 16);
8438
  Value *Val7 = llvm::Constant::getNullValue(Val6);
8439
  Value *Val8 = Builder.CreateSub(Val7, Val0);
8440
  return Builder.CreateSelect(Val3, Val5, Val8);
8441
}
8442
case ARM::BI__builtin_arm_mve_vmvnq_s8:
8443
case ARM::BI__builtin_arm_mve_vmvnq_u8: {
8444
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8445
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 16);
8446
  Value *Val2 = ARMMVEConstantSplat<1,1>(Builder, Val1);
8447
  return Builder.CreateXor(Val0, Val2);
8448
}
8449
case ARM::BI__builtin_arm_mve_vqabsq_s8: {
8450
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8451
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 16);
8452
  Value *Val2 = llvm::Constant::getNullValue(Val1);
8453
  Value *Val3 = Builder.CreateICmpSGT(Val0, Val2);
8454
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int8Ty, 16);
8455
  Value *Val5 = ARMMVEConstantSplat<1,0>(Builder, Val4);
8456
  Value *Val6 = Builder.CreateICmpEQ(Val0, Val5);
8457
  llvm::Type *Val7 = llvm::FixedVectorType::get(Int8Ty, 16);
8458
  Value *Val8 = ARMMVEConstantSplat<0,1>(Builder, Val7);
8459
  llvm::Type *Val9 = llvm::FixedVectorType::get(Int8Ty, 16);
8460
  Value *Val10 = llvm::Constant::getNullValue(Val9);
8461
  Value *Val11 = Builder.CreateSub(Val10, Val0);
8462
  Value *Val12 = Builder.CreateSelect(Val6, Val8, Val11);
8463
  return Builder.CreateSelect(Val3, Val0, Val12);
8464
}
8465
case ARM::BI__builtin_arm_mve_vabsq_s8: {
8466
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8467
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 16);
8468
  Value *Val2 = llvm::Constant::getNullValue(Val1);
8469
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
8470
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int8Ty, 16);
8471
  Value *Val5 = llvm::Constant::getNullValue(Val4);
8472
  Value *Val6 = Builder.CreateSub(Val5, Val0);
8473
  return Builder.CreateSelect(Val3, Val6, Val0);
8474
}
8475
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_f16:
8476
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_f32:
8477
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_s16:
8478
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_s32:
8479
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_s64:
8480
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_u16:
8481
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_u32:
8482
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_u64:
8483
case ARM::BI__builtin_arm_mve_vreinterpretq_s8_u8:
8484
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_f16:
8485
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_f32:
8486
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_s16:
8487
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_s32:
8488
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_s64:
8489
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_s8:
8490
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_u16:
8491
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_u32:
8492
case ARM::BI__builtin_arm_mve_vreinterpretq_u8_u64: {
8493
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8494
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 16);
8495
  return ARMMVEVectorReinterpret(Builder, this, Val0, Val1);
8496
}
8497
case ARM::BI__builtin_arm_mve_vrev16q_s8:
8498
case ARM::BI__builtin_arm_mve_vrev16q_u8:
8499
case ARM::BI__builtin_arm_mve_vrev32q_f16:
8500
case ARM::BI__builtin_arm_mve_vrev32q_s16:
8501
case ARM::BI__builtin_arm_mve_vrev32q_s8:
8502
case ARM::BI__builtin_arm_mve_vrev32q_u16:
8503
case ARM::BI__builtin_arm_mve_vrev32q_u8:
8504
case ARM::BI__builtin_arm_mve_vrev64q_f16:
8505
case ARM::BI__builtin_arm_mve_vrev64q_f32:
8506
case ARM::BI__builtin_arm_mve_vrev64q_s16:
8507
case ARM::BI__builtin_arm_mve_vrev64q_s32:
8508
case ARM::BI__builtin_arm_mve_vrev64q_s8:
8509
case ARM::BI__builtin_arm_mve_vrev64q_u16:
8510
case ARM::BI__builtin_arm_mve_vrev64q_u32:
8511
case ARM::BI__builtin_arm_mve_vrev64q_u8: {
8512
  unsigned  Param0;
8513
  switch (BuiltinID) {
8514
  case ARM::BI__builtin_arm_mve_vrev16q_s8:
8515
    Param0 = 16;
8516
    break;
8517
  case ARM::BI__builtin_arm_mve_vrev16q_u8:
8518
    Param0 = 16;
8519
    break;
8520
  case ARM::BI__builtin_arm_mve_vrev32q_f16:
8521
    Param0 = 32;
8522
    break;
8523
  case ARM::BI__builtin_arm_mve_vrev32q_s16:
8524
    Param0 = 32;
8525
    break;
8526
  case ARM::BI__builtin_arm_mve_vrev32q_s8:
8527
    Param0 = 32;
8528
    break;
8529
  case ARM::BI__builtin_arm_mve_vrev32q_u16:
8530
    Param0 = 32;
8531
    break;
8532
  case ARM::BI__builtin_arm_mve_vrev32q_u8:
8533
    Param0 = 32;
8534
    break;
8535
  case ARM::BI__builtin_arm_mve_vrev64q_f16:
8536
    Param0 = 64;
8537
    break;
8538
  case ARM::BI__builtin_arm_mve_vrev64q_f32:
8539
    Param0 = 64;
8540
    break;
8541
  case ARM::BI__builtin_arm_mve_vrev64q_s16:
8542
    Param0 = 64;
8543
    break;
8544
  case ARM::BI__builtin_arm_mve_vrev64q_s32:
8545
    Param0 = 64;
8546
    break;
8547
  case ARM::BI__builtin_arm_mve_vrev64q_s8:
8548
    Param0 = 64;
8549
    break;
8550
  case ARM::BI__builtin_arm_mve_vrev64q_u16:
8551
    Param0 = 64;
8552
    break;
8553
  case ARM::BI__builtin_arm_mve_vrev64q_u32:
8554
    Param0 = 64;
8555
    break;
8556
  case ARM::BI__builtin_arm_mve_vrev64q_u8:
8557
    Param0 = 64;
8558
    break;
8559
  }
8560
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8561
  return ARMMVEVectorElementReverse(Builder, Val0, static_cast<unsigned>(Param0));
8562
}
8563
case ARM::BI__builtin_arm_mve_vdupq_n_f16:
8564
case ARM::BI__builtin_arm_mve_vdupq_n_f32:
8565
case ARM::BI__builtin_arm_mve_vdupq_n_s16:
8566
case ARM::BI__builtin_arm_mve_vdupq_n_s32:
8567
case ARM::BI__builtin_arm_mve_vdupq_n_s8:
8568
case ARM::BI__builtin_arm_mve_vdupq_n_u16:
8569
case ARM::BI__builtin_arm_mve_vdupq_n_u32:
8570
case ARM::BI__builtin_arm_mve_vdupq_n_u8: {
8571
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8572
  return ARMMVEVectorSplat(Builder, Val0);
8573
}
8574
case ARM::BI__builtin_arm_mve_vabsq_f16:
8575
case ARM::BI__builtin_arm_mve_vabsq_f32:
8576
case ARM::BI__builtin_arm_mve_vclsq_s16:
8577
case ARM::BI__builtin_arm_mve_vclsq_s32:
8578
case ARM::BI__builtin_arm_mve_vclsq_s8:
8579
case ARM::BI__builtin_arm_mve_vrndaq_f16:
8580
case ARM::BI__builtin_arm_mve_vrndaq_f32:
8581
case ARM::BI__builtin_arm_mve_vrndmq_f16:
8582
case ARM::BI__builtin_arm_mve_vrndmq_f32:
8583
case ARM::BI__builtin_arm_mve_vrndnq_f16:
8584
case ARM::BI__builtin_arm_mve_vrndnq_f32:
8585
case ARM::BI__builtin_arm_mve_vrndpq_f16:
8586
case ARM::BI__builtin_arm_mve_vrndpq_f32:
8587
case ARM::BI__builtin_arm_mve_vrndq_f16:
8588
case ARM::BI__builtin_arm_mve_vrndq_f32:
8589
case ARM::BI__builtin_arm_mve_vrndxq_f16:
8590
case ARM::BI__builtin_arm_mve_vrndxq_f32: {
8591
  Intrinsic::ID  Param0;
8592
  llvm::Type * Param1;
8593
  switch (BuiltinID) {
8594
  case ARM::BI__builtin_arm_mve_vabsq_f16:
8595
    Param0 = Intrinsic::fabs;
8596
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
8597
    break;
8598
  case ARM::BI__builtin_arm_mve_vabsq_f32:
8599
    Param0 = Intrinsic::fabs;
8600
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
8601
    break;
8602
  case ARM::BI__builtin_arm_mve_vclsq_s16:
8603
    Param0 = Intrinsic::arm_mve_vcls;
8604
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
8605
    break;
8606
  case ARM::BI__builtin_arm_mve_vclsq_s32:
8607
    Param0 = Intrinsic::arm_mve_vcls;
8608
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
8609
    break;
8610
  case ARM::BI__builtin_arm_mve_vclsq_s8:
8611
    Param0 = Intrinsic::arm_mve_vcls;
8612
    Param1 = llvm::FixedVectorType::get(Int8Ty, 16);
8613
    break;
8614
  case ARM::BI__builtin_arm_mve_vrndaq_f16:
8615
    Param0 = Intrinsic::round;
8616
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
8617
    break;
8618
  case ARM::BI__builtin_arm_mve_vrndaq_f32:
8619
    Param0 = Intrinsic::round;
8620
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
8621
    break;
8622
  case ARM::BI__builtin_arm_mve_vrndmq_f16:
8623
    Param0 = Intrinsic::floor;
8624
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
8625
    break;
8626
  case ARM::BI__builtin_arm_mve_vrndmq_f32:
8627
    Param0 = Intrinsic::floor;
8628
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
8629
    break;
8630
  case ARM::BI__builtin_arm_mve_vrndnq_f16:
8631
    Param0 = Intrinsic::arm_mve_vrintn;
8632
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
8633
    break;
8634
  case ARM::BI__builtin_arm_mve_vrndnq_f32:
8635
    Param0 = Intrinsic::arm_mve_vrintn;
8636
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
8637
    break;
8638
  case ARM::BI__builtin_arm_mve_vrndpq_f16:
8639
    Param0 = Intrinsic::ceil;
8640
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
8641
    break;
8642
  case ARM::BI__builtin_arm_mve_vrndpq_f32:
8643
    Param0 = Intrinsic::ceil;
8644
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
8645
    break;
8646
  case ARM::BI__builtin_arm_mve_vrndq_f16:
8647
    Param0 = Intrinsic::trunc;
8648
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
8649
    break;
8650
  case ARM::BI__builtin_arm_mve_vrndq_f32:
8651
    Param0 = Intrinsic::trunc;
8652
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
8653
    break;
8654
  case ARM::BI__builtin_arm_mve_vrndxq_f16:
8655
    Param0 = Intrinsic::rint;
8656
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
8657
    break;
8658
  case ARM::BI__builtin_arm_mve_vrndxq_f32:
8659
    Param0 = Intrinsic::rint;
8660
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
8661
    break;
8662
  }
8663
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8664
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {Param1}), {Val0});
8665
}
8666
case ARM::BI__builtin_arm_mve_vnegq_f16:
8667
case ARM::BI__builtin_arm_mve_vnegq_f32: {
8668
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8669
  return Builder.CreateFNeg(Val0);
8670
}
8671
case ARM::BI__builtin_arm_mve_vshrq_n_s16:
8672
case ARM::BI__builtin_arm_mve_vshrq_n_s32:
8673
case ARM::BI__builtin_arm_mve_vshrq_n_s8:
8674
case ARM::BI__builtin_arm_mve_vshrq_n_u16:
8675
case ARM::BI__builtin_arm_mve_vshrq_n_u32:
8676
case ARM::BI__builtin_arm_mve_vshrq_n_u8: {
8677
  bool  Param0;
8678
  switch (BuiltinID) {
8679
  case ARM::BI__builtin_arm_mve_vshrq_n_s16:
8680
    Param0 = 0;
8681
    break;
8682
  case ARM::BI__builtin_arm_mve_vshrq_n_s32:
8683
    Param0 = 0;
8684
    break;
8685
  case ARM::BI__builtin_arm_mve_vshrq_n_s8:
8686
    Param0 = 0;
8687
    break;
8688
  case ARM::BI__builtin_arm_mve_vshrq_n_u16:
8689
    Param0 = 1;
8690
    break;
8691
  case ARM::BI__builtin_arm_mve_vshrq_n_u32:
8692
    Param0 = 1;
8693
    break;
8694
  case ARM::BI__builtin_arm_mve_vshrq_n_u8:
8695
    Param0 = 1;
8696
    break;
8697
  }
8698
  Value *Val0 = EmitScalarExpr(E->getArg(0));
8699
  return MVEImmediateShr(Builder, Val0, GetIntegerConstantValue<unsigned>(E->getArg(1), getContext()), static_cast<bool>(Param0));
8700
}
8701
case ARM::BI__builtin_arm_mve_vst1q_p_f16:
8702
case ARM::BI__builtin_arm_mve_vst1q_p_f32:
8703
case ARM::BI__builtin_arm_mve_vst1q_p_s16:
8704
case ARM::BI__builtin_arm_mve_vst1q_p_s32:
8705
case ARM::BI__builtin_arm_mve_vst1q_p_s8:
8706
case ARM::BI__builtin_arm_mve_vst1q_p_u16:
8707
case ARM::BI__builtin_arm_mve_vst1q_p_u32:
8708
case ARM::BI__builtin_arm_mve_vst1q_p_u8:
8709
case ARM::BI__builtin_arm_mve_vstrbq_p_s8:
8710
case ARM::BI__builtin_arm_mve_vstrbq_p_u8:
8711
case ARM::BI__builtin_arm_mve_vstrhq_p_f16:
8712
case ARM::BI__builtin_arm_mve_vstrhq_p_s16:
8713
case ARM::BI__builtin_arm_mve_vstrhq_p_u16:
8714
case ARM::BI__builtin_arm_mve_vstrwq_p_f32:
8715
case ARM::BI__builtin_arm_mve_vstrwq_p_s32:
8716
case ARM::BI__builtin_arm_mve_vstrwq_p_u32: {
8717
  llvm::Type * Param0;
8718
  uint32_t  Param1;
8719
  llvm::Type * Param2;
8720
  llvm::Type * Param3;
8721
  switch (BuiltinID) {
8722
  case ARM::BI__builtin_arm_mve_vst1q_p_f16:
8723
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(HalfTy, 8));
8724
    Param1 = 2;
8725
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8726
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
8727
    break;
8728
  case ARM::BI__builtin_arm_mve_vst1q_p_f32:
8729
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(FloatTy, 4));
8730
    Param1 = 4;
8731
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8732
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
8733
    break;
8734
  case ARM::BI__builtin_arm_mve_vst1q_p_s16:
8735
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 8));
8736
    Param1 = 2;
8737
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8738
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
8739
    break;
8740
  case ARM::BI__builtin_arm_mve_vst1q_p_s32:
8741
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int32Ty, 4));
8742
    Param1 = 4;
8743
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8744
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
8745
    break;
8746
  case ARM::BI__builtin_arm_mve_vst1q_p_s8:
8747
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 16));
8748
    Param1 = 1;
8749
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
8750
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
8751
    break;
8752
  case ARM::BI__builtin_arm_mve_vst1q_p_u16:
8753
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 8));
8754
    Param1 = 2;
8755
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8756
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
8757
    break;
8758
  case ARM::BI__builtin_arm_mve_vst1q_p_u32:
8759
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int32Ty, 4));
8760
    Param1 = 4;
8761
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8762
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
8763
    break;
8764
  case ARM::BI__builtin_arm_mve_vst1q_p_u8:
8765
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 16));
8766
    Param1 = 1;
8767
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
8768
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
8769
    break;
8770
  case ARM::BI__builtin_arm_mve_vstrbq_p_s8:
8771
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 16));
8772
    Param1 = 1;
8773
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
8774
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
8775
    break;
8776
  case ARM::BI__builtin_arm_mve_vstrbq_p_u8:
8777
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 16));
8778
    Param1 = 1;
8779
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
8780
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
8781
    break;
8782
  case ARM::BI__builtin_arm_mve_vstrhq_p_f16:
8783
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(HalfTy, 8));
8784
    Param1 = 2;
8785
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8786
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
8787
    break;
8788
  case ARM::BI__builtin_arm_mve_vstrhq_p_s16:
8789
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 8));
8790
    Param1 = 2;
8791
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8792
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
8793
    break;
8794
  case ARM::BI__builtin_arm_mve_vstrhq_p_u16:
8795
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 8));
8796
    Param1 = 2;
8797
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8798
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
8799
    break;
8800
  case ARM::BI__builtin_arm_mve_vstrwq_p_f32:
8801
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(FloatTy, 4));
8802
    Param1 = 4;
8803
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8804
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
8805
    break;
8806
  case ARM::BI__builtin_arm_mve_vstrwq_p_s32:
8807
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int32Ty, 4));
8808
    Param1 = 4;
8809
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8810
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
8811
    break;
8812
  case ARM::BI__builtin_arm_mve_vstrwq_p_u32:
8813
    Param0 = llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int32Ty, 4));
8814
    Param1 = 4;
8815
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8816
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
8817
    break;
8818
  }
8819
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8820
  Address Val1 = EmitPointerWithAlignment(E->getArg(0));
8821
  Value *Val2 = Builder.CreatePointerCast((Val1.getPointer()), Param0);
8822
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
8823
  Value *Val4 = EmitScalarExpr(E->getArg(2));
8824
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
8825
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param2}), {Val5});
8826
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_store, {Param3, Param0}), {Val0, Val2, Val3, Val6});
8827
}
8828
case ARM::BI__builtin_arm_mve_vst1q_f32:
8829
case ARM::BI__builtin_arm_mve_vstrwq_f32: {
8830
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8831
  Address Val1 = EmitPointerWithAlignment(E->getArg(0));
8832
  Value *Val2 = Builder.CreatePointerCast((Val1.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(FloatTy, 4)));
8833
  Address Val3 = Address(Val2, llvm::FixedVectorType::get(FloatTy, 4), CharUnits::fromQuantity(4));
8834
  return Builder.CreateStore(Val0, Val3);
8835
}
8836
case ARM::BI__builtin_arm_mve_vst1q_f16:
8837
case ARM::BI__builtin_arm_mve_vstrhq_f16: {
8838
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8839
  Address Val1 = EmitPointerWithAlignment(E->getArg(0));
8840
  Value *Val2 = Builder.CreatePointerCast((Val1.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(HalfTy, 8)));
8841
  Address Val3 = Address(Val2, llvm::FixedVectorType::get(HalfTy, 8), CharUnits::fromQuantity(2));
8842
  return Builder.CreateStore(Val0, Val3);
8843
}
8844
case ARM::BI__builtin_arm_mve_vst1q_s16:
8845
case ARM::BI__builtin_arm_mve_vst1q_u16:
8846
case ARM::BI__builtin_arm_mve_vstrhq_s16:
8847
case ARM::BI__builtin_arm_mve_vstrhq_u16: {
8848
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8849
  Address Val1 = EmitPointerWithAlignment(E->getArg(0));
8850
  Value *Val2 = Builder.CreatePointerCast((Val1.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 8)));
8851
  Address Val3 = Address(Val2, llvm::FixedVectorType::get(Int16Ty, 8), CharUnits::fromQuantity(2));
8852
  return Builder.CreateStore(Val0, Val3);
8853
}
8854
case ARM::BI__builtin_arm_mve_vst1q_s32:
8855
case ARM::BI__builtin_arm_mve_vst1q_u32:
8856
case ARM::BI__builtin_arm_mve_vstrwq_s32:
8857
case ARM::BI__builtin_arm_mve_vstrwq_u32: {
8858
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8859
  Address Val1 = EmitPointerWithAlignment(E->getArg(0));
8860
  Value *Val2 = Builder.CreatePointerCast((Val1.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int32Ty, 4)));
8861
  Address Val3 = Address(Val2, llvm::FixedVectorType::get(Int32Ty, 4), CharUnits::fromQuantity(4));
8862
  return Builder.CreateStore(Val0, Val3);
8863
}
8864
case ARM::BI__builtin_arm_mve_vst1q_s8:
8865
case ARM::BI__builtin_arm_mve_vst1q_u8:
8866
case ARM::BI__builtin_arm_mve_vstrbq_s8:
8867
case ARM::BI__builtin_arm_mve_vstrbq_u8: {
8868
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8869
  Address Val1 = EmitPointerWithAlignment(E->getArg(0));
8870
  Value *Val2 = Builder.CreatePointerCast((Val1.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 16)));
8871
  Address Val3 = Address(Val2, llvm::FixedVectorType::get(Int8Ty, 16), CharUnits::fromQuantity(1));
8872
  return Builder.CreateStore(Val0, Val3);
8873
}
8874
case ARM::BI__builtin_arm_mve_vctp16q_m:
8875
case ARM::BI__builtin_arm_mve_vctp32q_m:
8876
case ARM::BI__builtin_arm_mve_vctp64q_m:
8877
case ARM::BI__builtin_arm_mve_vctp8q_m: {
8878
  llvm::Type * Param0;
8879
  Intrinsic::ID  Param1;
8880
  switch (BuiltinID) {
8881
  case ARM::BI__builtin_arm_mve_vctp16q_m:
8882
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8883
    Param1 = Intrinsic::arm_mve_vctp16;
8884
    break;
8885
  case ARM::BI__builtin_arm_mve_vctp32q_m:
8886
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8887
    Param1 = Intrinsic::arm_mve_vctp32;
8888
    break;
8889
  case ARM::BI__builtin_arm_mve_vctp64q_m:
8890
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
8891
    Param1 = Intrinsic::arm_mve_vctp64;
8892
    break;
8893
  case ARM::BI__builtin_arm_mve_vctp8q_m:
8894
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
8895
    Param1 = Intrinsic::arm_mve_vctp8;
8896
    break;
8897
  }
8898
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8899
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
8900
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
8901
  Value *Val3 = EmitScalarExpr(E->getArg(0));
8902
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Param1), {Val3});
8903
  Value *Val5 = Builder.CreateAnd(Val2, Val4);
8904
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val5});
8905
  return Builder.CreateIntCast(Val6, Int16Ty, false);
8906
}
8907
case ARM::BI__builtin_arm_mve_vmovnbq_s16:
8908
case ARM::BI__builtin_arm_mve_vmovnbq_u16: {
8909
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8910
  Value *Val1 = EmitScalarExpr(E->getArg(0));
8911
  Value *Val2 = ARMMVEVectorElementReverse(Builder, Val1, static_cast<unsigned>(16));
8912
  llvm::Type *Val3 = llvm::FixedVectorType::get(Int16Ty, 8);
8913
  Value *Val4 = ARMMVEVectorReinterpret(Builder, this, Val2, Val3);
8914
  Value *Val5 = VectorZip(Builder, Val0, Val4);
8915
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int8Ty, 16);
8916
  return Builder.CreateTrunc(Val5, Val6);
8917
}
8918
case ARM::BI__builtin_arm_mve_vmovnbq_s32:
8919
case ARM::BI__builtin_arm_mve_vmovnbq_u32: {
8920
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8921
  Value *Val1 = EmitScalarExpr(E->getArg(0));
8922
  Value *Val2 = ARMMVEVectorElementReverse(Builder, Val1, static_cast<unsigned>(32));
8923
  llvm::Type *Val3 = llvm::FixedVectorType::get(Int32Ty, 4);
8924
  Value *Val4 = ARMMVEVectorReinterpret(Builder, this, Val2, Val3);
8925
  Value *Val5 = VectorZip(Builder, Val0, Val4);
8926
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int16Ty, 8);
8927
  return Builder.CreateTrunc(Val5, Val6);
8928
}
8929
case ARM::BI__builtin_arm_mve_vsetq_lane_f16:
8930
case ARM::BI__builtin_arm_mve_vsetq_lane_f32:
8931
case ARM::BI__builtin_arm_mve_vsetq_lane_s16:
8932
case ARM::BI__builtin_arm_mve_vsetq_lane_s32:
8933
case ARM::BI__builtin_arm_mve_vsetq_lane_s64:
8934
case ARM::BI__builtin_arm_mve_vsetq_lane_s8:
8935
case ARM::BI__builtin_arm_mve_vsetq_lane_u16:
8936
case ARM::BI__builtin_arm_mve_vsetq_lane_u32:
8937
case ARM::BI__builtin_arm_mve_vsetq_lane_u64:
8938
case ARM::BI__builtin_arm_mve_vsetq_lane_u8: {
8939
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8940
  Value *Val1 = EmitScalarExpr(E->getArg(0));
8941
  Value *Val2 = EmitScalarExpr(E->getArg(2));
8942
  return Builder.CreateInsertElement(Val0, Val1, Val2);
8943
}
8944
case ARM::BI__builtin_arm_mve_vfmaq_m_f16:
8945
case ARM::BI__builtin_arm_mve_vfmaq_m_f32: {
8946
  llvm::Type * Param0;
8947
  llvm::Type * Param1;
8948
  switch (BuiltinID) {
8949
  case ARM::BI__builtin_arm_mve_vfmaq_m_f16:
8950
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
8951
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
8952
    break;
8953
  case ARM::BI__builtin_arm_mve_vfmaq_m_f32:
8954
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
8955
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
8956
    break;
8957
  }
8958
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8959
  Value *Val1 = EmitScalarExpr(E->getArg(2));
8960
  Value *Val2 = (Val1);
8961
  Value *Val3 = EmitScalarExpr(E->getArg(0));
8962
  Value *Val4 = EmitScalarExpr(E->getArg(3));
8963
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
8964
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val5});
8965
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_fma_predicated, {Param1, Param0}), {Val0, Val2, Val3, Val6});
8966
}
8967
case ARM::BI__builtin_arm_mve_vfmaq_f16:
8968
case ARM::BI__builtin_arm_mve_vfmaq_f32: {
8969
  llvm::Type * Param0;
8970
  switch (BuiltinID) {
8971
  case ARM::BI__builtin_arm_mve_vfmaq_f16:
8972
    Param0 = llvm::FixedVectorType::get(HalfTy, 8);
8973
    break;
8974
  case ARM::BI__builtin_arm_mve_vfmaq_f32:
8975
    Param0 = llvm::FixedVectorType::get(FloatTy, 4);
8976
    break;
8977
  }
8978
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8979
  Value *Val1 = EmitScalarExpr(E->getArg(2));
8980
  Value *Val2 = (Val1);
8981
  Value *Val3 = EmitScalarExpr(E->getArg(0));
8982
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::fma, {Param0}), {Val0, Val2, Val3});
8983
}
8984
case ARM::BI__builtin_arm_mve_vmlaq_n_s16:
8985
case ARM::BI__builtin_arm_mve_vmlaq_n_s32:
8986
case ARM::BI__builtin_arm_mve_vmlaq_n_s8:
8987
case ARM::BI__builtin_arm_mve_vmlaq_n_u16:
8988
case ARM::BI__builtin_arm_mve_vmlaq_n_u32:
8989
case ARM::BI__builtin_arm_mve_vmlaq_n_u8: {
8990
  Value *Val0 = EmitScalarExpr(E->getArg(1));
8991
  Value *Val1 = EmitScalarExpr(E->getArg(2));
8992
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
8993
  Value *Val3 = Builder.CreateMul(Val0, Val2);
8994
  Value *Val4 = EmitScalarExpr(E->getArg(0));
8995
  return Builder.CreateAdd(Val3, Val4);
8996
}
8997
case ARM::BI__builtin_arm_mve_vaddq_m_n_f16:
8998
case ARM::BI__builtin_arm_mve_vaddq_m_n_f32:
8999
case ARM::BI__builtin_arm_mve_vaddq_m_n_s16:
9000
case ARM::BI__builtin_arm_mve_vaddq_m_n_s32:
9001
case ARM::BI__builtin_arm_mve_vaddq_m_n_s8:
9002
case ARM::BI__builtin_arm_mve_vaddq_m_n_u16:
9003
case ARM::BI__builtin_arm_mve_vaddq_m_n_u32:
9004
case ARM::BI__builtin_arm_mve_vaddq_m_n_u8:
9005
case ARM::BI__builtin_arm_mve_vmulq_m_n_f16:
9006
case ARM::BI__builtin_arm_mve_vmulq_m_n_f32:
9007
case ARM::BI__builtin_arm_mve_vmulq_m_n_s16:
9008
case ARM::BI__builtin_arm_mve_vmulq_m_n_s32:
9009
case ARM::BI__builtin_arm_mve_vmulq_m_n_s8:
9010
case ARM::BI__builtin_arm_mve_vmulq_m_n_u16:
9011
case ARM::BI__builtin_arm_mve_vmulq_m_n_u32:
9012
case ARM::BI__builtin_arm_mve_vmulq_m_n_u8:
9013
case ARM::BI__builtin_arm_mve_vqdmulhq_m_n_s16:
9014
case ARM::BI__builtin_arm_mve_vqdmulhq_m_n_s32:
9015
case ARM::BI__builtin_arm_mve_vqdmulhq_m_n_s8:
9016
case ARM::BI__builtin_arm_mve_vqrdmulhq_m_n_s16:
9017
case ARM::BI__builtin_arm_mve_vqrdmulhq_m_n_s32:
9018
case ARM::BI__builtin_arm_mve_vqrdmulhq_m_n_s8:
9019
case ARM::BI__builtin_arm_mve_vsubq_m_n_f16:
9020
case ARM::BI__builtin_arm_mve_vsubq_m_n_f32:
9021
case ARM::BI__builtin_arm_mve_vsubq_m_n_s16:
9022
case ARM::BI__builtin_arm_mve_vsubq_m_n_s32:
9023
case ARM::BI__builtin_arm_mve_vsubq_m_n_s8:
9024
case ARM::BI__builtin_arm_mve_vsubq_m_n_u16:
9025
case ARM::BI__builtin_arm_mve_vsubq_m_n_u32:
9026
case ARM::BI__builtin_arm_mve_vsubq_m_n_u8: {
9027
  llvm::Type * Param0;
9028
  Intrinsic::ID  Param1;
9029
  llvm::Type * Param2;
9030
  switch (BuiltinID) {
9031
  case ARM::BI__builtin_arm_mve_vaddq_m_n_f16:
9032
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9033
    Param1 = Intrinsic::arm_mve_add_predicated;
9034
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9035
    break;
9036
  case ARM::BI__builtin_arm_mve_vaddq_m_n_f32:
9037
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9038
    Param1 = Intrinsic::arm_mve_add_predicated;
9039
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9040
    break;
9041
  case ARM::BI__builtin_arm_mve_vaddq_m_n_s16:
9042
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9043
    Param1 = Intrinsic::arm_mve_add_predicated;
9044
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9045
    break;
9046
  case ARM::BI__builtin_arm_mve_vaddq_m_n_s32:
9047
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9048
    Param1 = Intrinsic::arm_mve_add_predicated;
9049
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9050
    break;
9051
  case ARM::BI__builtin_arm_mve_vaddq_m_n_s8:
9052
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9053
    Param1 = Intrinsic::arm_mve_add_predicated;
9054
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9055
    break;
9056
  case ARM::BI__builtin_arm_mve_vaddq_m_n_u16:
9057
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9058
    Param1 = Intrinsic::arm_mve_add_predicated;
9059
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9060
    break;
9061
  case ARM::BI__builtin_arm_mve_vaddq_m_n_u32:
9062
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9063
    Param1 = Intrinsic::arm_mve_add_predicated;
9064
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9065
    break;
9066
  case ARM::BI__builtin_arm_mve_vaddq_m_n_u8:
9067
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9068
    Param1 = Intrinsic::arm_mve_add_predicated;
9069
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9070
    break;
9071
  case ARM::BI__builtin_arm_mve_vmulq_m_n_f16:
9072
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9073
    Param1 = Intrinsic::arm_mve_mul_predicated;
9074
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9075
    break;
9076
  case ARM::BI__builtin_arm_mve_vmulq_m_n_f32:
9077
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9078
    Param1 = Intrinsic::arm_mve_mul_predicated;
9079
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9080
    break;
9081
  case ARM::BI__builtin_arm_mve_vmulq_m_n_s16:
9082
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9083
    Param1 = Intrinsic::arm_mve_mul_predicated;
9084
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9085
    break;
9086
  case ARM::BI__builtin_arm_mve_vmulq_m_n_s32:
9087
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9088
    Param1 = Intrinsic::arm_mve_mul_predicated;
9089
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9090
    break;
9091
  case ARM::BI__builtin_arm_mve_vmulq_m_n_s8:
9092
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9093
    Param1 = Intrinsic::arm_mve_mul_predicated;
9094
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9095
    break;
9096
  case ARM::BI__builtin_arm_mve_vmulq_m_n_u16:
9097
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9098
    Param1 = Intrinsic::arm_mve_mul_predicated;
9099
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9100
    break;
9101
  case ARM::BI__builtin_arm_mve_vmulq_m_n_u32:
9102
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9103
    Param1 = Intrinsic::arm_mve_mul_predicated;
9104
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9105
    break;
9106
  case ARM::BI__builtin_arm_mve_vmulq_m_n_u8:
9107
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9108
    Param1 = Intrinsic::arm_mve_mul_predicated;
9109
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9110
    break;
9111
  case ARM::BI__builtin_arm_mve_vqdmulhq_m_n_s16:
9112
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9113
    Param1 = Intrinsic::arm_mve_qdmulh_predicated;
9114
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9115
    break;
9116
  case ARM::BI__builtin_arm_mve_vqdmulhq_m_n_s32:
9117
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9118
    Param1 = Intrinsic::arm_mve_qdmulh_predicated;
9119
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9120
    break;
9121
  case ARM::BI__builtin_arm_mve_vqdmulhq_m_n_s8:
9122
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9123
    Param1 = Intrinsic::arm_mve_qdmulh_predicated;
9124
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9125
    break;
9126
  case ARM::BI__builtin_arm_mve_vqrdmulhq_m_n_s16:
9127
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9128
    Param1 = Intrinsic::arm_mve_qrdmulh_predicated;
9129
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9130
    break;
9131
  case ARM::BI__builtin_arm_mve_vqrdmulhq_m_n_s32:
9132
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9133
    Param1 = Intrinsic::arm_mve_qrdmulh_predicated;
9134
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9135
    break;
9136
  case ARM::BI__builtin_arm_mve_vqrdmulhq_m_n_s8:
9137
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9138
    Param1 = Intrinsic::arm_mve_qrdmulh_predicated;
9139
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9140
    break;
9141
  case ARM::BI__builtin_arm_mve_vsubq_m_n_f16:
9142
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9143
    Param1 = Intrinsic::arm_mve_sub_predicated;
9144
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9145
    break;
9146
  case ARM::BI__builtin_arm_mve_vsubq_m_n_f32:
9147
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9148
    Param1 = Intrinsic::arm_mve_sub_predicated;
9149
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9150
    break;
9151
  case ARM::BI__builtin_arm_mve_vsubq_m_n_s16:
9152
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9153
    Param1 = Intrinsic::arm_mve_sub_predicated;
9154
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9155
    break;
9156
  case ARM::BI__builtin_arm_mve_vsubq_m_n_s32:
9157
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9158
    Param1 = Intrinsic::arm_mve_sub_predicated;
9159
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9160
    break;
9161
  case ARM::BI__builtin_arm_mve_vsubq_m_n_s8:
9162
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9163
    Param1 = Intrinsic::arm_mve_sub_predicated;
9164
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9165
    break;
9166
  case ARM::BI__builtin_arm_mve_vsubq_m_n_u16:
9167
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9168
    Param1 = Intrinsic::arm_mve_sub_predicated;
9169
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9170
    break;
9171
  case ARM::BI__builtin_arm_mve_vsubq_m_n_u32:
9172
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9173
    Param1 = Intrinsic::arm_mve_sub_predicated;
9174
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9175
    break;
9176
  case ARM::BI__builtin_arm_mve_vsubq_m_n_u8:
9177
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9178
    Param1 = Intrinsic::arm_mve_sub_predicated;
9179
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9180
    break;
9181
  }
9182
  Value *Val0 = EmitScalarExpr(E->getArg(1));
9183
  Value *Val1 = EmitScalarExpr(E->getArg(2));
9184
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
9185
  Value *Val3 = EmitScalarExpr(E->getArg(3));
9186
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
9187
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val4});
9188
  Value *Val6 = EmitScalarExpr(E->getArg(0));
9189
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val0, Val2, Val5, Val6});
9190
}
9191
case ARM::BI__builtin_arm_mve_vqdmullbq_m_n_s16:
9192
case ARM::BI__builtin_arm_mve_vqdmullbq_m_n_s32:
9193
case ARM::BI__builtin_arm_mve_vqdmulltq_m_n_s16:
9194
case ARM::BI__builtin_arm_mve_vqdmulltq_m_n_s32: {
9195
  uint32_t  Param0;
9196
  llvm::Type * Param1;
9197
  llvm::Type * Param2;
9198
  llvm::Type * Param3;
9199
  switch (BuiltinID) {
9200
  case ARM::BI__builtin_arm_mve_vqdmullbq_m_n_s16:
9201
    Param0 = 0;
9202
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9203
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9204
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9205
    break;
9206
  case ARM::BI__builtin_arm_mve_vqdmullbq_m_n_s32:
9207
    Param0 = 0;
9208
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
9209
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
9210
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9211
    break;
9212
  case ARM::BI__builtin_arm_mve_vqdmulltq_m_n_s16:
9213
    Param0 = 1;
9214
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9215
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9216
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9217
    break;
9218
  case ARM::BI__builtin_arm_mve_vqdmulltq_m_n_s32:
9219
    Param0 = 1;
9220
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
9221
    Param2 = llvm::FixedVectorType::get(Int64Ty, 2);
9222
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9223
    break;
9224
  }
9225
  Value *Val0 = EmitScalarExpr(E->getArg(1));
9226
  Value *Val1 = EmitScalarExpr(E->getArg(2));
9227
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
9228
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
9229
  Value *Val4 = EmitScalarExpr(E->getArg(3));
9230
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
9231
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val5});
9232
  Value *Val7 = EmitScalarExpr(E->getArg(0));
9233
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vqdmull_predicated, {Param2, Param3, Param1}), {Val0, Val2, Val3, Val6, Val7});
9234
}
9235
case ARM::BI__builtin_arm_mve_vhaddq_m_n_s16:
9236
case ARM::BI__builtin_arm_mve_vhaddq_m_n_s32:
9237
case ARM::BI__builtin_arm_mve_vhaddq_m_n_s8:
9238
case ARM::BI__builtin_arm_mve_vhaddq_m_n_u16:
9239
case ARM::BI__builtin_arm_mve_vhaddq_m_n_u32:
9240
case ARM::BI__builtin_arm_mve_vhaddq_m_n_u8:
9241
case ARM::BI__builtin_arm_mve_vhsubq_m_n_s16:
9242
case ARM::BI__builtin_arm_mve_vhsubq_m_n_s32:
9243
case ARM::BI__builtin_arm_mve_vhsubq_m_n_s8:
9244
case ARM::BI__builtin_arm_mve_vhsubq_m_n_u16:
9245
case ARM::BI__builtin_arm_mve_vhsubq_m_n_u32:
9246
case ARM::BI__builtin_arm_mve_vhsubq_m_n_u8:
9247
case ARM::BI__builtin_arm_mve_vqaddq_m_n_s16:
9248
case ARM::BI__builtin_arm_mve_vqaddq_m_n_s32:
9249
case ARM::BI__builtin_arm_mve_vqaddq_m_n_s8:
9250
case ARM::BI__builtin_arm_mve_vqaddq_m_n_u16:
9251
case ARM::BI__builtin_arm_mve_vqaddq_m_n_u32:
9252
case ARM::BI__builtin_arm_mve_vqaddq_m_n_u8:
9253
case ARM::BI__builtin_arm_mve_vqsubq_m_n_s16:
9254
case ARM::BI__builtin_arm_mve_vqsubq_m_n_s32:
9255
case ARM::BI__builtin_arm_mve_vqsubq_m_n_s8:
9256
case ARM::BI__builtin_arm_mve_vqsubq_m_n_u16:
9257
case ARM::BI__builtin_arm_mve_vqsubq_m_n_u32:
9258
case ARM::BI__builtin_arm_mve_vqsubq_m_n_u8: {
9259
  uint32_t  Param0;
9260
  llvm::Type * Param1;
9261
  Intrinsic::ID  Param2;
9262
  llvm::Type * Param3;
9263
  switch (BuiltinID) {
9264
  case ARM::BI__builtin_arm_mve_vhaddq_m_n_s16:
9265
    Param0 = 0;
9266
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9267
    Param2 = Intrinsic::arm_mve_hadd_predicated;
9268
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9269
    break;
9270
  case ARM::BI__builtin_arm_mve_vhaddq_m_n_s32:
9271
    Param0 = 0;
9272
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9273
    Param2 = Intrinsic::arm_mve_hadd_predicated;
9274
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9275
    break;
9276
  case ARM::BI__builtin_arm_mve_vhaddq_m_n_s8:
9277
    Param0 = 0;
9278
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9279
    Param2 = Intrinsic::arm_mve_hadd_predicated;
9280
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
9281
    break;
9282
  case ARM::BI__builtin_arm_mve_vhaddq_m_n_u16:
9283
    Param0 = 1;
9284
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9285
    Param2 = Intrinsic::arm_mve_hadd_predicated;
9286
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9287
    break;
9288
  case ARM::BI__builtin_arm_mve_vhaddq_m_n_u32:
9289
    Param0 = 1;
9290
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9291
    Param2 = Intrinsic::arm_mve_hadd_predicated;
9292
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9293
    break;
9294
  case ARM::BI__builtin_arm_mve_vhaddq_m_n_u8:
9295
    Param0 = 1;
9296
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9297
    Param2 = Intrinsic::arm_mve_hadd_predicated;
9298
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
9299
    break;
9300
  case ARM::BI__builtin_arm_mve_vhsubq_m_n_s16:
9301
    Param0 = 0;
9302
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9303
    Param2 = Intrinsic::arm_mve_hsub_predicated;
9304
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9305
    break;
9306
  case ARM::BI__builtin_arm_mve_vhsubq_m_n_s32:
9307
    Param0 = 0;
9308
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9309
    Param2 = Intrinsic::arm_mve_hsub_predicated;
9310
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9311
    break;
9312
  case ARM::BI__builtin_arm_mve_vhsubq_m_n_s8:
9313
    Param0 = 0;
9314
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9315
    Param2 = Intrinsic::arm_mve_hsub_predicated;
9316
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
9317
    break;
9318
  case ARM::BI__builtin_arm_mve_vhsubq_m_n_u16:
9319
    Param0 = 1;
9320
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9321
    Param2 = Intrinsic::arm_mve_hsub_predicated;
9322
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9323
    break;
9324
  case ARM::BI__builtin_arm_mve_vhsubq_m_n_u32:
9325
    Param0 = 1;
9326
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9327
    Param2 = Intrinsic::arm_mve_hsub_predicated;
9328
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9329
    break;
9330
  case ARM::BI__builtin_arm_mve_vhsubq_m_n_u8:
9331
    Param0 = 1;
9332
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9333
    Param2 = Intrinsic::arm_mve_hsub_predicated;
9334
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
9335
    break;
9336
  case ARM::BI__builtin_arm_mve_vqaddq_m_n_s16:
9337
    Param0 = 0;
9338
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9339
    Param2 = Intrinsic::arm_mve_qadd_predicated;
9340
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9341
    break;
9342
  case ARM::BI__builtin_arm_mve_vqaddq_m_n_s32:
9343
    Param0 = 0;
9344
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9345
    Param2 = Intrinsic::arm_mve_qadd_predicated;
9346
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9347
    break;
9348
  case ARM::BI__builtin_arm_mve_vqaddq_m_n_s8:
9349
    Param0 = 0;
9350
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9351
    Param2 = Intrinsic::arm_mve_qadd_predicated;
9352
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
9353
    break;
9354
  case ARM::BI__builtin_arm_mve_vqaddq_m_n_u16:
9355
    Param0 = 1;
9356
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9357
    Param2 = Intrinsic::arm_mve_qadd_predicated;
9358
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9359
    break;
9360
  case ARM::BI__builtin_arm_mve_vqaddq_m_n_u32:
9361
    Param0 = 1;
9362
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9363
    Param2 = Intrinsic::arm_mve_qadd_predicated;
9364
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9365
    break;
9366
  case ARM::BI__builtin_arm_mve_vqaddq_m_n_u8:
9367
    Param0 = 1;
9368
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9369
    Param2 = Intrinsic::arm_mve_qadd_predicated;
9370
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
9371
    break;
9372
  case ARM::BI__builtin_arm_mve_vqsubq_m_n_s16:
9373
    Param0 = 0;
9374
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9375
    Param2 = Intrinsic::arm_mve_qsub_predicated;
9376
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9377
    break;
9378
  case ARM::BI__builtin_arm_mve_vqsubq_m_n_s32:
9379
    Param0 = 0;
9380
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9381
    Param2 = Intrinsic::arm_mve_qsub_predicated;
9382
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9383
    break;
9384
  case ARM::BI__builtin_arm_mve_vqsubq_m_n_s8:
9385
    Param0 = 0;
9386
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9387
    Param2 = Intrinsic::arm_mve_qsub_predicated;
9388
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
9389
    break;
9390
  case ARM::BI__builtin_arm_mve_vqsubq_m_n_u16:
9391
    Param0 = 1;
9392
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9393
    Param2 = Intrinsic::arm_mve_qsub_predicated;
9394
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
9395
    break;
9396
  case ARM::BI__builtin_arm_mve_vqsubq_m_n_u32:
9397
    Param0 = 1;
9398
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9399
    Param2 = Intrinsic::arm_mve_qsub_predicated;
9400
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
9401
    break;
9402
  case ARM::BI__builtin_arm_mve_vqsubq_m_n_u8:
9403
    Param0 = 1;
9404
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9405
    Param2 = Intrinsic::arm_mve_qsub_predicated;
9406
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
9407
    break;
9408
  }
9409
  Value *Val0 = EmitScalarExpr(E->getArg(1));
9410
  Value *Val1 = EmitScalarExpr(E->getArg(2));
9411
  Value *Val2 = ARMMVEVectorSplat(Builder, Val1);
9412
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
9413
  Value *Val4 = EmitScalarExpr(E->getArg(3));
9414
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
9415
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val5});
9416
  Value *Val7 = EmitScalarExpr(E->getArg(0));
9417
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param1}), {Val0, Val2, Val3, Val6, Val7});
9418
}
9419
case ARM::BI__builtin_arm_mve_vfmsq_m_f16:
9420
case ARM::BI__builtin_arm_mve_vfmsq_m_f32: {
9421
  llvm::Type * Param0;
9422
  llvm::Type * Param1;
9423
  switch (BuiltinID) {
9424
  case ARM::BI__builtin_arm_mve_vfmsq_m_f16:
9425
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9426
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
9427
    break;
9428
  case ARM::BI__builtin_arm_mve_vfmsq_m_f32:
9429
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9430
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
9431
    break;
9432
  }
9433
  Value *Val0 = EmitScalarExpr(E->getArg(1));
9434
  Value *Val1 = EmitScalarExpr(E->getArg(2));
9435
  Value *Val2 = Builder.CreateFNeg(Val1);
9436
  Value *Val3 = EmitScalarExpr(E->getArg(0));
9437
  Value *Val4 = EmitScalarExpr(E->getArg(3));
9438
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
9439
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val5});
9440
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_fma_predicated, {Param1, Param0}), {Val0, Val2, Val3, Val6});
9441
}
9442
case ARM::BI__builtin_arm_mve_vfmsq_f16:
9443
case ARM::BI__builtin_arm_mve_vfmsq_f32: {
9444
  llvm::Type * Param0;
9445
  switch (BuiltinID) {
9446
  case ARM::BI__builtin_arm_mve_vfmsq_f16:
9447
    Param0 = llvm::FixedVectorType::get(HalfTy, 8);
9448
    break;
9449
  case ARM::BI__builtin_arm_mve_vfmsq_f32:
9450
    Param0 = llvm::FixedVectorType::get(FloatTy, 4);
9451
    break;
9452
  }
9453
  Value *Val0 = EmitScalarExpr(E->getArg(1));
9454
  Value *Val1 = EmitScalarExpr(E->getArg(2));
9455
  Value *Val2 = Builder.CreateFNeg(Val1);
9456
  Value *Val3 = EmitScalarExpr(E->getArg(0));
9457
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::fma, {Param0}), {Val0, Val2, Val3});
9458
}
9459
case ARM::BI__builtin_arm_mve_vabsq_m_f16:
9460
case ARM::BI__builtin_arm_mve_vabsq_m_f32:
9461
case ARM::BI__builtin_arm_mve_vabsq_m_s16:
9462
case ARM::BI__builtin_arm_mve_vabsq_m_s32:
9463
case ARM::BI__builtin_arm_mve_vabsq_m_s8:
9464
case ARM::BI__builtin_arm_mve_vclsq_m_s16:
9465
case ARM::BI__builtin_arm_mve_vclsq_m_s32:
9466
case ARM::BI__builtin_arm_mve_vclsq_m_s8:
9467
case ARM::BI__builtin_arm_mve_vclzq_m_s16:
9468
case ARM::BI__builtin_arm_mve_vclzq_m_s32:
9469
case ARM::BI__builtin_arm_mve_vclzq_m_s8:
9470
case ARM::BI__builtin_arm_mve_vclzq_m_u16:
9471
case ARM::BI__builtin_arm_mve_vclzq_m_u32:
9472
case ARM::BI__builtin_arm_mve_vclzq_m_u8:
9473
case ARM::BI__builtin_arm_mve_vmvnq_m_s16:
9474
case ARM::BI__builtin_arm_mve_vmvnq_m_s32:
9475
case ARM::BI__builtin_arm_mve_vmvnq_m_s8:
9476
case ARM::BI__builtin_arm_mve_vmvnq_m_u16:
9477
case ARM::BI__builtin_arm_mve_vmvnq_m_u32:
9478
case ARM::BI__builtin_arm_mve_vmvnq_m_u8:
9479
case ARM::BI__builtin_arm_mve_vnegq_m_f16:
9480
case ARM::BI__builtin_arm_mve_vnegq_m_f32:
9481
case ARM::BI__builtin_arm_mve_vnegq_m_s16:
9482
case ARM::BI__builtin_arm_mve_vnegq_m_s32:
9483
case ARM::BI__builtin_arm_mve_vnegq_m_s8:
9484
case ARM::BI__builtin_arm_mve_vqabsq_m_s16:
9485
case ARM::BI__builtin_arm_mve_vqabsq_m_s32:
9486
case ARM::BI__builtin_arm_mve_vqabsq_m_s8:
9487
case ARM::BI__builtin_arm_mve_vqnegq_m_s16:
9488
case ARM::BI__builtin_arm_mve_vqnegq_m_s32:
9489
case ARM::BI__builtin_arm_mve_vqnegq_m_s8:
9490
case ARM::BI__builtin_arm_mve_vrndaq_m_f16:
9491
case ARM::BI__builtin_arm_mve_vrndaq_m_f32:
9492
case ARM::BI__builtin_arm_mve_vrndmq_m_f16:
9493
case ARM::BI__builtin_arm_mve_vrndmq_m_f32:
9494
case ARM::BI__builtin_arm_mve_vrndnq_m_f16:
9495
case ARM::BI__builtin_arm_mve_vrndnq_m_f32:
9496
case ARM::BI__builtin_arm_mve_vrndpq_m_f16:
9497
case ARM::BI__builtin_arm_mve_vrndpq_m_f32:
9498
case ARM::BI__builtin_arm_mve_vrndq_m_f16:
9499
case ARM::BI__builtin_arm_mve_vrndq_m_f32:
9500
case ARM::BI__builtin_arm_mve_vrndxq_m_f16:
9501
case ARM::BI__builtin_arm_mve_vrndxq_m_f32: {
9502
  llvm::Type * Param0;
9503
  Intrinsic::ID  Param1;
9504
  llvm::Type * Param2;
9505
  switch (BuiltinID) {
9506
  case ARM::BI__builtin_arm_mve_vabsq_m_f16:
9507
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9508
    Param1 = Intrinsic::arm_mve_abs_predicated;
9509
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9510
    break;
9511
  case ARM::BI__builtin_arm_mve_vabsq_m_f32:
9512
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9513
    Param1 = Intrinsic::arm_mve_abs_predicated;
9514
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9515
    break;
9516
  case ARM::BI__builtin_arm_mve_vabsq_m_s16:
9517
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9518
    Param1 = Intrinsic::arm_mve_abs_predicated;
9519
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9520
    break;
9521
  case ARM::BI__builtin_arm_mve_vabsq_m_s32:
9522
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9523
    Param1 = Intrinsic::arm_mve_abs_predicated;
9524
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9525
    break;
9526
  case ARM::BI__builtin_arm_mve_vabsq_m_s8:
9527
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9528
    Param1 = Intrinsic::arm_mve_abs_predicated;
9529
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9530
    break;
9531
  case ARM::BI__builtin_arm_mve_vclsq_m_s16:
9532
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9533
    Param1 = Intrinsic::arm_mve_cls_predicated;
9534
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9535
    break;
9536
  case ARM::BI__builtin_arm_mve_vclsq_m_s32:
9537
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9538
    Param1 = Intrinsic::arm_mve_cls_predicated;
9539
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9540
    break;
9541
  case ARM::BI__builtin_arm_mve_vclsq_m_s8:
9542
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9543
    Param1 = Intrinsic::arm_mve_cls_predicated;
9544
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9545
    break;
9546
  case ARM::BI__builtin_arm_mve_vclzq_m_s16:
9547
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9548
    Param1 = Intrinsic::arm_mve_clz_predicated;
9549
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9550
    break;
9551
  case ARM::BI__builtin_arm_mve_vclzq_m_s32:
9552
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9553
    Param1 = Intrinsic::arm_mve_clz_predicated;
9554
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9555
    break;
9556
  case ARM::BI__builtin_arm_mve_vclzq_m_s8:
9557
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9558
    Param1 = Intrinsic::arm_mve_clz_predicated;
9559
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9560
    break;
9561
  case ARM::BI__builtin_arm_mve_vclzq_m_u16:
9562
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9563
    Param1 = Intrinsic::arm_mve_clz_predicated;
9564
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9565
    break;
9566
  case ARM::BI__builtin_arm_mve_vclzq_m_u32:
9567
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9568
    Param1 = Intrinsic::arm_mve_clz_predicated;
9569
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9570
    break;
9571
  case ARM::BI__builtin_arm_mve_vclzq_m_u8:
9572
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9573
    Param1 = Intrinsic::arm_mve_clz_predicated;
9574
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9575
    break;
9576
  case ARM::BI__builtin_arm_mve_vmvnq_m_s16:
9577
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9578
    Param1 = Intrinsic::arm_mve_mvn_predicated;
9579
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9580
    break;
9581
  case ARM::BI__builtin_arm_mve_vmvnq_m_s32:
9582
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9583
    Param1 = Intrinsic::arm_mve_mvn_predicated;
9584
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9585
    break;
9586
  case ARM::BI__builtin_arm_mve_vmvnq_m_s8:
9587
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9588
    Param1 = Intrinsic::arm_mve_mvn_predicated;
9589
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9590
    break;
9591
  case ARM::BI__builtin_arm_mve_vmvnq_m_u16:
9592
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9593
    Param1 = Intrinsic::arm_mve_mvn_predicated;
9594
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9595
    break;
9596
  case ARM::BI__builtin_arm_mve_vmvnq_m_u32:
9597
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9598
    Param1 = Intrinsic::arm_mve_mvn_predicated;
9599
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9600
    break;
9601
  case ARM::BI__builtin_arm_mve_vmvnq_m_u8:
9602
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9603
    Param1 = Intrinsic::arm_mve_mvn_predicated;
9604
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9605
    break;
9606
  case ARM::BI__builtin_arm_mve_vnegq_m_f16:
9607
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9608
    Param1 = Intrinsic::arm_mve_neg_predicated;
9609
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9610
    break;
9611
  case ARM::BI__builtin_arm_mve_vnegq_m_f32:
9612
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9613
    Param1 = Intrinsic::arm_mve_neg_predicated;
9614
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9615
    break;
9616
  case ARM::BI__builtin_arm_mve_vnegq_m_s16:
9617
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9618
    Param1 = Intrinsic::arm_mve_neg_predicated;
9619
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9620
    break;
9621
  case ARM::BI__builtin_arm_mve_vnegq_m_s32:
9622
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9623
    Param1 = Intrinsic::arm_mve_neg_predicated;
9624
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9625
    break;
9626
  case ARM::BI__builtin_arm_mve_vnegq_m_s8:
9627
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9628
    Param1 = Intrinsic::arm_mve_neg_predicated;
9629
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9630
    break;
9631
  case ARM::BI__builtin_arm_mve_vqabsq_m_s16:
9632
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9633
    Param1 = Intrinsic::arm_mve_qabs_predicated;
9634
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9635
    break;
9636
  case ARM::BI__builtin_arm_mve_vqabsq_m_s32:
9637
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9638
    Param1 = Intrinsic::arm_mve_qabs_predicated;
9639
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9640
    break;
9641
  case ARM::BI__builtin_arm_mve_vqabsq_m_s8:
9642
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9643
    Param1 = Intrinsic::arm_mve_qabs_predicated;
9644
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9645
    break;
9646
  case ARM::BI__builtin_arm_mve_vqnegq_m_s16:
9647
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9648
    Param1 = Intrinsic::arm_mve_qneg_predicated;
9649
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9650
    break;
9651
  case ARM::BI__builtin_arm_mve_vqnegq_m_s32:
9652
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9653
    Param1 = Intrinsic::arm_mve_qneg_predicated;
9654
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9655
    break;
9656
  case ARM::BI__builtin_arm_mve_vqnegq_m_s8:
9657
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9658
    Param1 = Intrinsic::arm_mve_qneg_predicated;
9659
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9660
    break;
9661
  case ARM::BI__builtin_arm_mve_vrndaq_m_f16:
9662
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9663
    Param1 = Intrinsic::arm_mve_vrinta_predicated;
9664
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9665
    break;
9666
  case ARM::BI__builtin_arm_mve_vrndaq_m_f32:
9667
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9668
    Param1 = Intrinsic::arm_mve_vrinta_predicated;
9669
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9670
    break;
9671
  case ARM::BI__builtin_arm_mve_vrndmq_m_f16:
9672
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9673
    Param1 = Intrinsic::arm_mve_vrintm_predicated;
9674
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9675
    break;
9676
  case ARM::BI__builtin_arm_mve_vrndmq_m_f32:
9677
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9678
    Param1 = Intrinsic::arm_mve_vrintm_predicated;
9679
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9680
    break;
9681
  case ARM::BI__builtin_arm_mve_vrndnq_m_f16:
9682
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9683
    Param1 = Intrinsic::arm_mve_vrintn_predicated;
9684
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9685
    break;
9686
  case ARM::BI__builtin_arm_mve_vrndnq_m_f32:
9687
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9688
    Param1 = Intrinsic::arm_mve_vrintn_predicated;
9689
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9690
    break;
9691
  case ARM::BI__builtin_arm_mve_vrndpq_m_f16:
9692
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9693
    Param1 = Intrinsic::arm_mve_vrintp_predicated;
9694
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9695
    break;
9696
  case ARM::BI__builtin_arm_mve_vrndpq_m_f32:
9697
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9698
    Param1 = Intrinsic::arm_mve_vrintp_predicated;
9699
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9700
    break;
9701
  case ARM::BI__builtin_arm_mve_vrndq_m_f16:
9702
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9703
    Param1 = Intrinsic::arm_mve_vrintz_predicated;
9704
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9705
    break;
9706
  case ARM::BI__builtin_arm_mve_vrndq_m_f32:
9707
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9708
    Param1 = Intrinsic::arm_mve_vrintz_predicated;
9709
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9710
    break;
9711
  case ARM::BI__builtin_arm_mve_vrndxq_m_f16:
9712
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9713
    Param1 = Intrinsic::arm_mve_vrintx_predicated;
9714
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9715
    break;
9716
  case ARM::BI__builtin_arm_mve_vrndxq_m_f32:
9717
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9718
    Param1 = Intrinsic::arm_mve_vrintx_predicated;
9719
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9720
    break;
9721
  }
9722
  Value *Val0 = EmitScalarExpr(E->getArg(1));
9723
  Value *Val1 = EmitScalarExpr(E->getArg(2));
9724
  Value *Val2 = Builder.CreateIntCast(Val1, Int32Ty, false);
9725
  Value *Val3 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val2});
9726
  Value *Val4 = EmitScalarExpr(E->getArg(0));
9727
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val0, Val3, Val4});
9728
}
9729
case ARM::BI__builtin_arm_mve_vaddq_m_f16:
9730
case ARM::BI__builtin_arm_mve_vaddq_m_f32:
9731
case ARM::BI__builtin_arm_mve_vaddq_m_s16:
9732
case ARM::BI__builtin_arm_mve_vaddq_m_s32:
9733
case ARM::BI__builtin_arm_mve_vaddq_m_s8:
9734
case ARM::BI__builtin_arm_mve_vaddq_m_u16:
9735
case ARM::BI__builtin_arm_mve_vaddq_m_u32:
9736
case ARM::BI__builtin_arm_mve_vaddq_m_u8:
9737
case ARM::BI__builtin_arm_mve_vmulq_m_f16:
9738
case ARM::BI__builtin_arm_mve_vmulq_m_f32:
9739
case ARM::BI__builtin_arm_mve_vmulq_m_s16:
9740
case ARM::BI__builtin_arm_mve_vmulq_m_s32:
9741
case ARM::BI__builtin_arm_mve_vmulq_m_s8:
9742
case ARM::BI__builtin_arm_mve_vmulq_m_u16:
9743
case ARM::BI__builtin_arm_mve_vmulq_m_u32:
9744
case ARM::BI__builtin_arm_mve_vmulq_m_u8:
9745
case ARM::BI__builtin_arm_mve_vqdmulhq_m_s16:
9746
case ARM::BI__builtin_arm_mve_vqdmulhq_m_s32:
9747
case ARM::BI__builtin_arm_mve_vqdmulhq_m_s8:
9748
case ARM::BI__builtin_arm_mve_vqrdmulhq_m_s16:
9749
case ARM::BI__builtin_arm_mve_vqrdmulhq_m_s32:
9750
case ARM::BI__builtin_arm_mve_vqrdmulhq_m_s8:
9751
case ARM::BI__builtin_arm_mve_vqshluq_m_n_s16:
9752
case ARM::BI__builtin_arm_mve_vqshluq_m_n_s32:
9753
case ARM::BI__builtin_arm_mve_vqshluq_m_n_s8:
9754
case ARM::BI__builtin_arm_mve_vshlq_m_n_s16:
9755
case ARM::BI__builtin_arm_mve_vshlq_m_n_s32:
9756
case ARM::BI__builtin_arm_mve_vshlq_m_n_s8:
9757
case ARM::BI__builtin_arm_mve_vshlq_m_n_u16:
9758
case ARM::BI__builtin_arm_mve_vshlq_m_n_u32:
9759
case ARM::BI__builtin_arm_mve_vshlq_m_n_u8:
9760
case ARM::BI__builtin_arm_mve_vsubq_m_f16:
9761
case ARM::BI__builtin_arm_mve_vsubq_m_f32:
9762
case ARM::BI__builtin_arm_mve_vsubq_m_s16:
9763
case ARM::BI__builtin_arm_mve_vsubq_m_s32:
9764
case ARM::BI__builtin_arm_mve_vsubq_m_s8:
9765
case ARM::BI__builtin_arm_mve_vsubq_m_u16:
9766
case ARM::BI__builtin_arm_mve_vsubq_m_u32:
9767
case ARM::BI__builtin_arm_mve_vsubq_m_u8: {
9768
  llvm::Type * Param0;
9769
  Intrinsic::ID  Param1;
9770
  llvm::Type * Param2;
9771
  switch (BuiltinID) {
9772
  case ARM::BI__builtin_arm_mve_vaddq_m_f16:
9773
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9774
    Param1 = Intrinsic::arm_mve_add_predicated;
9775
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9776
    break;
9777
  case ARM::BI__builtin_arm_mve_vaddq_m_f32:
9778
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9779
    Param1 = Intrinsic::arm_mve_add_predicated;
9780
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9781
    break;
9782
  case ARM::BI__builtin_arm_mve_vaddq_m_s16:
9783
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9784
    Param1 = Intrinsic::arm_mve_add_predicated;
9785
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9786
    break;
9787
  case ARM::BI__builtin_arm_mve_vaddq_m_s32:
9788
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9789
    Param1 = Intrinsic::arm_mve_add_predicated;
9790
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9791
    break;
9792
  case ARM::BI__builtin_arm_mve_vaddq_m_s8:
9793
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9794
    Param1 = Intrinsic::arm_mve_add_predicated;
9795
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9796
    break;
9797
  case ARM::BI__builtin_arm_mve_vaddq_m_u16:
9798
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9799
    Param1 = Intrinsic::arm_mve_add_predicated;
9800
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9801
    break;
9802
  case ARM::BI__builtin_arm_mve_vaddq_m_u32:
9803
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9804
    Param1 = Intrinsic::arm_mve_add_predicated;
9805
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9806
    break;
9807
  case ARM::BI__builtin_arm_mve_vaddq_m_u8:
9808
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9809
    Param1 = Intrinsic::arm_mve_add_predicated;
9810
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9811
    break;
9812
  case ARM::BI__builtin_arm_mve_vmulq_m_f16:
9813
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9814
    Param1 = Intrinsic::arm_mve_mul_predicated;
9815
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9816
    break;
9817
  case ARM::BI__builtin_arm_mve_vmulq_m_f32:
9818
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9819
    Param1 = Intrinsic::arm_mve_mul_predicated;
9820
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9821
    break;
9822
  case ARM::BI__builtin_arm_mve_vmulq_m_s16:
9823
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9824
    Param1 = Intrinsic::arm_mve_mul_predicated;
9825
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9826
    break;
9827
  case ARM::BI__builtin_arm_mve_vmulq_m_s32:
9828
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9829
    Param1 = Intrinsic::arm_mve_mul_predicated;
9830
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9831
    break;
9832
  case ARM::BI__builtin_arm_mve_vmulq_m_s8:
9833
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9834
    Param1 = Intrinsic::arm_mve_mul_predicated;
9835
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9836
    break;
9837
  case ARM::BI__builtin_arm_mve_vmulq_m_u16:
9838
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9839
    Param1 = Intrinsic::arm_mve_mul_predicated;
9840
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9841
    break;
9842
  case ARM::BI__builtin_arm_mve_vmulq_m_u32:
9843
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9844
    Param1 = Intrinsic::arm_mve_mul_predicated;
9845
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9846
    break;
9847
  case ARM::BI__builtin_arm_mve_vmulq_m_u8:
9848
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9849
    Param1 = Intrinsic::arm_mve_mul_predicated;
9850
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9851
    break;
9852
  case ARM::BI__builtin_arm_mve_vqdmulhq_m_s16:
9853
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9854
    Param1 = Intrinsic::arm_mve_qdmulh_predicated;
9855
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9856
    break;
9857
  case ARM::BI__builtin_arm_mve_vqdmulhq_m_s32:
9858
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9859
    Param1 = Intrinsic::arm_mve_qdmulh_predicated;
9860
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9861
    break;
9862
  case ARM::BI__builtin_arm_mve_vqdmulhq_m_s8:
9863
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9864
    Param1 = Intrinsic::arm_mve_qdmulh_predicated;
9865
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9866
    break;
9867
  case ARM::BI__builtin_arm_mve_vqrdmulhq_m_s16:
9868
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9869
    Param1 = Intrinsic::arm_mve_qrdmulh_predicated;
9870
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9871
    break;
9872
  case ARM::BI__builtin_arm_mve_vqrdmulhq_m_s32:
9873
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9874
    Param1 = Intrinsic::arm_mve_qrdmulh_predicated;
9875
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9876
    break;
9877
  case ARM::BI__builtin_arm_mve_vqrdmulhq_m_s8:
9878
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9879
    Param1 = Intrinsic::arm_mve_qrdmulh_predicated;
9880
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9881
    break;
9882
  case ARM::BI__builtin_arm_mve_vqshluq_m_n_s16:
9883
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9884
    Param1 = Intrinsic::arm_mve_vqshlu_imm_predicated;
9885
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9886
    break;
9887
  case ARM::BI__builtin_arm_mve_vqshluq_m_n_s32:
9888
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9889
    Param1 = Intrinsic::arm_mve_vqshlu_imm_predicated;
9890
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9891
    break;
9892
  case ARM::BI__builtin_arm_mve_vqshluq_m_n_s8:
9893
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9894
    Param1 = Intrinsic::arm_mve_vqshlu_imm_predicated;
9895
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9896
    break;
9897
  case ARM::BI__builtin_arm_mve_vshlq_m_n_s16:
9898
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9899
    Param1 = Intrinsic::arm_mve_shl_imm_predicated;
9900
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9901
    break;
9902
  case ARM::BI__builtin_arm_mve_vshlq_m_n_s32:
9903
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9904
    Param1 = Intrinsic::arm_mve_shl_imm_predicated;
9905
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9906
    break;
9907
  case ARM::BI__builtin_arm_mve_vshlq_m_n_s8:
9908
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9909
    Param1 = Intrinsic::arm_mve_shl_imm_predicated;
9910
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9911
    break;
9912
  case ARM::BI__builtin_arm_mve_vshlq_m_n_u16:
9913
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9914
    Param1 = Intrinsic::arm_mve_shl_imm_predicated;
9915
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9916
    break;
9917
  case ARM::BI__builtin_arm_mve_vshlq_m_n_u32:
9918
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9919
    Param1 = Intrinsic::arm_mve_shl_imm_predicated;
9920
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9921
    break;
9922
  case ARM::BI__builtin_arm_mve_vshlq_m_n_u8:
9923
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9924
    Param1 = Intrinsic::arm_mve_shl_imm_predicated;
9925
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9926
    break;
9927
  case ARM::BI__builtin_arm_mve_vsubq_m_f16:
9928
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9929
    Param1 = Intrinsic::arm_mve_sub_predicated;
9930
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
9931
    break;
9932
  case ARM::BI__builtin_arm_mve_vsubq_m_f32:
9933
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9934
    Param1 = Intrinsic::arm_mve_sub_predicated;
9935
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
9936
    break;
9937
  case ARM::BI__builtin_arm_mve_vsubq_m_s16:
9938
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9939
    Param1 = Intrinsic::arm_mve_sub_predicated;
9940
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9941
    break;
9942
  case ARM::BI__builtin_arm_mve_vsubq_m_s32:
9943
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9944
    Param1 = Intrinsic::arm_mve_sub_predicated;
9945
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9946
    break;
9947
  case ARM::BI__builtin_arm_mve_vsubq_m_s8:
9948
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9949
    Param1 = Intrinsic::arm_mve_sub_predicated;
9950
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9951
    break;
9952
  case ARM::BI__builtin_arm_mve_vsubq_m_u16:
9953
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
9954
    Param1 = Intrinsic::arm_mve_sub_predicated;
9955
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
9956
    break;
9957
  case ARM::BI__builtin_arm_mve_vsubq_m_u32:
9958
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
9959
    Param1 = Intrinsic::arm_mve_sub_predicated;
9960
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
9961
    break;
9962
  case ARM::BI__builtin_arm_mve_vsubq_m_u8:
9963
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
9964
    Param1 = Intrinsic::arm_mve_sub_predicated;
9965
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
9966
    break;
9967
  }
9968
  Value *Val0 = EmitScalarExpr(E->getArg(1));
9969
  Value *Val1 = EmitScalarExpr(E->getArg(2));
9970
  Value *Val2 = EmitScalarExpr(E->getArg(3));
9971
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
9972
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val3});
9973
  Value *Val5 = EmitScalarExpr(E->getArg(0));
9974
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param0}), {Val0, Val1, Val4, Val5});
9975
}
9976
case ARM::BI__builtin_arm_mve_vabdq_m_f16:
9977
case ARM::BI__builtin_arm_mve_vabdq_m_f32:
9978
case ARM::BI__builtin_arm_mve_vabdq_m_s16:
9979
case ARM::BI__builtin_arm_mve_vabdq_m_s32:
9980
case ARM::BI__builtin_arm_mve_vabdq_m_s8:
9981
case ARM::BI__builtin_arm_mve_vabdq_m_u16:
9982
case ARM::BI__builtin_arm_mve_vabdq_m_u32:
9983
case ARM::BI__builtin_arm_mve_vabdq_m_u8:
9984
case ARM::BI__builtin_arm_mve_vhaddq_m_s16:
9985
case ARM::BI__builtin_arm_mve_vhaddq_m_s32:
9986
case ARM::BI__builtin_arm_mve_vhaddq_m_s8:
9987
case ARM::BI__builtin_arm_mve_vhaddq_m_u16:
9988
case ARM::BI__builtin_arm_mve_vhaddq_m_u32:
9989
case ARM::BI__builtin_arm_mve_vhaddq_m_u8:
9990
case ARM::BI__builtin_arm_mve_vhsubq_m_s16:
9991
case ARM::BI__builtin_arm_mve_vhsubq_m_s32:
9992
case ARM::BI__builtin_arm_mve_vhsubq_m_s8:
9993
case ARM::BI__builtin_arm_mve_vhsubq_m_u16:
9994
case ARM::BI__builtin_arm_mve_vhsubq_m_u32:
9995
case ARM::BI__builtin_arm_mve_vhsubq_m_u8:
9996
case ARM::BI__builtin_arm_mve_vmaxnmq_m_f16:
9997
case ARM::BI__builtin_arm_mve_vmaxnmq_m_f32:
9998
case ARM::BI__builtin_arm_mve_vmaxq_m_s16:
9999
case ARM::BI__builtin_arm_mve_vmaxq_m_s32:
10000
case ARM::BI__builtin_arm_mve_vmaxq_m_s8:
10001
case ARM::BI__builtin_arm_mve_vmaxq_m_u16:
10002
case ARM::BI__builtin_arm_mve_vmaxq_m_u32:
10003
case ARM::BI__builtin_arm_mve_vmaxq_m_u8:
10004
case ARM::BI__builtin_arm_mve_vminnmq_m_f16:
10005
case ARM::BI__builtin_arm_mve_vminnmq_m_f32:
10006
case ARM::BI__builtin_arm_mve_vminq_m_s16:
10007
case ARM::BI__builtin_arm_mve_vminq_m_s32:
10008
case ARM::BI__builtin_arm_mve_vminq_m_s8:
10009
case ARM::BI__builtin_arm_mve_vminq_m_u16:
10010
case ARM::BI__builtin_arm_mve_vminq_m_u32:
10011
case ARM::BI__builtin_arm_mve_vminq_m_u8:
10012
case ARM::BI__builtin_arm_mve_vmulhq_m_s16:
10013
case ARM::BI__builtin_arm_mve_vmulhq_m_s32:
10014
case ARM::BI__builtin_arm_mve_vmulhq_m_s8:
10015
case ARM::BI__builtin_arm_mve_vmulhq_m_u16:
10016
case ARM::BI__builtin_arm_mve_vmulhq_m_u32:
10017
case ARM::BI__builtin_arm_mve_vmulhq_m_u8:
10018
case ARM::BI__builtin_arm_mve_vqaddq_m_s16:
10019
case ARM::BI__builtin_arm_mve_vqaddq_m_s32:
10020
case ARM::BI__builtin_arm_mve_vqaddq_m_s8:
10021
case ARM::BI__builtin_arm_mve_vqaddq_m_u16:
10022
case ARM::BI__builtin_arm_mve_vqaddq_m_u32:
10023
case ARM::BI__builtin_arm_mve_vqaddq_m_u8:
10024
case ARM::BI__builtin_arm_mve_vqshlq_m_n_s16:
10025
case ARM::BI__builtin_arm_mve_vqshlq_m_n_s32:
10026
case ARM::BI__builtin_arm_mve_vqshlq_m_n_s8:
10027
case ARM::BI__builtin_arm_mve_vqshlq_m_n_u16:
10028
case ARM::BI__builtin_arm_mve_vqshlq_m_n_u32:
10029
case ARM::BI__builtin_arm_mve_vqshlq_m_n_u8:
10030
case ARM::BI__builtin_arm_mve_vqsubq_m_s16:
10031
case ARM::BI__builtin_arm_mve_vqsubq_m_s32:
10032
case ARM::BI__builtin_arm_mve_vqsubq_m_s8:
10033
case ARM::BI__builtin_arm_mve_vqsubq_m_u16:
10034
case ARM::BI__builtin_arm_mve_vqsubq_m_u32:
10035
case ARM::BI__builtin_arm_mve_vqsubq_m_u8:
10036
case ARM::BI__builtin_arm_mve_vrhaddq_m_s16:
10037
case ARM::BI__builtin_arm_mve_vrhaddq_m_s32:
10038
case ARM::BI__builtin_arm_mve_vrhaddq_m_s8:
10039
case ARM::BI__builtin_arm_mve_vrhaddq_m_u16:
10040
case ARM::BI__builtin_arm_mve_vrhaddq_m_u32:
10041
case ARM::BI__builtin_arm_mve_vrhaddq_m_u8:
10042
case ARM::BI__builtin_arm_mve_vrmulhq_m_s16:
10043
case ARM::BI__builtin_arm_mve_vrmulhq_m_s32:
10044
case ARM::BI__builtin_arm_mve_vrmulhq_m_s8:
10045
case ARM::BI__builtin_arm_mve_vrmulhq_m_u16:
10046
case ARM::BI__builtin_arm_mve_vrmulhq_m_u32:
10047
case ARM::BI__builtin_arm_mve_vrmulhq_m_u8:
10048
case ARM::BI__builtin_arm_mve_vrshrq_m_n_s16:
10049
case ARM::BI__builtin_arm_mve_vrshrq_m_n_s32:
10050
case ARM::BI__builtin_arm_mve_vrshrq_m_n_s8:
10051
case ARM::BI__builtin_arm_mve_vrshrq_m_n_u16:
10052
case ARM::BI__builtin_arm_mve_vrshrq_m_n_u32:
10053
case ARM::BI__builtin_arm_mve_vrshrq_m_n_u8:
10054
case ARM::BI__builtin_arm_mve_vshrq_m_n_s16:
10055
case ARM::BI__builtin_arm_mve_vshrq_m_n_s32:
10056
case ARM::BI__builtin_arm_mve_vshrq_m_n_s8:
10057
case ARM::BI__builtin_arm_mve_vshrq_m_n_u16:
10058
case ARM::BI__builtin_arm_mve_vshrq_m_n_u32:
10059
case ARM::BI__builtin_arm_mve_vshrq_m_n_u8: {
10060
  uint32_t  Param0;
10061
  llvm::Type * Param1;
10062
  Intrinsic::ID  Param2;
10063
  llvm::Type * Param3;
10064
  switch (BuiltinID) {
10065
  case ARM::BI__builtin_arm_mve_vabdq_m_f16:
10066
    Param0 = 0;
10067
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10068
    Param2 = Intrinsic::arm_mve_abd_predicated;
10069
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
10070
    break;
10071
  case ARM::BI__builtin_arm_mve_vabdq_m_f32:
10072
    Param0 = 0;
10073
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10074
    Param2 = Intrinsic::arm_mve_abd_predicated;
10075
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
10076
    break;
10077
  case ARM::BI__builtin_arm_mve_vabdq_m_s16:
10078
    Param0 = 0;
10079
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10080
    Param2 = Intrinsic::arm_mve_abd_predicated;
10081
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10082
    break;
10083
  case ARM::BI__builtin_arm_mve_vabdq_m_s32:
10084
    Param0 = 0;
10085
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10086
    Param2 = Intrinsic::arm_mve_abd_predicated;
10087
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10088
    break;
10089
  case ARM::BI__builtin_arm_mve_vabdq_m_s8:
10090
    Param0 = 0;
10091
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10092
    Param2 = Intrinsic::arm_mve_abd_predicated;
10093
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10094
    break;
10095
  case ARM::BI__builtin_arm_mve_vabdq_m_u16:
10096
    Param0 = 1;
10097
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10098
    Param2 = Intrinsic::arm_mve_abd_predicated;
10099
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10100
    break;
10101
  case ARM::BI__builtin_arm_mve_vabdq_m_u32:
10102
    Param0 = 1;
10103
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10104
    Param2 = Intrinsic::arm_mve_abd_predicated;
10105
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10106
    break;
10107
  case ARM::BI__builtin_arm_mve_vabdq_m_u8:
10108
    Param0 = 1;
10109
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10110
    Param2 = Intrinsic::arm_mve_abd_predicated;
10111
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10112
    break;
10113
  case ARM::BI__builtin_arm_mve_vhaddq_m_s16:
10114
    Param0 = 0;
10115
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10116
    Param2 = Intrinsic::arm_mve_hadd_predicated;
10117
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10118
    break;
10119
  case ARM::BI__builtin_arm_mve_vhaddq_m_s32:
10120
    Param0 = 0;
10121
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10122
    Param2 = Intrinsic::arm_mve_hadd_predicated;
10123
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10124
    break;
10125
  case ARM::BI__builtin_arm_mve_vhaddq_m_s8:
10126
    Param0 = 0;
10127
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10128
    Param2 = Intrinsic::arm_mve_hadd_predicated;
10129
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10130
    break;
10131
  case ARM::BI__builtin_arm_mve_vhaddq_m_u16:
10132
    Param0 = 1;
10133
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10134
    Param2 = Intrinsic::arm_mve_hadd_predicated;
10135
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10136
    break;
10137
  case ARM::BI__builtin_arm_mve_vhaddq_m_u32:
10138
    Param0 = 1;
10139
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10140
    Param2 = Intrinsic::arm_mve_hadd_predicated;
10141
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10142
    break;
10143
  case ARM::BI__builtin_arm_mve_vhaddq_m_u8:
10144
    Param0 = 1;
10145
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10146
    Param2 = Intrinsic::arm_mve_hadd_predicated;
10147
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10148
    break;
10149
  case ARM::BI__builtin_arm_mve_vhsubq_m_s16:
10150
    Param0 = 0;
10151
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10152
    Param2 = Intrinsic::arm_mve_hsub_predicated;
10153
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10154
    break;
10155
  case ARM::BI__builtin_arm_mve_vhsubq_m_s32:
10156
    Param0 = 0;
10157
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10158
    Param2 = Intrinsic::arm_mve_hsub_predicated;
10159
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10160
    break;
10161
  case ARM::BI__builtin_arm_mve_vhsubq_m_s8:
10162
    Param0 = 0;
10163
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10164
    Param2 = Intrinsic::arm_mve_hsub_predicated;
10165
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10166
    break;
10167
  case ARM::BI__builtin_arm_mve_vhsubq_m_u16:
10168
    Param0 = 1;
10169
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10170
    Param2 = Intrinsic::arm_mve_hsub_predicated;
10171
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10172
    break;
10173
  case ARM::BI__builtin_arm_mve_vhsubq_m_u32:
10174
    Param0 = 1;
10175
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10176
    Param2 = Intrinsic::arm_mve_hsub_predicated;
10177
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10178
    break;
10179
  case ARM::BI__builtin_arm_mve_vhsubq_m_u8:
10180
    Param0 = 1;
10181
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10182
    Param2 = Intrinsic::arm_mve_hsub_predicated;
10183
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10184
    break;
10185
  case ARM::BI__builtin_arm_mve_vmaxnmq_m_f16:
10186
    Param0 = 0;
10187
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10188
    Param2 = Intrinsic::arm_mve_max_predicated;
10189
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
10190
    break;
10191
  case ARM::BI__builtin_arm_mve_vmaxnmq_m_f32:
10192
    Param0 = 0;
10193
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10194
    Param2 = Intrinsic::arm_mve_max_predicated;
10195
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
10196
    break;
10197
  case ARM::BI__builtin_arm_mve_vmaxq_m_s16:
10198
    Param0 = 0;
10199
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10200
    Param2 = Intrinsic::arm_mve_max_predicated;
10201
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10202
    break;
10203
  case ARM::BI__builtin_arm_mve_vmaxq_m_s32:
10204
    Param0 = 0;
10205
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10206
    Param2 = Intrinsic::arm_mve_max_predicated;
10207
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10208
    break;
10209
  case ARM::BI__builtin_arm_mve_vmaxq_m_s8:
10210
    Param0 = 0;
10211
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10212
    Param2 = Intrinsic::arm_mve_max_predicated;
10213
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10214
    break;
10215
  case ARM::BI__builtin_arm_mve_vmaxq_m_u16:
10216
    Param0 = 1;
10217
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10218
    Param2 = Intrinsic::arm_mve_max_predicated;
10219
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10220
    break;
10221
  case ARM::BI__builtin_arm_mve_vmaxq_m_u32:
10222
    Param0 = 1;
10223
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10224
    Param2 = Intrinsic::arm_mve_max_predicated;
10225
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10226
    break;
10227
  case ARM::BI__builtin_arm_mve_vmaxq_m_u8:
10228
    Param0 = 1;
10229
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10230
    Param2 = Intrinsic::arm_mve_max_predicated;
10231
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10232
    break;
10233
  case ARM::BI__builtin_arm_mve_vminnmq_m_f16:
10234
    Param0 = 0;
10235
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10236
    Param2 = Intrinsic::arm_mve_min_predicated;
10237
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
10238
    break;
10239
  case ARM::BI__builtin_arm_mve_vminnmq_m_f32:
10240
    Param0 = 0;
10241
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10242
    Param2 = Intrinsic::arm_mve_min_predicated;
10243
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
10244
    break;
10245
  case ARM::BI__builtin_arm_mve_vminq_m_s16:
10246
    Param0 = 0;
10247
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10248
    Param2 = Intrinsic::arm_mve_min_predicated;
10249
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10250
    break;
10251
  case ARM::BI__builtin_arm_mve_vminq_m_s32:
10252
    Param0 = 0;
10253
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10254
    Param2 = Intrinsic::arm_mve_min_predicated;
10255
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10256
    break;
10257
  case ARM::BI__builtin_arm_mve_vminq_m_s8:
10258
    Param0 = 0;
10259
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10260
    Param2 = Intrinsic::arm_mve_min_predicated;
10261
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10262
    break;
10263
  case ARM::BI__builtin_arm_mve_vminq_m_u16:
10264
    Param0 = 1;
10265
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10266
    Param2 = Intrinsic::arm_mve_min_predicated;
10267
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10268
    break;
10269
  case ARM::BI__builtin_arm_mve_vminq_m_u32:
10270
    Param0 = 1;
10271
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10272
    Param2 = Intrinsic::arm_mve_min_predicated;
10273
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10274
    break;
10275
  case ARM::BI__builtin_arm_mve_vminq_m_u8:
10276
    Param0 = 1;
10277
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10278
    Param2 = Intrinsic::arm_mve_min_predicated;
10279
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10280
    break;
10281
  case ARM::BI__builtin_arm_mve_vmulhq_m_s16:
10282
    Param0 = 0;
10283
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10284
    Param2 = Intrinsic::arm_mve_mulh_predicated;
10285
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10286
    break;
10287
  case ARM::BI__builtin_arm_mve_vmulhq_m_s32:
10288
    Param0 = 0;
10289
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10290
    Param2 = Intrinsic::arm_mve_mulh_predicated;
10291
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10292
    break;
10293
  case ARM::BI__builtin_arm_mve_vmulhq_m_s8:
10294
    Param0 = 0;
10295
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10296
    Param2 = Intrinsic::arm_mve_mulh_predicated;
10297
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10298
    break;
10299
  case ARM::BI__builtin_arm_mve_vmulhq_m_u16:
10300
    Param0 = 1;
10301
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10302
    Param2 = Intrinsic::arm_mve_mulh_predicated;
10303
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10304
    break;
10305
  case ARM::BI__builtin_arm_mve_vmulhq_m_u32:
10306
    Param0 = 1;
10307
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10308
    Param2 = Intrinsic::arm_mve_mulh_predicated;
10309
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10310
    break;
10311
  case ARM::BI__builtin_arm_mve_vmulhq_m_u8:
10312
    Param0 = 1;
10313
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10314
    Param2 = Intrinsic::arm_mve_mulh_predicated;
10315
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10316
    break;
10317
  case ARM::BI__builtin_arm_mve_vqaddq_m_s16:
10318
    Param0 = 0;
10319
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10320
    Param2 = Intrinsic::arm_mve_qadd_predicated;
10321
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10322
    break;
10323
  case ARM::BI__builtin_arm_mve_vqaddq_m_s32:
10324
    Param0 = 0;
10325
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10326
    Param2 = Intrinsic::arm_mve_qadd_predicated;
10327
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10328
    break;
10329
  case ARM::BI__builtin_arm_mve_vqaddq_m_s8:
10330
    Param0 = 0;
10331
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10332
    Param2 = Intrinsic::arm_mve_qadd_predicated;
10333
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10334
    break;
10335
  case ARM::BI__builtin_arm_mve_vqaddq_m_u16:
10336
    Param0 = 1;
10337
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10338
    Param2 = Intrinsic::arm_mve_qadd_predicated;
10339
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10340
    break;
10341
  case ARM::BI__builtin_arm_mve_vqaddq_m_u32:
10342
    Param0 = 1;
10343
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10344
    Param2 = Intrinsic::arm_mve_qadd_predicated;
10345
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10346
    break;
10347
  case ARM::BI__builtin_arm_mve_vqaddq_m_u8:
10348
    Param0 = 1;
10349
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10350
    Param2 = Intrinsic::arm_mve_qadd_predicated;
10351
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10352
    break;
10353
  case ARM::BI__builtin_arm_mve_vqshlq_m_n_s16:
10354
    Param0 = 0;
10355
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10356
    Param2 = Intrinsic::arm_mve_vqshl_imm_predicated;
10357
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10358
    break;
10359
  case ARM::BI__builtin_arm_mve_vqshlq_m_n_s32:
10360
    Param0 = 0;
10361
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10362
    Param2 = Intrinsic::arm_mve_vqshl_imm_predicated;
10363
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10364
    break;
10365
  case ARM::BI__builtin_arm_mve_vqshlq_m_n_s8:
10366
    Param0 = 0;
10367
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10368
    Param2 = Intrinsic::arm_mve_vqshl_imm_predicated;
10369
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10370
    break;
10371
  case ARM::BI__builtin_arm_mve_vqshlq_m_n_u16:
10372
    Param0 = 1;
10373
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10374
    Param2 = Intrinsic::arm_mve_vqshl_imm_predicated;
10375
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10376
    break;
10377
  case ARM::BI__builtin_arm_mve_vqshlq_m_n_u32:
10378
    Param0 = 1;
10379
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10380
    Param2 = Intrinsic::arm_mve_vqshl_imm_predicated;
10381
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10382
    break;
10383
  case ARM::BI__builtin_arm_mve_vqshlq_m_n_u8:
10384
    Param0 = 1;
10385
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10386
    Param2 = Intrinsic::arm_mve_vqshl_imm_predicated;
10387
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10388
    break;
10389
  case ARM::BI__builtin_arm_mve_vqsubq_m_s16:
10390
    Param0 = 0;
10391
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10392
    Param2 = Intrinsic::arm_mve_qsub_predicated;
10393
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10394
    break;
10395
  case ARM::BI__builtin_arm_mve_vqsubq_m_s32:
10396
    Param0 = 0;
10397
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10398
    Param2 = Intrinsic::arm_mve_qsub_predicated;
10399
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10400
    break;
10401
  case ARM::BI__builtin_arm_mve_vqsubq_m_s8:
10402
    Param0 = 0;
10403
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10404
    Param2 = Intrinsic::arm_mve_qsub_predicated;
10405
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10406
    break;
10407
  case ARM::BI__builtin_arm_mve_vqsubq_m_u16:
10408
    Param0 = 1;
10409
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10410
    Param2 = Intrinsic::arm_mve_qsub_predicated;
10411
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10412
    break;
10413
  case ARM::BI__builtin_arm_mve_vqsubq_m_u32:
10414
    Param0 = 1;
10415
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10416
    Param2 = Intrinsic::arm_mve_qsub_predicated;
10417
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10418
    break;
10419
  case ARM::BI__builtin_arm_mve_vqsubq_m_u8:
10420
    Param0 = 1;
10421
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10422
    Param2 = Intrinsic::arm_mve_qsub_predicated;
10423
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10424
    break;
10425
  case ARM::BI__builtin_arm_mve_vrhaddq_m_s16:
10426
    Param0 = 0;
10427
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10428
    Param2 = Intrinsic::arm_mve_rhadd_predicated;
10429
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10430
    break;
10431
  case ARM::BI__builtin_arm_mve_vrhaddq_m_s32:
10432
    Param0 = 0;
10433
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10434
    Param2 = Intrinsic::arm_mve_rhadd_predicated;
10435
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10436
    break;
10437
  case ARM::BI__builtin_arm_mve_vrhaddq_m_s8:
10438
    Param0 = 0;
10439
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10440
    Param2 = Intrinsic::arm_mve_rhadd_predicated;
10441
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10442
    break;
10443
  case ARM::BI__builtin_arm_mve_vrhaddq_m_u16:
10444
    Param0 = 1;
10445
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10446
    Param2 = Intrinsic::arm_mve_rhadd_predicated;
10447
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10448
    break;
10449
  case ARM::BI__builtin_arm_mve_vrhaddq_m_u32:
10450
    Param0 = 1;
10451
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10452
    Param2 = Intrinsic::arm_mve_rhadd_predicated;
10453
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10454
    break;
10455
  case ARM::BI__builtin_arm_mve_vrhaddq_m_u8:
10456
    Param0 = 1;
10457
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10458
    Param2 = Intrinsic::arm_mve_rhadd_predicated;
10459
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10460
    break;
10461
  case ARM::BI__builtin_arm_mve_vrmulhq_m_s16:
10462
    Param0 = 0;
10463
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10464
    Param2 = Intrinsic::arm_mve_rmulh_predicated;
10465
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10466
    break;
10467
  case ARM::BI__builtin_arm_mve_vrmulhq_m_s32:
10468
    Param0 = 0;
10469
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10470
    Param2 = Intrinsic::arm_mve_rmulh_predicated;
10471
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10472
    break;
10473
  case ARM::BI__builtin_arm_mve_vrmulhq_m_s8:
10474
    Param0 = 0;
10475
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10476
    Param2 = Intrinsic::arm_mve_rmulh_predicated;
10477
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10478
    break;
10479
  case ARM::BI__builtin_arm_mve_vrmulhq_m_u16:
10480
    Param0 = 1;
10481
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10482
    Param2 = Intrinsic::arm_mve_rmulh_predicated;
10483
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10484
    break;
10485
  case ARM::BI__builtin_arm_mve_vrmulhq_m_u32:
10486
    Param0 = 1;
10487
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10488
    Param2 = Intrinsic::arm_mve_rmulh_predicated;
10489
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10490
    break;
10491
  case ARM::BI__builtin_arm_mve_vrmulhq_m_u8:
10492
    Param0 = 1;
10493
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10494
    Param2 = Intrinsic::arm_mve_rmulh_predicated;
10495
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10496
    break;
10497
  case ARM::BI__builtin_arm_mve_vrshrq_m_n_s16:
10498
    Param0 = 0;
10499
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10500
    Param2 = Intrinsic::arm_mve_vrshr_imm_predicated;
10501
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10502
    break;
10503
  case ARM::BI__builtin_arm_mve_vrshrq_m_n_s32:
10504
    Param0 = 0;
10505
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10506
    Param2 = Intrinsic::arm_mve_vrshr_imm_predicated;
10507
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10508
    break;
10509
  case ARM::BI__builtin_arm_mve_vrshrq_m_n_s8:
10510
    Param0 = 0;
10511
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10512
    Param2 = Intrinsic::arm_mve_vrshr_imm_predicated;
10513
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10514
    break;
10515
  case ARM::BI__builtin_arm_mve_vrshrq_m_n_u16:
10516
    Param0 = 1;
10517
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10518
    Param2 = Intrinsic::arm_mve_vrshr_imm_predicated;
10519
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10520
    break;
10521
  case ARM::BI__builtin_arm_mve_vrshrq_m_n_u32:
10522
    Param0 = 1;
10523
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10524
    Param2 = Intrinsic::arm_mve_vrshr_imm_predicated;
10525
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10526
    break;
10527
  case ARM::BI__builtin_arm_mve_vrshrq_m_n_u8:
10528
    Param0 = 1;
10529
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10530
    Param2 = Intrinsic::arm_mve_vrshr_imm_predicated;
10531
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10532
    break;
10533
  case ARM::BI__builtin_arm_mve_vshrq_m_n_s16:
10534
    Param0 = 0;
10535
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10536
    Param2 = Intrinsic::arm_mve_shr_imm_predicated;
10537
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10538
    break;
10539
  case ARM::BI__builtin_arm_mve_vshrq_m_n_s32:
10540
    Param0 = 0;
10541
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10542
    Param2 = Intrinsic::arm_mve_shr_imm_predicated;
10543
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10544
    break;
10545
  case ARM::BI__builtin_arm_mve_vshrq_m_n_s8:
10546
    Param0 = 0;
10547
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10548
    Param2 = Intrinsic::arm_mve_shr_imm_predicated;
10549
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10550
    break;
10551
  case ARM::BI__builtin_arm_mve_vshrq_m_n_u16:
10552
    Param0 = 1;
10553
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10554
    Param2 = Intrinsic::arm_mve_shr_imm_predicated;
10555
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10556
    break;
10557
  case ARM::BI__builtin_arm_mve_vshrq_m_n_u32:
10558
    Param0 = 1;
10559
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10560
    Param2 = Intrinsic::arm_mve_shr_imm_predicated;
10561
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10562
    break;
10563
  case ARM::BI__builtin_arm_mve_vshrq_m_n_u8:
10564
    Param0 = 1;
10565
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10566
    Param2 = Intrinsic::arm_mve_shr_imm_predicated;
10567
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
10568
    break;
10569
  }
10570
  Value *Val0 = EmitScalarExpr(E->getArg(1));
10571
  Value *Val1 = EmitScalarExpr(E->getArg(2));
10572
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
10573
  Value *Val3 = EmitScalarExpr(E->getArg(3));
10574
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
10575
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val4});
10576
  Value *Val6 = EmitScalarExpr(E->getArg(0));
10577
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param1}), {Val0, Val1, Val2, Val5, Val6});
10578
}
10579
case ARM::BI__builtin_arm_mve_vmullbq_poly_m_p16:
10580
case ARM::BI__builtin_arm_mve_vmullbq_poly_m_p8:
10581
case ARM::BI__builtin_arm_mve_vmulltq_poly_m_p16:
10582
case ARM::BI__builtin_arm_mve_vmulltq_poly_m_p8:
10583
case ARM::BI__builtin_arm_mve_vqdmullbq_m_s16:
10584
case ARM::BI__builtin_arm_mve_vqdmullbq_m_s32:
10585
case ARM::BI__builtin_arm_mve_vqdmulltq_m_s16:
10586
case ARM::BI__builtin_arm_mve_vqdmulltq_m_s32: {
10587
  uint32_t  Param0;
10588
  llvm::Type * Param1;
10589
  Intrinsic::ID  Param2;
10590
  llvm::Type * Param3;
10591
  llvm::Type * Param4;
10592
  switch (BuiltinID) {
10593
  case ARM::BI__builtin_arm_mve_vmullbq_poly_m_p16:
10594
    Param0 = 0;
10595
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10596
    Param2 = Intrinsic::arm_mve_mull_poly_predicated;
10597
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10598
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10599
    break;
10600
  case ARM::BI__builtin_arm_mve_vmullbq_poly_m_p8:
10601
    Param0 = 0;
10602
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10603
    Param2 = Intrinsic::arm_mve_mull_poly_predicated;
10604
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10605
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
10606
    break;
10607
  case ARM::BI__builtin_arm_mve_vmulltq_poly_m_p16:
10608
    Param0 = 1;
10609
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10610
    Param2 = Intrinsic::arm_mve_mull_poly_predicated;
10611
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10612
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10613
    break;
10614
  case ARM::BI__builtin_arm_mve_vmulltq_poly_m_p8:
10615
    Param0 = 1;
10616
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10617
    Param2 = Intrinsic::arm_mve_mull_poly_predicated;
10618
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
10619
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
10620
    break;
10621
  case ARM::BI__builtin_arm_mve_vqdmullbq_m_s16:
10622
    Param0 = 0;
10623
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10624
    Param2 = Intrinsic::arm_mve_vqdmull_predicated;
10625
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10626
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10627
    break;
10628
  case ARM::BI__builtin_arm_mve_vqdmullbq_m_s32:
10629
    Param0 = 0;
10630
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
10631
    Param2 = Intrinsic::arm_mve_vqdmull_predicated;
10632
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
10633
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10634
    break;
10635
  case ARM::BI__builtin_arm_mve_vqdmulltq_m_s16:
10636
    Param0 = 1;
10637
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10638
    Param2 = Intrinsic::arm_mve_vqdmull_predicated;
10639
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
10640
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10641
    break;
10642
  case ARM::BI__builtin_arm_mve_vqdmulltq_m_s32:
10643
    Param0 = 1;
10644
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
10645
    Param2 = Intrinsic::arm_mve_vqdmull_predicated;
10646
    Param3 = llvm::FixedVectorType::get(Int64Ty, 2);
10647
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10648
    break;
10649
  }
10650
  Value *Val0 = EmitScalarExpr(E->getArg(1));
10651
  Value *Val1 = EmitScalarExpr(E->getArg(2));
10652
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
10653
  Value *Val3 = EmitScalarExpr(E->getArg(3));
10654
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
10655
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val4});
10656
  Value *Val6 = EmitScalarExpr(E->getArg(0));
10657
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param4, Param1}), {Val0, Val1, Val2, Val5, Val6});
10658
}
10659
case ARM::BI__builtin_arm_mve_vmullbq_int_m_s16:
10660
case ARM::BI__builtin_arm_mve_vmullbq_int_m_s32:
10661
case ARM::BI__builtin_arm_mve_vmullbq_int_m_s8:
10662
case ARM::BI__builtin_arm_mve_vmullbq_int_m_u16:
10663
case ARM::BI__builtin_arm_mve_vmullbq_int_m_u32:
10664
case ARM::BI__builtin_arm_mve_vmullbq_int_m_u8:
10665
case ARM::BI__builtin_arm_mve_vmulltq_int_m_s16:
10666
case ARM::BI__builtin_arm_mve_vmulltq_int_m_s32:
10667
case ARM::BI__builtin_arm_mve_vmulltq_int_m_s8:
10668
case ARM::BI__builtin_arm_mve_vmulltq_int_m_u16:
10669
case ARM::BI__builtin_arm_mve_vmulltq_int_m_u32:
10670
case ARM::BI__builtin_arm_mve_vmulltq_int_m_u8:
10671
case ARM::BI__builtin_arm_mve_vshllbq_m_n_s16:
10672
case ARM::BI__builtin_arm_mve_vshllbq_m_n_s8:
10673
case ARM::BI__builtin_arm_mve_vshllbq_m_n_u16:
10674
case ARM::BI__builtin_arm_mve_vshllbq_m_n_u8:
10675
case ARM::BI__builtin_arm_mve_vshlltq_m_n_s16:
10676
case ARM::BI__builtin_arm_mve_vshlltq_m_n_s8:
10677
case ARM::BI__builtin_arm_mve_vshlltq_m_n_u16:
10678
case ARM::BI__builtin_arm_mve_vshlltq_m_n_u8: {
10679
  uint32_t  Param0;
10680
  uint32_t  Param1;
10681
  llvm::Type * Param2;
10682
  Intrinsic::ID  Param3;
10683
  llvm::Type * Param4;
10684
  llvm::Type * Param5;
10685
  switch (BuiltinID) {
10686
  case ARM::BI__builtin_arm_mve_vmullbq_int_m_s16:
10687
    Param0 = 0;
10688
    Param1 = 0;
10689
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10690
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10691
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10692
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
10693
    break;
10694
  case ARM::BI__builtin_arm_mve_vmullbq_int_m_s32:
10695
    Param0 = 0;
10696
    Param1 = 0;
10697
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
10698
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10699
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
10700
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
10701
    break;
10702
  case ARM::BI__builtin_arm_mve_vmullbq_int_m_s8:
10703
    Param0 = 0;
10704
    Param1 = 0;
10705
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10706
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10707
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10708
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
10709
    break;
10710
  case ARM::BI__builtin_arm_mve_vmullbq_int_m_u16:
10711
    Param0 = 1;
10712
    Param1 = 0;
10713
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10714
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10715
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10716
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
10717
    break;
10718
  case ARM::BI__builtin_arm_mve_vmullbq_int_m_u32:
10719
    Param0 = 1;
10720
    Param1 = 0;
10721
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
10722
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10723
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
10724
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
10725
    break;
10726
  case ARM::BI__builtin_arm_mve_vmullbq_int_m_u8:
10727
    Param0 = 1;
10728
    Param1 = 0;
10729
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10730
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10731
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10732
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
10733
    break;
10734
  case ARM::BI__builtin_arm_mve_vmulltq_int_m_s16:
10735
    Param0 = 0;
10736
    Param1 = 1;
10737
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10738
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10739
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10740
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
10741
    break;
10742
  case ARM::BI__builtin_arm_mve_vmulltq_int_m_s32:
10743
    Param0 = 0;
10744
    Param1 = 1;
10745
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
10746
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10747
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
10748
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
10749
    break;
10750
  case ARM::BI__builtin_arm_mve_vmulltq_int_m_s8:
10751
    Param0 = 0;
10752
    Param1 = 1;
10753
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10754
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10755
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10756
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
10757
    break;
10758
  case ARM::BI__builtin_arm_mve_vmulltq_int_m_u16:
10759
    Param0 = 1;
10760
    Param1 = 1;
10761
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10762
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10763
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10764
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
10765
    break;
10766
  case ARM::BI__builtin_arm_mve_vmulltq_int_m_u32:
10767
    Param0 = 1;
10768
    Param1 = 1;
10769
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 2);
10770
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10771
    Param4 = llvm::FixedVectorType::get(Int64Ty, 2);
10772
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
10773
    break;
10774
  case ARM::BI__builtin_arm_mve_vmulltq_int_m_u8:
10775
    Param0 = 1;
10776
    Param1 = 1;
10777
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10778
    Param3 = Intrinsic::arm_mve_mull_int_predicated;
10779
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10780
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
10781
    break;
10782
  case ARM::BI__builtin_arm_mve_vshllbq_m_n_s16:
10783
    Param0 = 0;
10784
    Param1 = 0;
10785
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10786
    Param3 = Intrinsic::arm_mve_vshll_imm_predicated;
10787
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10788
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
10789
    break;
10790
  case ARM::BI__builtin_arm_mve_vshllbq_m_n_s8:
10791
    Param0 = 0;
10792
    Param1 = 0;
10793
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10794
    Param3 = Intrinsic::arm_mve_vshll_imm_predicated;
10795
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10796
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
10797
    break;
10798
  case ARM::BI__builtin_arm_mve_vshllbq_m_n_u16:
10799
    Param0 = 1;
10800
    Param1 = 0;
10801
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10802
    Param3 = Intrinsic::arm_mve_vshll_imm_predicated;
10803
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10804
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
10805
    break;
10806
  case ARM::BI__builtin_arm_mve_vshllbq_m_n_u8:
10807
    Param0 = 1;
10808
    Param1 = 0;
10809
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10810
    Param3 = Intrinsic::arm_mve_vshll_imm_predicated;
10811
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10812
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
10813
    break;
10814
  case ARM::BI__builtin_arm_mve_vshlltq_m_n_s16:
10815
    Param0 = 0;
10816
    Param1 = 1;
10817
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10818
    Param3 = Intrinsic::arm_mve_vshll_imm_predicated;
10819
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10820
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
10821
    break;
10822
  case ARM::BI__builtin_arm_mve_vshlltq_m_n_s8:
10823
    Param0 = 0;
10824
    Param1 = 1;
10825
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10826
    Param3 = Intrinsic::arm_mve_vshll_imm_predicated;
10827
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10828
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
10829
    break;
10830
  case ARM::BI__builtin_arm_mve_vshlltq_m_n_u16:
10831
    Param0 = 1;
10832
    Param1 = 1;
10833
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10834
    Param3 = Intrinsic::arm_mve_vshll_imm_predicated;
10835
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10836
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
10837
    break;
10838
  case ARM::BI__builtin_arm_mve_vshlltq_m_n_u8:
10839
    Param0 = 1;
10840
    Param1 = 1;
10841
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10842
    Param3 = Intrinsic::arm_mve_vshll_imm_predicated;
10843
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10844
    Param5 = llvm::FixedVectorType::get(Int8Ty, 16);
10845
    break;
10846
  }
10847
  Value *Val0 = EmitScalarExpr(E->getArg(1));
10848
  Value *Val1 = EmitScalarExpr(E->getArg(2));
10849
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
10850
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
10851
  Value *Val4 = EmitScalarExpr(E->getArg(3));
10852
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
10853
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param2}), {Val5});
10854
  Value *Val7 = EmitScalarExpr(E->getArg(0));
10855
  return Builder.CreateCall(CGM.getIntrinsic(Param3, {Param4, Param5, Param2}), {Val0, Val1, Val2, Val3, Val6, Val7});
10856
}
10857
case ARM::BI__builtin_arm_mve_vqrshlq_m_s16:
10858
case ARM::BI__builtin_arm_mve_vqrshlq_m_s32:
10859
case ARM::BI__builtin_arm_mve_vqrshlq_m_s8:
10860
case ARM::BI__builtin_arm_mve_vqrshlq_m_u16:
10861
case ARM::BI__builtin_arm_mve_vqrshlq_m_u32:
10862
case ARM::BI__builtin_arm_mve_vqrshlq_m_u8:
10863
case ARM::BI__builtin_arm_mve_vqshlq_m_s16:
10864
case ARM::BI__builtin_arm_mve_vqshlq_m_s32:
10865
case ARM::BI__builtin_arm_mve_vqshlq_m_s8:
10866
case ARM::BI__builtin_arm_mve_vqshlq_m_u16:
10867
case ARM::BI__builtin_arm_mve_vqshlq_m_u32:
10868
case ARM::BI__builtin_arm_mve_vqshlq_m_u8:
10869
case ARM::BI__builtin_arm_mve_vrshlq_m_s16:
10870
case ARM::BI__builtin_arm_mve_vrshlq_m_s32:
10871
case ARM::BI__builtin_arm_mve_vrshlq_m_s8:
10872
case ARM::BI__builtin_arm_mve_vrshlq_m_u16:
10873
case ARM::BI__builtin_arm_mve_vrshlq_m_u32:
10874
case ARM::BI__builtin_arm_mve_vrshlq_m_u8:
10875
case ARM::BI__builtin_arm_mve_vshlq_m_s16:
10876
case ARM::BI__builtin_arm_mve_vshlq_m_s32:
10877
case ARM::BI__builtin_arm_mve_vshlq_m_s8:
10878
case ARM::BI__builtin_arm_mve_vshlq_m_u16:
10879
case ARM::BI__builtin_arm_mve_vshlq_m_u32:
10880
case ARM::BI__builtin_arm_mve_vshlq_m_u8: {
10881
  uint32_t  Param0;
10882
  uint32_t  Param1;
10883
  uint32_t  Param2;
10884
  llvm::Type * Param3;
10885
  llvm::Type * Param4;
10886
  switch (BuiltinID) {
10887
  case ARM::BI__builtin_arm_mve_vqrshlq_m_s16:
10888
    Param0 = 1;
10889
    Param1 = 1;
10890
    Param2 = 0;
10891
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10892
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10893
    break;
10894
  case ARM::BI__builtin_arm_mve_vqrshlq_m_s32:
10895
    Param0 = 1;
10896
    Param1 = 1;
10897
    Param2 = 0;
10898
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10899
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10900
    break;
10901
  case ARM::BI__builtin_arm_mve_vqrshlq_m_s8:
10902
    Param0 = 1;
10903
    Param1 = 1;
10904
    Param2 = 0;
10905
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10906
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
10907
    break;
10908
  case ARM::BI__builtin_arm_mve_vqrshlq_m_u16:
10909
    Param0 = 1;
10910
    Param1 = 1;
10911
    Param2 = 1;
10912
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10913
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10914
    break;
10915
  case ARM::BI__builtin_arm_mve_vqrshlq_m_u32:
10916
    Param0 = 1;
10917
    Param1 = 1;
10918
    Param2 = 1;
10919
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10920
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10921
    break;
10922
  case ARM::BI__builtin_arm_mve_vqrshlq_m_u8:
10923
    Param0 = 1;
10924
    Param1 = 1;
10925
    Param2 = 1;
10926
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10927
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
10928
    break;
10929
  case ARM::BI__builtin_arm_mve_vqshlq_m_s16:
10930
    Param0 = 1;
10931
    Param1 = 0;
10932
    Param2 = 0;
10933
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10934
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10935
    break;
10936
  case ARM::BI__builtin_arm_mve_vqshlq_m_s32:
10937
    Param0 = 1;
10938
    Param1 = 0;
10939
    Param2 = 0;
10940
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10941
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10942
    break;
10943
  case ARM::BI__builtin_arm_mve_vqshlq_m_s8:
10944
    Param0 = 1;
10945
    Param1 = 0;
10946
    Param2 = 0;
10947
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10948
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
10949
    break;
10950
  case ARM::BI__builtin_arm_mve_vqshlq_m_u16:
10951
    Param0 = 1;
10952
    Param1 = 0;
10953
    Param2 = 1;
10954
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10955
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10956
    break;
10957
  case ARM::BI__builtin_arm_mve_vqshlq_m_u32:
10958
    Param0 = 1;
10959
    Param1 = 0;
10960
    Param2 = 1;
10961
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10962
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10963
    break;
10964
  case ARM::BI__builtin_arm_mve_vqshlq_m_u8:
10965
    Param0 = 1;
10966
    Param1 = 0;
10967
    Param2 = 1;
10968
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10969
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
10970
    break;
10971
  case ARM::BI__builtin_arm_mve_vrshlq_m_s16:
10972
    Param0 = 0;
10973
    Param1 = 1;
10974
    Param2 = 0;
10975
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10976
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10977
    break;
10978
  case ARM::BI__builtin_arm_mve_vrshlq_m_s32:
10979
    Param0 = 0;
10980
    Param1 = 1;
10981
    Param2 = 0;
10982
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
10983
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
10984
    break;
10985
  case ARM::BI__builtin_arm_mve_vrshlq_m_s8:
10986
    Param0 = 0;
10987
    Param1 = 1;
10988
    Param2 = 0;
10989
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
10990
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
10991
    break;
10992
  case ARM::BI__builtin_arm_mve_vrshlq_m_u16:
10993
    Param0 = 0;
10994
    Param1 = 1;
10995
    Param2 = 1;
10996
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
10997
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
10998
    break;
10999
  case ARM::BI__builtin_arm_mve_vrshlq_m_u32:
11000
    Param0 = 0;
11001
    Param1 = 1;
11002
    Param2 = 1;
11003
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11004
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
11005
    break;
11006
  case ARM::BI__builtin_arm_mve_vrshlq_m_u8:
11007
    Param0 = 0;
11008
    Param1 = 1;
11009
    Param2 = 1;
11010
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11011
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
11012
    break;
11013
  case ARM::BI__builtin_arm_mve_vshlq_m_s16:
11014
    Param0 = 0;
11015
    Param1 = 0;
11016
    Param2 = 0;
11017
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11018
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
11019
    break;
11020
  case ARM::BI__builtin_arm_mve_vshlq_m_s32:
11021
    Param0 = 0;
11022
    Param1 = 0;
11023
    Param2 = 0;
11024
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11025
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
11026
    break;
11027
  case ARM::BI__builtin_arm_mve_vshlq_m_s8:
11028
    Param0 = 0;
11029
    Param1 = 0;
11030
    Param2 = 0;
11031
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11032
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
11033
    break;
11034
  case ARM::BI__builtin_arm_mve_vshlq_m_u16:
11035
    Param0 = 0;
11036
    Param1 = 0;
11037
    Param2 = 1;
11038
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11039
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
11040
    break;
11041
  case ARM::BI__builtin_arm_mve_vshlq_m_u32:
11042
    Param0 = 0;
11043
    Param1 = 0;
11044
    Param2 = 1;
11045
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11046
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
11047
    break;
11048
  case ARM::BI__builtin_arm_mve_vshlq_m_u8:
11049
    Param0 = 0;
11050
    Param1 = 0;
11051
    Param2 = 1;
11052
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11053
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
11054
    break;
11055
  }
11056
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11057
  Value *Val1 = EmitScalarExpr(E->getArg(2));
11058
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
11059
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
11060
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param2);
11061
  Value *Val5 = EmitScalarExpr(E->getArg(3));
11062
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
11063
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val6});
11064
  Value *Val8 = EmitScalarExpr(E->getArg(0));
11065
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshl_vector_predicated, {Param4, Param4, Param3}), {Val0, Val1, Val2, Val3, Val4, Val7, Val8});
11066
}
11067
case ARM::BI__builtin_arm_mve_vaddlvaq_s32:
11068
case ARM::BI__builtin_arm_mve_vaddlvaq_u32:
11069
case ARM::BI__builtin_arm_mve_vaddvaq_s16:
11070
case ARM::BI__builtin_arm_mve_vaddvaq_s32:
11071
case ARM::BI__builtin_arm_mve_vaddvaq_s8:
11072
case ARM::BI__builtin_arm_mve_vaddvaq_u16:
11073
case ARM::BI__builtin_arm_mve_vaddvaq_u32:
11074
case ARM::BI__builtin_arm_mve_vaddvaq_u8: {
11075
  uint32_t  Param0;
11076
  Intrinsic::ID  Param1;
11077
  llvm::Type * Param2;
11078
  switch (BuiltinID) {
11079
  case ARM::BI__builtin_arm_mve_vaddlvaq_s32:
11080
    Param0 = 0;
11081
    Param1 = Intrinsic::arm_mve_addlv;
11082
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
11083
    break;
11084
  case ARM::BI__builtin_arm_mve_vaddlvaq_u32:
11085
    Param0 = 1;
11086
    Param1 = Intrinsic::arm_mve_addlv;
11087
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
11088
    break;
11089
  case ARM::BI__builtin_arm_mve_vaddvaq_s16:
11090
    Param0 = 0;
11091
    Param1 = Intrinsic::arm_mve_addv;
11092
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
11093
    break;
11094
  case ARM::BI__builtin_arm_mve_vaddvaq_s32:
11095
    Param0 = 0;
11096
    Param1 = Intrinsic::arm_mve_addv;
11097
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
11098
    break;
11099
  case ARM::BI__builtin_arm_mve_vaddvaq_s8:
11100
    Param0 = 0;
11101
    Param1 = Intrinsic::arm_mve_addv;
11102
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
11103
    break;
11104
  case ARM::BI__builtin_arm_mve_vaddvaq_u16:
11105
    Param0 = 1;
11106
    Param1 = Intrinsic::arm_mve_addv;
11107
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
11108
    break;
11109
  case ARM::BI__builtin_arm_mve_vaddvaq_u32:
11110
    Param0 = 1;
11111
    Param1 = Intrinsic::arm_mve_addv;
11112
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
11113
    break;
11114
  case ARM::BI__builtin_arm_mve_vaddvaq_u8:
11115
    Param0 = 1;
11116
    Param1 = Intrinsic::arm_mve_addv;
11117
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
11118
    break;
11119
  }
11120
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11121
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param0);
11122
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2}), {Val0, Val1});
11123
  Value *Val3 = EmitScalarExpr(E->getArg(0));
11124
  return Builder.CreateAdd(Val2, Val3);
11125
}
11126
case ARM::BI__builtin_arm_mve_vaddlvaq_p_s32:
11127
case ARM::BI__builtin_arm_mve_vaddlvaq_p_u32:
11128
case ARM::BI__builtin_arm_mve_vaddvaq_p_s16:
11129
case ARM::BI__builtin_arm_mve_vaddvaq_p_s32:
11130
case ARM::BI__builtin_arm_mve_vaddvaq_p_s8:
11131
case ARM::BI__builtin_arm_mve_vaddvaq_p_u16:
11132
case ARM::BI__builtin_arm_mve_vaddvaq_p_u32:
11133
case ARM::BI__builtin_arm_mve_vaddvaq_p_u8: {
11134
  uint32_t  Param0;
11135
  llvm::Type * Param1;
11136
  Intrinsic::ID  Param2;
11137
  llvm::Type * Param3;
11138
  switch (BuiltinID) {
11139
  case ARM::BI__builtin_arm_mve_vaddlvaq_p_s32:
11140
    Param0 = 0;
11141
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11142
    Param2 = Intrinsic::arm_mve_addlv_predicated;
11143
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11144
    break;
11145
  case ARM::BI__builtin_arm_mve_vaddlvaq_p_u32:
11146
    Param0 = 1;
11147
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11148
    Param2 = Intrinsic::arm_mve_addlv_predicated;
11149
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11150
    break;
11151
  case ARM::BI__builtin_arm_mve_vaddvaq_p_s16:
11152
    Param0 = 0;
11153
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11154
    Param2 = Intrinsic::arm_mve_addv_predicated;
11155
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
11156
    break;
11157
  case ARM::BI__builtin_arm_mve_vaddvaq_p_s32:
11158
    Param0 = 0;
11159
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11160
    Param2 = Intrinsic::arm_mve_addv_predicated;
11161
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11162
    break;
11163
  case ARM::BI__builtin_arm_mve_vaddvaq_p_s8:
11164
    Param0 = 0;
11165
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11166
    Param2 = Intrinsic::arm_mve_addv_predicated;
11167
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
11168
    break;
11169
  case ARM::BI__builtin_arm_mve_vaddvaq_p_u16:
11170
    Param0 = 1;
11171
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11172
    Param2 = Intrinsic::arm_mve_addv_predicated;
11173
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
11174
    break;
11175
  case ARM::BI__builtin_arm_mve_vaddvaq_p_u32:
11176
    Param0 = 1;
11177
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11178
    Param2 = Intrinsic::arm_mve_addv_predicated;
11179
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11180
    break;
11181
  case ARM::BI__builtin_arm_mve_vaddvaq_p_u8:
11182
    Param0 = 1;
11183
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11184
    Param2 = Intrinsic::arm_mve_addv_predicated;
11185
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
11186
    break;
11187
  }
11188
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11189
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param0);
11190
  Value *Val2 = EmitScalarExpr(E->getArg(2));
11191
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
11192
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val3});
11193
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param1}), {Val0, Val1, Val4});
11194
  Value *Val6 = EmitScalarExpr(E->getArg(0));
11195
  return Builder.CreateAdd(Val5, Val6);
11196
}
11197
case ARM::BI__builtin_arm_mve_vcvtq_m_f16_s16:
11198
case ARM::BI__builtin_arm_mve_vcvtq_m_f16_u16:
11199
case ARM::BI__builtin_arm_mve_vcvtq_m_f32_s32:
11200
case ARM::BI__builtin_arm_mve_vcvtq_m_f32_u32:
11201
case ARM::BI__builtin_arm_mve_vcvtq_m_s16_f16:
11202
case ARM::BI__builtin_arm_mve_vcvtq_m_s32_f32:
11203
case ARM::BI__builtin_arm_mve_vcvtq_m_u16_f16:
11204
case ARM::BI__builtin_arm_mve_vcvtq_m_u32_f32: {
11205
  uint32_t  Param0;
11206
  llvm::Type * Param1;
11207
  llvm::Type * Param2;
11208
  llvm::Type * Param3;
11209
  switch (BuiltinID) {
11210
  case ARM::BI__builtin_arm_mve_vcvtq_m_f16_s16:
11211
    Param0 = 0;
11212
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11213
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
11214
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
11215
    break;
11216
  case ARM::BI__builtin_arm_mve_vcvtq_m_f16_u16:
11217
    Param0 = 1;
11218
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11219
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
11220
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
11221
    break;
11222
  case ARM::BI__builtin_arm_mve_vcvtq_m_f32_s32:
11223
    Param0 = 0;
11224
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11225
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
11226
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11227
    break;
11228
  case ARM::BI__builtin_arm_mve_vcvtq_m_f32_u32:
11229
    Param0 = 1;
11230
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11231
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
11232
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11233
    break;
11234
  case ARM::BI__builtin_arm_mve_vcvtq_m_s16_f16:
11235
    Param0 = 0;
11236
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11237
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
11238
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
11239
    break;
11240
  case ARM::BI__builtin_arm_mve_vcvtq_m_s32_f32:
11241
    Param0 = 0;
11242
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11243
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
11244
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
11245
    break;
11246
  case ARM::BI__builtin_arm_mve_vcvtq_m_u16_f16:
11247
    Param0 = 1;
11248
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11249
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
11250
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
11251
    break;
11252
  case ARM::BI__builtin_arm_mve_vcvtq_m_u32_f32:
11253
    Param0 = 1;
11254
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11255
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
11256
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
11257
    break;
11258
  }
11259
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11260
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param0);
11261
  Value *Val2 = EmitScalarExpr(E->getArg(2));
11262
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
11263
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val3});
11264
  Value *Val5 = EmitScalarExpr(E->getArg(0));
11265
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fp_int_predicated, {Param2, Param3, Param1}), {Val0, Val1, Val4, Val5});
11266
}
11267
case ARM::BI__builtin_arm_mve_vrev16q_m_s8:
11268
case ARM::BI__builtin_arm_mve_vrev16q_m_u8:
11269
case ARM::BI__builtin_arm_mve_vrev32q_m_f16:
11270
case ARM::BI__builtin_arm_mve_vrev32q_m_s16:
11271
case ARM::BI__builtin_arm_mve_vrev32q_m_s8:
11272
case ARM::BI__builtin_arm_mve_vrev32q_m_u16:
11273
case ARM::BI__builtin_arm_mve_vrev32q_m_u8:
11274
case ARM::BI__builtin_arm_mve_vrev64q_m_f16:
11275
case ARM::BI__builtin_arm_mve_vrev64q_m_f32:
11276
case ARM::BI__builtin_arm_mve_vrev64q_m_s16:
11277
case ARM::BI__builtin_arm_mve_vrev64q_m_s32:
11278
case ARM::BI__builtin_arm_mve_vrev64q_m_s8:
11279
case ARM::BI__builtin_arm_mve_vrev64q_m_u16:
11280
case ARM::BI__builtin_arm_mve_vrev64q_m_u32:
11281
case ARM::BI__builtin_arm_mve_vrev64q_m_u8: {
11282
  uint32_t  Param0;
11283
  llvm::Type * Param1;
11284
  llvm::Type * Param2;
11285
  switch (BuiltinID) {
11286
  case ARM::BI__builtin_arm_mve_vrev16q_m_s8:
11287
    Param0 = 16;
11288
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11289
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
11290
    break;
11291
  case ARM::BI__builtin_arm_mve_vrev16q_m_u8:
11292
    Param0 = 16;
11293
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11294
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
11295
    break;
11296
  case ARM::BI__builtin_arm_mve_vrev32q_m_f16:
11297
    Param0 = 32;
11298
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11299
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
11300
    break;
11301
  case ARM::BI__builtin_arm_mve_vrev32q_m_s16:
11302
    Param0 = 32;
11303
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11304
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
11305
    break;
11306
  case ARM::BI__builtin_arm_mve_vrev32q_m_s8:
11307
    Param0 = 32;
11308
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11309
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
11310
    break;
11311
  case ARM::BI__builtin_arm_mve_vrev32q_m_u16:
11312
    Param0 = 32;
11313
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11314
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
11315
    break;
11316
  case ARM::BI__builtin_arm_mve_vrev32q_m_u8:
11317
    Param0 = 32;
11318
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11319
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
11320
    break;
11321
  case ARM::BI__builtin_arm_mve_vrev64q_m_f16:
11322
    Param0 = 64;
11323
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11324
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
11325
    break;
11326
  case ARM::BI__builtin_arm_mve_vrev64q_m_f32:
11327
    Param0 = 64;
11328
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11329
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
11330
    break;
11331
  case ARM::BI__builtin_arm_mve_vrev64q_m_s16:
11332
    Param0 = 64;
11333
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11334
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
11335
    break;
11336
  case ARM::BI__builtin_arm_mve_vrev64q_m_s32:
11337
    Param0 = 64;
11338
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11339
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
11340
    break;
11341
  case ARM::BI__builtin_arm_mve_vrev64q_m_s8:
11342
    Param0 = 64;
11343
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11344
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
11345
    break;
11346
  case ARM::BI__builtin_arm_mve_vrev64q_m_u16:
11347
    Param0 = 64;
11348
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11349
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
11350
    break;
11351
  case ARM::BI__builtin_arm_mve_vrev64q_m_u32:
11352
    Param0 = 64;
11353
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11354
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
11355
    break;
11356
  case ARM::BI__builtin_arm_mve_vrev64q_m_u8:
11357
    Param0 = 64;
11358
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
11359
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
11360
    break;
11361
  }
11362
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11363
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param0);
11364
  Value *Val2 = EmitScalarExpr(E->getArg(2));
11365
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
11366
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val3});
11367
  Value *Val5 = EmitScalarExpr(E->getArg(0));
11368
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vrev_predicated, {Param2, Param1}), {Val0, Val1, Val4, Val5});
11369
}
11370
case ARM::BI__builtin_arm_mve_vmovlbq_m_s16:
11371
case ARM::BI__builtin_arm_mve_vmovlbq_m_s8:
11372
case ARM::BI__builtin_arm_mve_vmovlbq_m_u16:
11373
case ARM::BI__builtin_arm_mve_vmovlbq_m_u8:
11374
case ARM::BI__builtin_arm_mve_vmovltq_m_s16:
11375
case ARM::BI__builtin_arm_mve_vmovltq_m_s8:
11376
case ARM::BI__builtin_arm_mve_vmovltq_m_u16:
11377
case ARM::BI__builtin_arm_mve_vmovltq_m_u8: {
11378
  uint32_t  Param0;
11379
  uint32_t  Param1;
11380
  llvm::Type * Param2;
11381
  llvm::Type * Param3;
11382
  llvm::Type * Param4;
11383
  switch (BuiltinID) {
11384
  case ARM::BI__builtin_arm_mve_vmovlbq_m_s16:
11385
    Param0 = 0;
11386
    Param1 = 0;
11387
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11388
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11389
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
11390
    break;
11391
  case ARM::BI__builtin_arm_mve_vmovlbq_m_s8:
11392
    Param0 = 0;
11393
    Param1 = 0;
11394
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11395
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
11396
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
11397
    break;
11398
  case ARM::BI__builtin_arm_mve_vmovlbq_m_u16:
11399
    Param0 = 1;
11400
    Param1 = 0;
11401
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11402
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11403
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
11404
    break;
11405
  case ARM::BI__builtin_arm_mve_vmovlbq_m_u8:
11406
    Param0 = 1;
11407
    Param1 = 0;
11408
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11409
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
11410
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
11411
    break;
11412
  case ARM::BI__builtin_arm_mve_vmovltq_m_s16:
11413
    Param0 = 0;
11414
    Param1 = 1;
11415
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11416
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11417
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
11418
    break;
11419
  case ARM::BI__builtin_arm_mve_vmovltq_m_s8:
11420
    Param0 = 0;
11421
    Param1 = 1;
11422
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11423
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
11424
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
11425
    break;
11426
  case ARM::BI__builtin_arm_mve_vmovltq_m_u16:
11427
    Param0 = 1;
11428
    Param1 = 1;
11429
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11430
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
11431
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
11432
    break;
11433
  case ARM::BI__builtin_arm_mve_vmovltq_m_u8:
11434
    Param0 = 1;
11435
    Param1 = 1;
11436
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11437
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
11438
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
11439
    break;
11440
  }
11441
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11442
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param0);
11443
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param1);
11444
  Value *Val3 = EmitScalarExpr(E->getArg(2));
11445
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
11446
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param2}), {Val4});
11447
  Value *Val6 = EmitScalarExpr(E->getArg(0));
11448
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vmovl_predicated, {Param3, Param4, Param2}), {Val0, Val1, Val2, Val5, Val6});
11449
}
11450
case ARM::BI__builtin_arm_mve_vstrhq_s32:
11451
case ARM::BI__builtin_arm_mve_vstrhq_u32: {
11452
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11453
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 4);
11454
  Value *Val2 = Builder.CreateTrunc(Val0, Val1);
11455
  Address Val3 = EmitPointerWithAlignment(E->getArg(0));
11456
  Value *Val4 = Builder.CreatePointerCast((Val3.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 4)));
11457
  Address Val5 = Address(Val4, llvm::FixedVectorType::get(Int16Ty, 4), CharUnits::fromQuantity(2));
11458
  return Builder.CreateStore(Val2, Val5);
11459
}
11460
case ARM::BI__builtin_arm_mve_vstrhq_p_s32:
11461
case ARM::BI__builtin_arm_mve_vstrhq_p_u32: {
11462
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11463
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 4);
11464
  Value *Val2 = Builder.CreateTrunc(Val0, Val1);
11465
  Address Val3 = EmitPointerWithAlignment(E->getArg(0));
11466
  Value *Val4 = Builder.CreatePointerCast((Val3.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 4)));
11467
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, 2);
11468
  Value *Val6 = EmitScalarExpr(E->getArg(2));
11469
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
11470
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
11471
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_store, {llvm::FixedVectorType::get(Int16Ty, 4), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int16Ty, 4))}), {Val2, Val4, Val5, Val8});
11472
}
11473
case ARM::BI__builtin_arm_mve_vandq_m_f16:
11474
case ARM::BI__builtin_arm_mve_vbicq_m_f16:
11475
case ARM::BI__builtin_arm_mve_veorq_m_f16:
11476
case ARM::BI__builtin_arm_mve_vornq_m_f16:
11477
case ARM::BI__builtin_arm_mve_vorrq_m_f16: {
11478
  Intrinsic::ID  Param0;
11479
  switch (BuiltinID) {
11480
  case ARM::BI__builtin_arm_mve_vandq_m_f16:
11481
    Param0 = Intrinsic::arm_mve_and_predicated;
11482
    break;
11483
  case ARM::BI__builtin_arm_mve_vbicq_m_f16:
11484
    Param0 = Intrinsic::arm_mve_bic_predicated;
11485
    break;
11486
  case ARM::BI__builtin_arm_mve_veorq_m_f16:
11487
    Param0 = Intrinsic::arm_mve_eor_predicated;
11488
    break;
11489
  case ARM::BI__builtin_arm_mve_vornq_m_f16:
11490
    Param0 = Intrinsic::arm_mve_orn_predicated;
11491
    break;
11492
  case ARM::BI__builtin_arm_mve_vorrq_m_f16:
11493
    Param0 = Intrinsic::arm_mve_orr_predicated;
11494
    break;
11495
  }
11496
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11497
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
11498
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
11499
  Value *Val3 = EmitScalarExpr(E->getArg(2));
11500
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
11501
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
11502
  Value *Val6 = EmitScalarExpr(E->getArg(3));
11503
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
11504
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val7});
11505
  Value *Val9 = EmitScalarExpr(E->getArg(0));
11506
  llvm::Type *Val10 = llvm::FixedVectorType::get(Int16Ty, 8);
11507
  Value *Val11 = Builder.CreateBitCast(Val9, Val10);
11508
  Value *Val12 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val5, Val8, Val11});
11509
  llvm::Type *Val13 = llvm::FixedVectorType::get(HalfTy, 8);
11510
  return Builder.CreateBitCast(Val12, Val13);
11511
}
11512
case ARM::BI__builtin_arm_mve_vandq_m_s16:
11513
case ARM::BI__builtin_arm_mve_vandq_m_u16:
11514
case ARM::BI__builtin_arm_mve_vbicq_m_s16:
11515
case ARM::BI__builtin_arm_mve_vbicq_m_u16:
11516
case ARM::BI__builtin_arm_mve_veorq_m_s16:
11517
case ARM::BI__builtin_arm_mve_veorq_m_u16:
11518
case ARM::BI__builtin_arm_mve_vornq_m_s16:
11519
case ARM::BI__builtin_arm_mve_vornq_m_u16:
11520
case ARM::BI__builtin_arm_mve_vorrq_m_s16:
11521
case ARM::BI__builtin_arm_mve_vorrq_m_u16: {
11522
  Intrinsic::ID  Param0;
11523
  switch (BuiltinID) {
11524
  case ARM::BI__builtin_arm_mve_vandq_m_s16:
11525
    Param0 = Intrinsic::arm_mve_and_predicated;
11526
    break;
11527
  case ARM::BI__builtin_arm_mve_vandq_m_u16:
11528
    Param0 = Intrinsic::arm_mve_and_predicated;
11529
    break;
11530
  case ARM::BI__builtin_arm_mve_vbicq_m_s16:
11531
    Param0 = Intrinsic::arm_mve_bic_predicated;
11532
    break;
11533
  case ARM::BI__builtin_arm_mve_vbicq_m_u16:
11534
    Param0 = Intrinsic::arm_mve_bic_predicated;
11535
    break;
11536
  case ARM::BI__builtin_arm_mve_veorq_m_s16:
11537
    Param0 = Intrinsic::arm_mve_eor_predicated;
11538
    break;
11539
  case ARM::BI__builtin_arm_mve_veorq_m_u16:
11540
    Param0 = Intrinsic::arm_mve_eor_predicated;
11541
    break;
11542
  case ARM::BI__builtin_arm_mve_vornq_m_s16:
11543
    Param0 = Intrinsic::arm_mve_orn_predicated;
11544
    break;
11545
  case ARM::BI__builtin_arm_mve_vornq_m_u16:
11546
    Param0 = Intrinsic::arm_mve_orn_predicated;
11547
    break;
11548
  case ARM::BI__builtin_arm_mve_vorrq_m_s16:
11549
    Param0 = Intrinsic::arm_mve_orr_predicated;
11550
    break;
11551
  case ARM::BI__builtin_arm_mve_vorrq_m_u16:
11552
    Param0 = Intrinsic::arm_mve_orr_predicated;
11553
    break;
11554
  }
11555
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11556
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
11557
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
11558
  Value *Val3 = EmitScalarExpr(E->getArg(2));
11559
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
11560
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
11561
  Value *Val6 = EmitScalarExpr(E->getArg(3));
11562
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
11563
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val7});
11564
  Value *Val9 = EmitScalarExpr(E->getArg(0));
11565
  llvm::Type *Val10 = llvm::FixedVectorType::get(Int16Ty, 8);
11566
  Value *Val11 = Builder.CreateBitCast(Val9, Val10);
11567
  Value *Val12 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val5, Val8, Val11});
11568
  llvm::Type *Val13 = llvm::FixedVectorType::get(Int16Ty, 8);
11569
  return Builder.CreateBitCast(Val12, Val13);
11570
}
11571
case ARM::BI__builtin_arm_mve_vmaxaq_s16: {
11572
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11573
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
11574
  Value *Val2 = llvm::Constant::getNullValue(Val1);
11575
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
11576
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
11577
  Value *Val5 = llvm::Constant::getNullValue(Val4);
11578
  Value *Val6 = Builder.CreateSub(Val5, Val0);
11579
  Value *Val7 = Builder.CreateSelect(Val3, Val6, Val0);
11580
  Value *Val8 = EmitScalarExpr(E->getArg(0));
11581
  Value *Val9 = Builder.CreateICmpUGE(Val8, Val7);
11582
  return Builder.CreateSelect(Val9, Val8, Val7);
11583
}
11584
case ARM::BI__builtin_arm_mve_vminaq_s16: {
11585
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11586
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int16Ty, 8);
11587
  Value *Val2 = llvm::Constant::getNullValue(Val1);
11588
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
11589
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int16Ty, 8);
11590
  Value *Val5 = llvm::Constant::getNullValue(Val4);
11591
  Value *Val6 = Builder.CreateSub(Val5, Val0);
11592
  Value *Val7 = Builder.CreateSelect(Val3, Val6, Val0);
11593
  Value *Val8 = EmitScalarExpr(E->getArg(0));
11594
  Value *Val9 = Builder.CreateICmpULE(Val8, Val7);
11595
  return Builder.CreateSelect(Val9, Val8, Val7);
11596
}
11597
case ARM::BI__builtin_arm_mve_vandq_m_f32:
11598
case ARM::BI__builtin_arm_mve_vbicq_m_f32:
11599
case ARM::BI__builtin_arm_mve_veorq_m_f32:
11600
case ARM::BI__builtin_arm_mve_vornq_m_f32:
11601
case ARM::BI__builtin_arm_mve_vorrq_m_f32: {
11602
  Intrinsic::ID  Param0;
11603
  switch (BuiltinID) {
11604
  case ARM::BI__builtin_arm_mve_vandq_m_f32:
11605
    Param0 = Intrinsic::arm_mve_and_predicated;
11606
    break;
11607
  case ARM::BI__builtin_arm_mve_vbicq_m_f32:
11608
    Param0 = Intrinsic::arm_mve_bic_predicated;
11609
    break;
11610
  case ARM::BI__builtin_arm_mve_veorq_m_f32:
11611
    Param0 = Intrinsic::arm_mve_eor_predicated;
11612
    break;
11613
  case ARM::BI__builtin_arm_mve_vornq_m_f32:
11614
    Param0 = Intrinsic::arm_mve_orn_predicated;
11615
    break;
11616
  case ARM::BI__builtin_arm_mve_vorrq_m_f32:
11617
    Param0 = Intrinsic::arm_mve_orr_predicated;
11618
    break;
11619
  }
11620
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11621
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
11622
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
11623
  Value *Val3 = EmitScalarExpr(E->getArg(2));
11624
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
11625
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
11626
  Value *Val6 = EmitScalarExpr(E->getArg(3));
11627
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
11628
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
11629
  Value *Val9 = EmitScalarExpr(E->getArg(0));
11630
  llvm::Type *Val10 = llvm::FixedVectorType::get(Int32Ty, 4);
11631
  Value *Val11 = Builder.CreateBitCast(Val9, Val10);
11632
  Value *Val12 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val5, Val8, Val11});
11633
  llvm::Type *Val13 = llvm::FixedVectorType::get(FloatTy, 4);
11634
  return Builder.CreateBitCast(Val12, Val13);
11635
}
11636
case ARM::BI__builtin_arm_mve_vandq_m_s32:
11637
case ARM::BI__builtin_arm_mve_vandq_m_u32:
11638
case ARM::BI__builtin_arm_mve_vbicq_m_s32:
11639
case ARM::BI__builtin_arm_mve_vbicq_m_u32:
11640
case ARM::BI__builtin_arm_mve_veorq_m_s32:
11641
case ARM::BI__builtin_arm_mve_veorq_m_u32:
11642
case ARM::BI__builtin_arm_mve_vornq_m_s32:
11643
case ARM::BI__builtin_arm_mve_vornq_m_u32:
11644
case ARM::BI__builtin_arm_mve_vorrq_m_s32:
11645
case ARM::BI__builtin_arm_mve_vorrq_m_u32: {
11646
  Intrinsic::ID  Param0;
11647
  switch (BuiltinID) {
11648
  case ARM::BI__builtin_arm_mve_vandq_m_s32:
11649
    Param0 = Intrinsic::arm_mve_and_predicated;
11650
    break;
11651
  case ARM::BI__builtin_arm_mve_vandq_m_u32:
11652
    Param0 = Intrinsic::arm_mve_and_predicated;
11653
    break;
11654
  case ARM::BI__builtin_arm_mve_vbicq_m_s32:
11655
    Param0 = Intrinsic::arm_mve_bic_predicated;
11656
    break;
11657
  case ARM::BI__builtin_arm_mve_vbicq_m_u32:
11658
    Param0 = Intrinsic::arm_mve_bic_predicated;
11659
    break;
11660
  case ARM::BI__builtin_arm_mve_veorq_m_s32:
11661
    Param0 = Intrinsic::arm_mve_eor_predicated;
11662
    break;
11663
  case ARM::BI__builtin_arm_mve_veorq_m_u32:
11664
    Param0 = Intrinsic::arm_mve_eor_predicated;
11665
    break;
11666
  case ARM::BI__builtin_arm_mve_vornq_m_s32:
11667
    Param0 = Intrinsic::arm_mve_orn_predicated;
11668
    break;
11669
  case ARM::BI__builtin_arm_mve_vornq_m_u32:
11670
    Param0 = Intrinsic::arm_mve_orn_predicated;
11671
    break;
11672
  case ARM::BI__builtin_arm_mve_vorrq_m_s32:
11673
    Param0 = Intrinsic::arm_mve_orr_predicated;
11674
    break;
11675
  case ARM::BI__builtin_arm_mve_vorrq_m_u32:
11676
    Param0 = Intrinsic::arm_mve_orr_predicated;
11677
    break;
11678
  }
11679
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11680
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
11681
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
11682
  Value *Val3 = EmitScalarExpr(E->getArg(2));
11683
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
11684
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
11685
  Value *Val6 = EmitScalarExpr(E->getArg(3));
11686
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
11687
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
11688
  Value *Val9 = EmitScalarExpr(E->getArg(0));
11689
  llvm::Type *Val10 = llvm::FixedVectorType::get(Int32Ty, 4);
11690
  Value *Val11 = Builder.CreateBitCast(Val9, Val10);
11691
  Value *Val12 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val5, Val8, Val11});
11692
  llvm::Type *Val13 = llvm::FixedVectorType::get(Int32Ty, 4);
11693
  return Builder.CreateBitCast(Val12, Val13);
11694
}
11695
case ARM::BI__builtin_arm_mve_vmaxaq_s32: {
11696
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11697
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
11698
  Value *Val2 = llvm::Constant::getNullValue(Val1);
11699
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
11700
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
11701
  Value *Val5 = llvm::Constant::getNullValue(Val4);
11702
  Value *Val6 = Builder.CreateSub(Val5, Val0);
11703
  Value *Val7 = Builder.CreateSelect(Val3, Val6, Val0);
11704
  Value *Val8 = EmitScalarExpr(E->getArg(0));
11705
  Value *Val9 = Builder.CreateICmpUGE(Val8, Val7);
11706
  return Builder.CreateSelect(Val9, Val8, Val7);
11707
}
11708
case ARM::BI__builtin_arm_mve_vminaq_s32: {
11709
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11710
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int32Ty, 4);
11711
  Value *Val2 = llvm::Constant::getNullValue(Val1);
11712
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
11713
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
11714
  Value *Val5 = llvm::Constant::getNullValue(Val4);
11715
  Value *Val6 = Builder.CreateSub(Val5, Val0);
11716
  Value *Val7 = Builder.CreateSelect(Val3, Val6, Val0);
11717
  Value *Val8 = EmitScalarExpr(E->getArg(0));
11718
  Value *Val9 = Builder.CreateICmpULE(Val8, Val7);
11719
  return Builder.CreateSelect(Val9, Val8, Val7);
11720
}
11721
case ARM::BI__builtin_arm_mve_vandq_m_s8:
11722
case ARM::BI__builtin_arm_mve_vandq_m_u8:
11723
case ARM::BI__builtin_arm_mve_vbicq_m_s8:
11724
case ARM::BI__builtin_arm_mve_vbicq_m_u8:
11725
case ARM::BI__builtin_arm_mve_veorq_m_s8:
11726
case ARM::BI__builtin_arm_mve_veorq_m_u8:
11727
case ARM::BI__builtin_arm_mve_vornq_m_s8:
11728
case ARM::BI__builtin_arm_mve_vornq_m_u8:
11729
case ARM::BI__builtin_arm_mve_vorrq_m_s8:
11730
case ARM::BI__builtin_arm_mve_vorrq_m_u8: {
11731
  Intrinsic::ID  Param0;
11732
  switch (BuiltinID) {
11733
  case ARM::BI__builtin_arm_mve_vandq_m_s8:
11734
    Param0 = Intrinsic::arm_mve_and_predicated;
11735
    break;
11736
  case ARM::BI__builtin_arm_mve_vandq_m_u8:
11737
    Param0 = Intrinsic::arm_mve_and_predicated;
11738
    break;
11739
  case ARM::BI__builtin_arm_mve_vbicq_m_s8:
11740
    Param0 = Intrinsic::arm_mve_bic_predicated;
11741
    break;
11742
  case ARM::BI__builtin_arm_mve_vbicq_m_u8:
11743
    Param0 = Intrinsic::arm_mve_bic_predicated;
11744
    break;
11745
  case ARM::BI__builtin_arm_mve_veorq_m_s8:
11746
    Param0 = Intrinsic::arm_mve_eor_predicated;
11747
    break;
11748
  case ARM::BI__builtin_arm_mve_veorq_m_u8:
11749
    Param0 = Intrinsic::arm_mve_eor_predicated;
11750
    break;
11751
  case ARM::BI__builtin_arm_mve_vornq_m_s8:
11752
    Param0 = Intrinsic::arm_mve_orn_predicated;
11753
    break;
11754
  case ARM::BI__builtin_arm_mve_vornq_m_u8:
11755
    Param0 = Intrinsic::arm_mve_orn_predicated;
11756
    break;
11757
  case ARM::BI__builtin_arm_mve_vorrq_m_s8:
11758
    Param0 = Intrinsic::arm_mve_orr_predicated;
11759
    break;
11760
  case ARM::BI__builtin_arm_mve_vorrq_m_u8:
11761
    Param0 = Intrinsic::arm_mve_orr_predicated;
11762
    break;
11763
  }
11764
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11765
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 16);
11766
  Value *Val2 = Builder.CreateBitCast(Val0, Val1);
11767
  Value *Val3 = EmitScalarExpr(E->getArg(2));
11768
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int8Ty, 16);
11769
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
11770
  Value *Val6 = EmitScalarExpr(E->getArg(3));
11771
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
11772
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val7});
11773
  Value *Val9 = EmitScalarExpr(E->getArg(0));
11774
  llvm::Type *Val10 = llvm::FixedVectorType::get(Int8Ty, 16);
11775
  Value *Val11 = Builder.CreateBitCast(Val9, Val10);
11776
  Value *Val12 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val5, Val8, Val11});
11777
  llvm::Type *Val13 = llvm::FixedVectorType::get(Int8Ty, 16);
11778
  return Builder.CreateBitCast(Val12, Val13);
11779
}
11780
case ARM::BI__builtin_arm_mve_vmaxaq_s8: {
11781
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11782
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 16);
11783
  Value *Val2 = llvm::Constant::getNullValue(Val1);
11784
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
11785
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int8Ty, 16);
11786
  Value *Val5 = llvm::Constant::getNullValue(Val4);
11787
  Value *Val6 = Builder.CreateSub(Val5, Val0);
11788
  Value *Val7 = Builder.CreateSelect(Val3, Val6, Val0);
11789
  Value *Val8 = EmitScalarExpr(E->getArg(0));
11790
  Value *Val9 = Builder.CreateICmpUGE(Val8, Val7);
11791
  return Builder.CreateSelect(Val9, Val8, Val7);
11792
}
11793
case ARM::BI__builtin_arm_mve_vminaq_s8: {
11794
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11795
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 16);
11796
  Value *Val2 = llvm::Constant::getNullValue(Val1);
11797
  Value *Val3 = Builder.CreateICmpSLT(Val0, Val2);
11798
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int8Ty, 16);
11799
  Value *Val5 = llvm::Constant::getNullValue(Val4);
11800
  Value *Val6 = Builder.CreateSub(Val5, Val0);
11801
  Value *Val7 = Builder.CreateSelect(Val3, Val6, Val0);
11802
  Value *Val8 = EmitScalarExpr(E->getArg(0));
11803
  Value *Val9 = Builder.CreateICmpULE(Val8, Val7);
11804
  return Builder.CreateSelect(Val9, Val8, Val7);
11805
}
11806
case ARM::BI__builtin_arm_mve_vstrbq_s32:
11807
case ARM::BI__builtin_arm_mve_vstrbq_u32: {
11808
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11809
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 4);
11810
  Value *Val2 = Builder.CreateTrunc(Val0, Val1);
11811
  Address Val3 = EmitPointerWithAlignment(E->getArg(0));
11812
  Value *Val4 = Builder.CreatePointerCast((Val3.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 4)));
11813
  Address Val5 = Address(Val4, llvm::FixedVectorType::get(Int8Ty, 4), CharUnits::fromQuantity(1));
11814
  return Builder.CreateStore(Val2, Val5);
11815
}
11816
case ARM::BI__builtin_arm_mve_vstrbq_p_s32:
11817
case ARM::BI__builtin_arm_mve_vstrbq_p_u32: {
11818
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11819
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 4);
11820
  Value *Val2 = Builder.CreateTrunc(Val0, Val1);
11821
  Address Val3 = EmitPointerWithAlignment(E->getArg(0));
11822
  Value *Val4 = Builder.CreatePointerCast((Val3.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 4)));
11823
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, 1);
11824
  Value *Val6 = EmitScalarExpr(E->getArg(2));
11825
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
11826
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
11827
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_store, {llvm::FixedVectorType::get(Int8Ty, 4), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 4))}), {Val2, Val4, Val5, Val8});
11828
}
11829
case ARM::BI__builtin_arm_mve_vstrbq_s16:
11830
case ARM::BI__builtin_arm_mve_vstrbq_u16: {
11831
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11832
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 8);
11833
  Value *Val2 = Builder.CreateTrunc(Val0, Val1);
11834
  Address Val3 = EmitPointerWithAlignment(E->getArg(0));
11835
  Value *Val4 = Builder.CreatePointerCast((Val3.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 8)));
11836
  Address Val5 = Address(Val4, llvm::FixedVectorType::get(Int8Ty, 8), CharUnits::fromQuantity(1));
11837
  return Builder.CreateStore(Val2, Val5);
11838
}
11839
case ARM::BI__builtin_arm_mve_vstrbq_p_s16:
11840
case ARM::BI__builtin_arm_mve_vstrbq_p_u16: {
11841
  Value *Val0 = EmitScalarExpr(E->getArg(1));
11842
  llvm::Type *Val1 = llvm::FixedVectorType::get(Int8Ty, 8);
11843
  Value *Val2 = Builder.CreateTrunc(Val0, Val1);
11844
  Address Val3 = EmitPointerWithAlignment(E->getArg(0));
11845
  Value *Val4 = Builder.CreatePointerCast((Val3.getPointer()), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 8)));
11846
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, 1);
11847
  Value *Val6 = EmitScalarExpr(E->getArg(2));
11848
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
11849
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val7});
11850
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::masked_store, {llvm::FixedVectorType::get(Int8Ty, 8), llvm::PointerType::getUnqual(llvm::FixedVectorType::get(Int8Ty, 8))}), {Val2, Val4, Val5, Val8});
11851
}
11852
case ARM::BI__builtin_arm_mve_vfmasq_m_n_f16:
11853
case ARM::BI__builtin_arm_mve_vfmasq_m_n_f32: {
11854
  llvm::Type * Param0;
11855
  llvm::Type * Param1;
11856
  switch (BuiltinID) {
11857
  case ARM::BI__builtin_arm_mve_vfmasq_m_n_f16:
11858
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11859
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
11860
    break;
11861
  case ARM::BI__builtin_arm_mve_vfmasq_m_n_f32:
11862
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11863
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
11864
    break;
11865
  }
11866
  Value *Val0 = EmitScalarExpr(E->getArg(2));
11867
  Value *Val1 = ARMMVEVectorSplat(Builder, Val0);
11868
  Value *Val2 = EmitScalarExpr(E->getArg(0));
11869
  Value *Val3 = EmitScalarExpr(E->getArg(1));
11870
  Value *Val4 = (Val3);
11871
  Value *Val5 = EmitScalarExpr(E->getArg(3));
11872
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
11873
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val6});
11874
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_fma_predicated, {Param1, Param0}), {Val2, Val4, Val1, Val7});
11875
}
11876
case ARM::BI__builtin_arm_mve_vfmasq_n_f16:
11877
case ARM::BI__builtin_arm_mve_vfmasq_n_f32: {
11878
  llvm::Type * Param0;
11879
  switch (BuiltinID) {
11880
  case ARM::BI__builtin_arm_mve_vfmasq_n_f16:
11881
    Param0 = llvm::FixedVectorType::get(HalfTy, 8);
11882
    break;
11883
  case ARM::BI__builtin_arm_mve_vfmasq_n_f32:
11884
    Param0 = llvm::FixedVectorType::get(FloatTy, 4);
11885
    break;
11886
  }
11887
  Value *Val0 = EmitScalarExpr(E->getArg(2));
11888
  Value *Val1 = ARMMVEVectorSplat(Builder, Val0);
11889
  Value *Val2 = EmitScalarExpr(E->getArg(0));
11890
  Value *Val3 = EmitScalarExpr(E->getArg(1));
11891
  Value *Val4 = (Val3);
11892
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::fma, {Param0}), {Val2, Val4, Val1});
11893
}
11894
case ARM::BI__builtin_arm_mve_vfmaq_m_n_f16:
11895
case ARM::BI__builtin_arm_mve_vfmaq_m_n_f32: {
11896
  llvm::Type * Param0;
11897
  llvm::Type * Param1;
11898
  switch (BuiltinID) {
11899
  case ARM::BI__builtin_arm_mve_vfmaq_m_n_f16:
11900
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11901
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
11902
    break;
11903
  case ARM::BI__builtin_arm_mve_vfmaq_m_n_f32:
11904
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11905
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
11906
    break;
11907
  }
11908
  Value *Val0 = EmitScalarExpr(E->getArg(2));
11909
  Value *Val1 = ARMMVEVectorSplat(Builder, Val0);
11910
  Value *Val2 = EmitScalarExpr(E->getArg(1));
11911
  Value *Val3 = (Val1);
11912
  Value *Val4 = EmitScalarExpr(E->getArg(0));
11913
  Value *Val5 = EmitScalarExpr(E->getArg(3));
11914
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
11915
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val6});
11916
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_fma_predicated, {Param1, Param0}), {Val2, Val3, Val4, Val7});
11917
}
11918
case ARM::BI__builtin_arm_mve_vfmaq_n_f16:
11919
case ARM::BI__builtin_arm_mve_vfmaq_n_f32: {
11920
  llvm::Type * Param0;
11921
  switch (BuiltinID) {
11922
  case ARM::BI__builtin_arm_mve_vfmaq_n_f16:
11923
    Param0 = llvm::FixedVectorType::get(HalfTy, 8);
11924
    break;
11925
  case ARM::BI__builtin_arm_mve_vfmaq_n_f32:
11926
    Param0 = llvm::FixedVectorType::get(FloatTy, 4);
11927
    break;
11928
  }
11929
  Value *Val0 = EmitScalarExpr(E->getArg(2));
11930
  Value *Val1 = ARMMVEVectorSplat(Builder, Val0);
11931
  Value *Val2 = EmitScalarExpr(E->getArg(1));
11932
  Value *Val3 = (Val1);
11933
  Value *Val4 = EmitScalarExpr(E->getArg(0));
11934
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::fma, {Param0}), {Val2, Val3, Val4});
11935
}
11936
case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_f16:
11937
case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_f32: {
11938
  llvm::Type * Param0;
11939
  switch (BuiltinID) {
11940
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_f16:
11941
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11942
    break;
11943
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_f32:
11944
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11945
    break;
11946
  }
11947
  Value *Val0 = EmitScalarExpr(E->getArg(2));
11948
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
11949
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
11950
  Value *Val3 = EmitScalarExpr(E->getArg(0));
11951
  Value *Val4 = EmitScalarExpr(E->getArg(1));
11952
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
11953
  Value *Val6 = Builder.CreateFCmpOEQ(Val3, Val5);
11954
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
11955
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
11956
  return Builder.CreateIntCast(Val8, Int16Ty, false);
11957
}
11958
case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_f16:
11959
case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_f32: {
11960
  llvm::Type * Param0;
11961
  switch (BuiltinID) {
11962
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_f16:
11963
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11964
    break;
11965
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_f32:
11966
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11967
    break;
11968
  }
11969
  Value *Val0 = EmitScalarExpr(E->getArg(2));
11970
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
11971
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
11972
  Value *Val3 = EmitScalarExpr(E->getArg(0));
11973
  Value *Val4 = EmitScalarExpr(E->getArg(1));
11974
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
11975
  Value *Val6 = Builder.CreateFCmpOGE(Val3, Val5);
11976
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
11977
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
11978
  return Builder.CreateIntCast(Val8, Int16Ty, false);
11979
}
11980
case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_f16:
11981
case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_f32: {
11982
  llvm::Type * Param0;
11983
  switch (BuiltinID) {
11984
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_f16:
11985
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
11986
    break;
11987
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_f32:
11988
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
11989
    break;
11990
  }
11991
  Value *Val0 = EmitScalarExpr(E->getArg(2));
11992
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
11993
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
11994
  Value *Val3 = EmitScalarExpr(E->getArg(0));
11995
  Value *Val4 = EmitScalarExpr(E->getArg(1));
11996
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
11997
  Value *Val6 = Builder.CreateFCmpOGT(Val3, Val5);
11998
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
11999
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12000
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12001
}
12002
case ARM::BI__builtin_arm_mve_vcmpleq_m_n_f16:
12003
case ARM::BI__builtin_arm_mve_vcmpleq_m_n_f32: {
12004
  llvm::Type * Param0;
12005
  switch (BuiltinID) {
12006
  case ARM::BI__builtin_arm_mve_vcmpleq_m_n_f16:
12007
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12008
    break;
12009
  case ARM::BI__builtin_arm_mve_vcmpleq_m_n_f32:
12010
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12011
    break;
12012
  }
12013
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12014
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12015
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12016
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12017
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12018
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12019
  Value *Val6 = Builder.CreateFCmpOLE(Val3, Val5);
12020
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12021
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12022
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12023
}
12024
case ARM::BI__builtin_arm_mve_vcmpltq_m_n_f16:
12025
case ARM::BI__builtin_arm_mve_vcmpltq_m_n_f32: {
12026
  llvm::Type * Param0;
12027
  switch (BuiltinID) {
12028
  case ARM::BI__builtin_arm_mve_vcmpltq_m_n_f16:
12029
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12030
    break;
12031
  case ARM::BI__builtin_arm_mve_vcmpltq_m_n_f32:
12032
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12033
    break;
12034
  }
12035
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12036
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12037
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12038
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12039
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12040
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12041
  Value *Val6 = Builder.CreateFCmpOLT(Val3, Val5);
12042
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12043
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12044
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12045
}
12046
case ARM::BI__builtin_arm_mve_vcmpneq_m_n_f16:
12047
case ARM::BI__builtin_arm_mve_vcmpneq_m_n_f32: {
12048
  llvm::Type * Param0;
12049
  switch (BuiltinID) {
12050
  case ARM::BI__builtin_arm_mve_vcmpneq_m_n_f16:
12051
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12052
    break;
12053
  case ARM::BI__builtin_arm_mve_vcmpneq_m_n_f32:
12054
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12055
    break;
12056
  }
12057
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12058
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12059
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12060
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12061
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12062
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12063
  Value *Val6 = Builder.CreateFCmpUNE(Val3, Val5);
12064
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12065
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12066
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12067
}
12068
case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_s16:
12069
case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_s32:
12070
case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_s8:
12071
case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_u16:
12072
case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_u32:
12073
case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_u8: {
12074
  llvm::Type * Param0;
12075
  switch (BuiltinID) {
12076
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_s16:
12077
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12078
    break;
12079
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_s32:
12080
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12081
    break;
12082
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_s8:
12083
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12084
    break;
12085
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_u16:
12086
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12087
    break;
12088
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_u32:
12089
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12090
    break;
12091
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_n_u8:
12092
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12093
    break;
12094
  }
12095
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12096
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12097
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12098
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12099
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12100
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12101
  Value *Val6 = Builder.CreateICmpEQ(Val3, Val5);
12102
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12103
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12104
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12105
}
12106
case ARM::BI__builtin_arm_mve_vcmpneq_m_n_s16:
12107
case ARM::BI__builtin_arm_mve_vcmpneq_m_n_s32:
12108
case ARM::BI__builtin_arm_mve_vcmpneq_m_n_s8:
12109
case ARM::BI__builtin_arm_mve_vcmpneq_m_n_u16:
12110
case ARM::BI__builtin_arm_mve_vcmpneq_m_n_u32:
12111
case ARM::BI__builtin_arm_mve_vcmpneq_m_n_u8: {
12112
  llvm::Type * Param0;
12113
  switch (BuiltinID) {
12114
  case ARM::BI__builtin_arm_mve_vcmpneq_m_n_s16:
12115
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12116
    break;
12117
  case ARM::BI__builtin_arm_mve_vcmpneq_m_n_s32:
12118
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12119
    break;
12120
  case ARM::BI__builtin_arm_mve_vcmpneq_m_n_s8:
12121
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12122
    break;
12123
  case ARM::BI__builtin_arm_mve_vcmpneq_m_n_u16:
12124
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12125
    break;
12126
  case ARM::BI__builtin_arm_mve_vcmpneq_m_n_u32:
12127
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12128
    break;
12129
  case ARM::BI__builtin_arm_mve_vcmpneq_m_n_u8:
12130
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12131
    break;
12132
  }
12133
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12134
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12135
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12136
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12137
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12138
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12139
  Value *Val6 = Builder.CreateICmpNE(Val3, Val5);
12140
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12141
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12142
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12143
}
12144
case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_s16:
12145
case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_s32:
12146
case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_s8: {
12147
  llvm::Type * Param0;
12148
  switch (BuiltinID) {
12149
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_s16:
12150
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12151
    break;
12152
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_s32:
12153
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12154
    break;
12155
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_n_s8:
12156
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12157
    break;
12158
  }
12159
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12160
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12161
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12162
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12163
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12164
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12165
  Value *Val6 = Builder.CreateICmpSGE(Val3, Val5);
12166
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12167
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12168
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12169
}
12170
case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_s16:
12171
case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_s32:
12172
case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_s8: {
12173
  llvm::Type * Param0;
12174
  switch (BuiltinID) {
12175
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_s16:
12176
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12177
    break;
12178
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_s32:
12179
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12180
    break;
12181
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_n_s8:
12182
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12183
    break;
12184
  }
12185
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12186
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12187
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12188
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12189
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12190
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12191
  Value *Val6 = Builder.CreateICmpSGT(Val3, Val5);
12192
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12193
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12194
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12195
}
12196
case ARM::BI__builtin_arm_mve_vcmpleq_m_n_s16:
12197
case ARM::BI__builtin_arm_mve_vcmpleq_m_n_s32:
12198
case ARM::BI__builtin_arm_mve_vcmpleq_m_n_s8: {
12199
  llvm::Type * Param0;
12200
  switch (BuiltinID) {
12201
  case ARM::BI__builtin_arm_mve_vcmpleq_m_n_s16:
12202
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12203
    break;
12204
  case ARM::BI__builtin_arm_mve_vcmpleq_m_n_s32:
12205
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12206
    break;
12207
  case ARM::BI__builtin_arm_mve_vcmpleq_m_n_s8:
12208
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12209
    break;
12210
  }
12211
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12212
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12213
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12214
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12215
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12216
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12217
  Value *Val6 = Builder.CreateICmpSLE(Val3, Val5);
12218
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12219
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12220
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12221
}
12222
case ARM::BI__builtin_arm_mve_vcmpltq_m_n_s16:
12223
case ARM::BI__builtin_arm_mve_vcmpltq_m_n_s32:
12224
case ARM::BI__builtin_arm_mve_vcmpltq_m_n_s8: {
12225
  llvm::Type * Param0;
12226
  switch (BuiltinID) {
12227
  case ARM::BI__builtin_arm_mve_vcmpltq_m_n_s16:
12228
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12229
    break;
12230
  case ARM::BI__builtin_arm_mve_vcmpltq_m_n_s32:
12231
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12232
    break;
12233
  case ARM::BI__builtin_arm_mve_vcmpltq_m_n_s8:
12234
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12235
    break;
12236
  }
12237
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12238
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12239
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12240
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12241
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12242
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12243
  Value *Val6 = Builder.CreateICmpSLT(Val3, Val5);
12244
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12245
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12246
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12247
}
12248
case ARM::BI__builtin_arm_mve_vcmpcsq_m_n_u16:
12249
case ARM::BI__builtin_arm_mve_vcmpcsq_m_n_u32:
12250
case ARM::BI__builtin_arm_mve_vcmpcsq_m_n_u8: {
12251
  llvm::Type * Param0;
12252
  switch (BuiltinID) {
12253
  case ARM::BI__builtin_arm_mve_vcmpcsq_m_n_u16:
12254
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12255
    break;
12256
  case ARM::BI__builtin_arm_mve_vcmpcsq_m_n_u32:
12257
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12258
    break;
12259
  case ARM::BI__builtin_arm_mve_vcmpcsq_m_n_u8:
12260
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12261
    break;
12262
  }
12263
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12264
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12265
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12266
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12267
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12268
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12269
  Value *Val6 = Builder.CreateICmpUGE(Val3, Val5);
12270
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12271
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12272
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12273
}
12274
case ARM::BI__builtin_arm_mve_vcmphiq_m_n_u16:
12275
case ARM::BI__builtin_arm_mve_vcmphiq_m_n_u32:
12276
case ARM::BI__builtin_arm_mve_vcmphiq_m_n_u8: {
12277
  llvm::Type * Param0;
12278
  switch (BuiltinID) {
12279
  case ARM::BI__builtin_arm_mve_vcmphiq_m_n_u16:
12280
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12281
    break;
12282
  case ARM::BI__builtin_arm_mve_vcmphiq_m_n_u32:
12283
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12284
    break;
12285
  case ARM::BI__builtin_arm_mve_vcmphiq_m_n_u8:
12286
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12287
    break;
12288
  }
12289
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12290
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12291
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12292
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12293
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12294
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12295
  Value *Val6 = Builder.CreateICmpUGT(Val3, Val5);
12296
  Value *Val7 = Builder.CreateAnd(Val2, Val6);
12297
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val7});
12298
  return Builder.CreateIntCast(Val8, Int16Ty, false);
12299
}
12300
case ARM::BI__builtin_arm_mve_vcmpeqq_m_f16:
12301
case ARM::BI__builtin_arm_mve_vcmpeqq_m_f32: {
12302
  llvm::Type * Param0;
12303
  switch (BuiltinID) {
12304
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_f16:
12305
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12306
    break;
12307
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_f32:
12308
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12309
    break;
12310
  }
12311
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12312
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12313
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12314
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12315
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12316
  Value *Val5 = Builder.CreateFCmpOEQ(Val3, Val4);
12317
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12318
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12319
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12320
}
12321
case ARM::BI__builtin_arm_mve_vcmpgeq_m_f16:
12322
case ARM::BI__builtin_arm_mve_vcmpgeq_m_f32: {
12323
  llvm::Type * Param0;
12324
  switch (BuiltinID) {
12325
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_f16:
12326
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12327
    break;
12328
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_f32:
12329
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12330
    break;
12331
  }
12332
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12333
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12334
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12335
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12336
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12337
  Value *Val5 = Builder.CreateFCmpOGE(Val3, Val4);
12338
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12339
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12340
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12341
}
12342
case ARM::BI__builtin_arm_mve_vcmpgtq_m_f16:
12343
case ARM::BI__builtin_arm_mve_vcmpgtq_m_f32: {
12344
  llvm::Type * Param0;
12345
  switch (BuiltinID) {
12346
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_f16:
12347
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12348
    break;
12349
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_f32:
12350
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12351
    break;
12352
  }
12353
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12354
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12355
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12356
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12357
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12358
  Value *Val5 = Builder.CreateFCmpOGT(Val3, Val4);
12359
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12360
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12361
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12362
}
12363
case ARM::BI__builtin_arm_mve_vcmpleq_m_f16:
12364
case ARM::BI__builtin_arm_mve_vcmpleq_m_f32: {
12365
  llvm::Type * Param0;
12366
  switch (BuiltinID) {
12367
  case ARM::BI__builtin_arm_mve_vcmpleq_m_f16:
12368
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12369
    break;
12370
  case ARM::BI__builtin_arm_mve_vcmpleq_m_f32:
12371
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12372
    break;
12373
  }
12374
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12375
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12376
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12377
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12378
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12379
  Value *Val5 = Builder.CreateFCmpOLE(Val3, Val4);
12380
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12381
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12382
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12383
}
12384
case ARM::BI__builtin_arm_mve_vcmpltq_m_f16:
12385
case ARM::BI__builtin_arm_mve_vcmpltq_m_f32: {
12386
  llvm::Type * Param0;
12387
  switch (BuiltinID) {
12388
  case ARM::BI__builtin_arm_mve_vcmpltq_m_f16:
12389
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12390
    break;
12391
  case ARM::BI__builtin_arm_mve_vcmpltq_m_f32:
12392
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12393
    break;
12394
  }
12395
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12396
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12397
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12398
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12399
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12400
  Value *Val5 = Builder.CreateFCmpOLT(Val3, Val4);
12401
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12402
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12403
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12404
}
12405
case ARM::BI__builtin_arm_mve_vcmpneq_m_f16:
12406
case ARM::BI__builtin_arm_mve_vcmpneq_m_f32: {
12407
  llvm::Type * Param0;
12408
  switch (BuiltinID) {
12409
  case ARM::BI__builtin_arm_mve_vcmpneq_m_f16:
12410
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12411
    break;
12412
  case ARM::BI__builtin_arm_mve_vcmpneq_m_f32:
12413
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12414
    break;
12415
  }
12416
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12417
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12418
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12419
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12420
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12421
  Value *Val5 = Builder.CreateFCmpUNE(Val3, Val4);
12422
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12423
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12424
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12425
}
12426
case ARM::BI__builtin_arm_mve_vcmpeqq_m_s16:
12427
case ARM::BI__builtin_arm_mve_vcmpeqq_m_s32:
12428
case ARM::BI__builtin_arm_mve_vcmpeqq_m_s8:
12429
case ARM::BI__builtin_arm_mve_vcmpeqq_m_u16:
12430
case ARM::BI__builtin_arm_mve_vcmpeqq_m_u32:
12431
case ARM::BI__builtin_arm_mve_vcmpeqq_m_u8: {
12432
  llvm::Type * Param0;
12433
  switch (BuiltinID) {
12434
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_s16:
12435
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12436
    break;
12437
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_s32:
12438
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12439
    break;
12440
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_s8:
12441
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12442
    break;
12443
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_u16:
12444
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12445
    break;
12446
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_u32:
12447
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12448
    break;
12449
  case ARM::BI__builtin_arm_mve_vcmpeqq_m_u8:
12450
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12451
    break;
12452
  }
12453
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12454
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12455
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12456
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12457
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12458
  Value *Val5 = Builder.CreateICmpEQ(Val3, Val4);
12459
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12460
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12461
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12462
}
12463
case ARM::BI__builtin_arm_mve_vcmpneq_m_s16:
12464
case ARM::BI__builtin_arm_mve_vcmpneq_m_s32:
12465
case ARM::BI__builtin_arm_mve_vcmpneq_m_s8:
12466
case ARM::BI__builtin_arm_mve_vcmpneq_m_u16:
12467
case ARM::BI__builtin_arm_mve_vcmpneq_m_u32:
12468
case ARM::BI__builtin_arm_mve_vcmpneq_m_u8: {
12469
  llvm::Type * Param0;
12470
  switch (BuiltinID) {
12471
  case ARM::BI__builtin_arm_mve_vcmpneq_m_s16:
12472
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12473
    break;
12474
  case ARM::BI__builtin_arm_mve_vcmpneq_m_s32:
12475
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12476
    break;
12477
  case ARM::BI__builtin_arm_mve_vcmpneq_m_s8:
12478
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12479
    break;
12480
  case ARM::BI__builtin_arm_mve_vcmpneq_m_u16:
12481
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12482
    break;
12483
  case ARM::BI__builtin_arm_mve_vcmpneq_m_u32:
12484
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12485
    break;
12486
  case ARM::BI__builtin_arm_mve_vcmpneq_m_u8:
12487
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12488
    break;
12489
  }
12490
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12491
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12492
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12493
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12494
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12495
  Value *Val5 = Builder.CreateICmpNE(Val3, Val4);
12496
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12497
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12498
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12499
}
12500
case ARM::BI__builtin_arm_mve_vcmpgeq_m_s16:
12501
case ARM::BI__builtin_arm_mve_vcmpgeq_m_s32:
12502
case ARM::BI__builtin_arm_mve_vcmpgeq_m_s8: {
12503
  llvm::Type * Param0;
12504
  switch (BuiltinID) {
12505
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_s16:
12506
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12507
    break;
12508
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_s32:
12509
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12510
    break;
12511
  case ARM::BI__builtin_arm_mve_vcmpgeq_m_s8:
12512
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12513
    break;
12514
  }
12515
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12516
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12517
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12518
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12519
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12520
  Value *Val5 = Builder.CreateICmpSGE(Val3, Val4);
12521
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12522
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12523
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12524
}
12525
case ARM::BI__builtin_arm_mve_vcmpgtq_m_s16:
12526
case ARM::BI__builtin_arm_mve_vcmpgtq_m_s32:
12527
case ARM::BI__builtin_arm_mve_vcmpgtq_m_s8: {
12528
  llvm::Type * Param0;
12529
  switch (BuiltinID) {
12530
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_s16:
12531
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12532
    break;
12533
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_s32:
12534
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12535
    break;
12536
  case ARM::BI__builtin_arm_mve_vcmpgtq_m_s8:
12537
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12538
    break;
12539
  }
12540
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12541
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12542
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12543
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12544
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12545
  Value *Val5 = Builder.CreateICmpSGT(Val3, Val4);
12546
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12547
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12548
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12549
}
12550
case ARM::BI__builtin_arm_mve_vcmpleq_m_s16:
12551
case ARM::BI__builtin_arm_mve_vcmpleq_m_s32:
12552
case ARM::BI__builtin_arm_mve_vcmpleq_m_s8: {
12553
  llvm::Type * Param0;
12554
  switch (BuiltinID) {
12555
  case ARM::BI__builtin_arm_mve_vcmpleq_m_s16:
12556
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12557
    break;
12558
  case ARM::BI__builtin_arm_mve_vcmpleq_m_s32:
12559
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12560
    break;
12561
  case ARM::BI__builtin_arm_mve_vcmpleq_m_s8:
12562
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12563
    break;
12564
  }
12565
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12566
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12567
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12568
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12569
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12570
  Value *Val5 = Builder.CreateICmpSLE(Val3, Val4);
12571
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12572
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12573
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12574
}
12575
case ARM::BI__builtin_arm_mve_vcmpltq_m_s16:
12576
case ARM::BI__builtin_arm_mve_vcmpltq_m_s32:
12577
case ARM::BI__builtin_arm_mve_vcmpltq_m_s8: {
12578
  llvm::Type * Param0;
12579
  switch (BuiltinID) {
12580
  case ARM::BI__builtin_arm_mve_vcmpltq_m_s16:
12581
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12582
    break;
12583
  case ARM::BI__builtin_arm_mve_vcmpltq_m_s32:
12584
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12585
    break;
12586
  case ARM::BI__builtin_arm_mve_vcmpltq_m_s8:
12587
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12588
    break;
12589
  }
12590
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12591
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12592
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12593
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12594
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12595
  Value *Val5 = Builder.CreateICmpSLT(Val3, Val4);
12596
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12597
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12598
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12599
}
12600
case ARM::BI__builtin_arm_mve_vcmpcsq_m_u16:
12601
case ARM::BI__builtin_arm_mve_vcmpcsq_m_u32:
12602
case ARM::BI__builtin_arm_mve_vcmpcsq_m_u8: {
12603
  llvm::Type * Param0;
12604
  switch (BuiltinID) {
12605
  case ARM::BI__builtin_arm_mve_vcmpcsq_m_u16:
12606
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12607
    break;
12608
  case ARM::BI__builtin_arm_mve_vcmpcsq_m_u32:
12609
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12610
    break;
12611
  case ARM::BI__builtin_arm_mve_vcmpcsq_m_u8:
12612
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12613
    break;
12614
  }
12615
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12616
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12617
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12618
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12619
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12620
  Value *Val5 = Builder.CreateICmpUGE(Val3, Val4);
12621
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12622
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12623
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12624
}
12625
case ARM::BI__builtin_arm_mve_vcmphiq_m_u16:
12626
case ARM::BI__builtin_arm_mve_vcmphiq_m_u32:
12627
case ARM::BI__builtin_arm_mve_vcmphiq_m_u8: {
12628
  llvm::Type * Param0;
12629
  switch (BuiltinID) {
12630
  case ARM::BI__builtin_arm_mve_vcmphiq_m_u16:
12631
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12632
    break;
12633
  case ARM::BI__builtin_arm_mve_vcmphiq_m_u32:
12634
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12635
    break;
12636
  case ARM::BI__builtin_arm_mve_vcmphiq_m_u8:
12637
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12638
    break;
12639
  }
12640
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12641
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12642
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12643
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12644
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12645
  Value *Val5 = Builder.CreateICmpUGT(Val3, Val4);
12646
  Value *Val6 = Builder.CreateAnd(Val2, Val5);
12647
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_v2i, {Param0}), {Val6});
12648
  return Builder.CreateIntCast(Val7, Int16Ty, false);
12649
}
12650
case ARM::BI__builtin_arm_mve_vpselq_f16:
12651
case ARM::BI__builtin_arm_mve_vpselq_f32:
12652
case ARM::BI__builtin_arm_mve_vpselq_s16:
12653
case ARM::BI__builtin_arm_mve_vpselq_s32:
12654
case ARM::BI__builtin_arm_mve_vpselq_s8:
12655
case ARM::BI__builtin_arm_mve_vpselq_u16:
12656
case ARM::BI__builtin_arm_mve_vpselq_u32:
12657
case ARM::BI__builtin_arm_mve_vpselq_u8: {
12658
  llvm::Type * Param0;
12659
  switch (BuiltinID) {
12660
  case ARM::BI__builtin_arm_mve_vpselq_f16:
12661
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12662
    break;
12663
  case ARM::BI__builtin_arm_mve_vpselq_f32:
12664
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12665
    break;
12666
  case ARM::BI__builtin_arm_mve_vpselq_s16:
12667
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12668
    break;
12669
  case ARM::BI__builtin_arm_mve_vpselq_s32:
12670
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12671
    break;
12672
  case ARM::BI__builtin_arm_mve_vpselq_s8:
12673
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12674
    break;
12675
  case ARM::BI__builtin_arm_mve_vpselq_u16:
12676
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12677
    break;
12678
  case ARM::BI__builtin_arm_mve_vpselq_u32:
12679
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12680
    break;
12681
  case ARM::BI__builtin_arm_mve_vpselq_u8:
12682
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12683
    break;
12684
  }
12685
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12686
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12687
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12688
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12689
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12690
  return Builder.CreateSelect(Val2, Val3, Val4);
12691
}
12692
case ARM::BI__builtin_arm_mve_vdupq_m_n_f16:
12693
case ARM::BI__builtin_arm_mve_vdupq_m_n_f32:
12694
case ARM::BI__builtin_arm_mve_vdupq_m_n_s16:
12695
case ARM::BI__builtin_arm_mve_vdupq_m_n_s32:
12696
case ARM::BI__builtin_arm_mve_vdupq_m_n_s8:
12697
case ARM::BI__builtin_arm_mve_vdupq_m_n_u16:
12698
case ARM::BI__builtin_arm_mve_vdupq_m_n_u32:
12699
case ARM::BI__builtin_arm_mve_vdupq_m_n_u8: {
12700
  llvm::Type * Param0;
12701
  switch (BuiltinID) {
12702
  case ARM::BI__builtin_arm_mve_vdupq_m_n_f16:
12703
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12704
    break;
12705
  case ARM::BI__builtin_arm_mve_vdupq_m_n_f32:
12706
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12707
    break;
12708
  case ARM::BI__builtin_arm_mve_vdupq_m_n_s16:
12709
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12710
    break;
12711
  case ARM::BI__builtin_arm_mve_vdupq_m_n_s32:
12712
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12713
    break;
12714
  case ARM::BI__builtin_arm_mve_vdupq_m_n_s8:
12715
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12716
    break;
12717
  case ARM::BI__builtin_arm_mve_vdupq_m_n_u16:
12718
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12719
    break;
12720
  case ARM::BI__builtin_arm_mve_vdupq_m_n_u32:
12721
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12722
    break;
12723
  case ARM::BI__builtin_arm_mve_vdupq_m_n_u8:
12724
    Param0 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
12725
    break;
12726
  }
12727
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12728
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12729
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param0}), {Val1});
12730
  Value *Val3 = EmitScalarExpr(E->getArg(1));
12731
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
12732
  Value *Val5 = EmitScalarExpr(E->getArg(0));
12733
  return Builder.CreateSelect(Val2, Val4, Val5);
12734
}
12735
case ARM::BI__builtin_arm_mve_vbicq_m_n_s32:
12736
case ARM::BI__builtin_arm_mve_vbicq_m_n_u32: {
12737
  bool  Param0;
12738
  switch (BuiltinID) {
12739
  case ARM::BI__builtin_arm_mve_vbicq_m_n_s32:
12740
    Param0 = true;
12741
    break;
12742
  case ARM::BI__builtin_arm_mve_vbicq_m_n_u32:
12743
    Param0 = false;
12744
    break;
12745
  }
12746
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12747
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12748
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1});
12749
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12750
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12751
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, Param0);
12752
  Value *Val6 = ARMMVEVectorSplat(Builder, Val5);
12753
  Value *Val7 = Builder.CreateNot(Val6);
12754
  Value *Val8 = Builder.CreateAnd(Val3, Val7);
12755
  return Builder.CreateSelect(Val2, Val8, Val3);
12756
}
12757
case ARM::BI__builtin_arm_mve_vorrq_m_n_s32:
12758
case ARM::BI__builtin_arm_mve_vorrq_m_n_u32: {
12759
  bool  Param0;
12760
  switch (BuiltinID) {
12761
  case ARM::BI__builtin_arm_mve_vorrq_m_n_s32:
12762
    Param0 = true;
12763
    break;
12764
  case ARM::BI__builtin_arm_mve_vorrq_m_n_u32:
12765
    Param0 = false;
12766
    break;
12767
  }
12768
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12769
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12770
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1});
12771
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12772
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12773
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, Param0);
12774
  Value *Val6 = ARMMVEVectorSplat(Builder, Val5);
12775
  Value *Val7 = Builder.CreateOr(Val3, Val6);
12776
  return Builder.CreateSelect(Val2, Val7, Val3);
12777
}
12778
case ARM::BI__builtin_arm_mve_vpselq_s64:
12779
case ARM::BI__builtin_arm_mve_vpselq_u64: {
12780
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12781
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12782
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1});
12783
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12784
  llvm::Type *Val4 = llvm::FixedVectorType::get(Int32Ty, 4);
12785
  Value *Val5 = Builder.CreateBitCast(Val3, Val4);
12786
  Value *Val6 = EmitScalarExpr(E->getArg(1));
12787
  llvm::Type *Val7 = llvm::FixedVectorType::get(Int32Ty, 4);
12788
  Value *Val8 = Builder.CreateBitCast(Val6, Val7);
12789
  Value *Val9 = Builder.CreateSelect(Val2, Val5, Val8);
12790
  llvm::Type *Val10 = llvm::FixedVectorType::get(Int64Ty, 2);
12791
  return Builder.CreateBitCast(Val9, Val10);
12792
}
12793
case ARM::BI__builtin_arm_mve_vmvnq_m_n_s32:
12794
case ARM::BI__builtin_arm_mve_vmvnq_m_n_u32: {
12795
  bool  Param0;
12796
  switch (BuiltinID) {
12797
  case ARM::BI__builtin_arm_mve_vmvnq_m_n_s32:
12798
    Param0 = true;
12799
    break;
12800
  case ARM::BI__builtin_arm_mve_vmvnq_m_n_u32:
12801
    Param0 = false;
12802
    break;
12803
  }
12804
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12805
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12806
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1});
12807
  Value *Val3 = EmitScalarExpr(E->getArg(1));
12808
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, Param0);
12809
  Value *Val5 = ARMMVEVectorSplat(Builder, Val4);
12810
  Value *Val6 = Builder.CreateNot(Val5);
12811
  Value *Val7 = EmitScalarExpr(E->getArg(0));
12812
  return Builder.CreateSelect(Val2, Val6, Val7);
12813
}
12814
case ARM::BI__builtin_arm_mve_vbicq_m_n_s16:
12815
case ARM::BI__builtin_arm_mve_vbicq_m_n_u16: {
12816
  bool  Param0;
12817
  switch (BuiltinID) {
12818
  case ARM::BI__builtin_arm_mve_vbicq_m_n_s16:
12819
    Param0 = true;
12820
    break;
12821
  case ARM::BI__builtin_arm_mve_vbicq_m_n_u16:
12822
    Param0 = false;
12823
    break;
12824
  }
12825
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12826
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12827
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1});
12828
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12829
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12830
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
12831
  Value *Val6 = Builder.CreateIntCast(Val5, Int16Ty, Param0);
12832
  Value *Val7 = ARMMVEVectorSplat(Builder, Val6);
12833
  Value *Val8 = Builder.CreateNot(Val7);
12834
  Value *Val9 = Builder.CreateAnd(Val3, Val8);
12835
  return Builder.CreateSelect(Val2, Val9, Val3);
12836
}
12837
case ARM::BI__builtin_arm_mve_vorrq_m_n_s16:
12838
case ARM::BI__builtin_arm_mve_vorrq_m_n_u16: {
12839
  bool  Param0;
12840
  switch (BuiltinID) {
12841
  case ARM::BI__builtin_arm_mve_vorrq_m_n_s16:
12842
    Param0 = true;
12843
    break;
12844
  case ARM::BI__builtin_arm_mve_vorrq_m_n_u16:
12845
    Param0 = false;
12846
    break;
12847
  }
12848
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12849
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12850
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1});
12851
  Value *Val3 = EmitScalarExpr(E->getArg(0));
12852
  Value *Val4 = EmitScalarExpr(E->getArg(1));
12853
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
12854
  Value *Val6 = Builder.CreateIntCast(Val5, Int16Ty, Param0);
12855
  Value *Val7 = ARMMVEVectorSplat(Builder, Val6);
12856
  Value *Val8 = Builder.CreateOr(Val3, Val7);
12857
  return Builder.CreateSelect(Val2, Val8, Val3);
12858
}
12859
case ARM::BI__builtin_arm_mve_vmvnq_m_n_s16:
12860
case ARM::BI__builtin_arm_mve_vmvnq_m_n_u16: {
12861
  bool  Param0;
12862
  switch (BuiltinID) {
12863
  case ARM::BI__builtin_arm_mve_vmvnq_m_n_s16:
12864
    Param0 = true;
12865
    break;
12866
  case ARM::BI__builtin_arm_mve_vmvnq_m_n_u16:
12867
    Param0 = false;
12868
    break;
12869
  }
12870
  Value *Val0 = EmitScalarExpr(E->getArg(2));
12871
  Value *Val1 = Builder.CreateIntCast(Val0, Int32Ty, false);
12872
  Value *Val2 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1});
12873
  Value *Val3 = EmitScalarExpr(E->getArg(1));
12874
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
12875
  Value *Val5 = Builder.CreateIntCast(Val4, Int16Ty, Param0);
12876
  Value *Val6 = ARMMVEVectorSplat(Builder, Val5);
12877
  Value *Val7 = Builder.CreateNot(Val6);
12878
  Value *Val8 = EmitScalarExpr(E->getArg(0));
12879
  return Builder.CreateSelect(Val2, Val7, Val8);
12880
}
12881
case ARM::BI__builtin_arm_mve_vcvtaq_m_s16_f16:
12882
case ARM::BI__builtin_arm_mve_vcvtaq_m_s32_f32:
12883
case ARM::BI__builtin_arm_mve_vcvtaq_m_u16_f16:
12884
case ARM::BI__builtin_arm_mve_vcvtaq_m_u32_f32:
12885
case ARM::BI__builtin_arm_mve_vcvtmq_m_s16_f16:
12886
case ARM::BI__builtin_arm_mve_vcvtmq_m_s32_f32:
12887
case ARM::BI__builtin_arm_mve_vcvtmq_m_u16_f16:
12888
case ARM::BI__builtin_arm_mve_vcvtmq_m_u32_f32:
12889
case ARM::BI__builtin_arm_mve_vcvtnq_m_s16_f16:
12890
case ARM::BI__builtin_arm_mve_vcvtnq_m_s32_f32:
12891
case ARM::BI__builtin_arm_mve_vcvtnq_m_u16_f16:
12892
case ARM::BI__builtin_arm_mve_vcvtnq_m_u32_f32:
12893
case ARM::BI__builtin_arm_mve_vcvtpq_m_s16_f16:
12894
case ARM::BI__builtin_arm_mve_vcvtpq_m_s32_f32:
12895
case ARM::BI__builtin_arm_mve_vcvtpq_m_u16_f16:
12896
case ARM::BI__builtin_arm_mve_vcvtpq_m_u32_f32: {
12897
  uint32_t  Param0;
12898
  llvm::Type * Param1;
12899
  Intrinsic::ID  Param2;
12900
  llvm::Type * Param3;
12901
  llvm::Type * Param4;
12902
  switch (BuiltinID) {
12903
  case ARM::BI__builtin_arm_mve_vcvtaq_m_s16_f16:
12904
    Param0 = 0;
12905
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12906
    Param2 = Intrinsic::arm_mve_vcvta_predicated;
12907
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
12908
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
12909
    break;
12910
  case ARM::BI__builtin_arm_mve_vcvtaq_m_s32_f32:
12911
    Param0 = 0;
12912
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12913
    Param2 = Intrinsic::arm_mve_vcvta_predicated;
12914
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
12915
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
12916
    break;
12917
  case ARM::BI__builtin_arm_mve_vcvtaq_m_u16_f16:
12918
    Param0 = 1;
12919
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12920
    Param2 = Intrinsic::arm_mve_vcvta_predicated;
12921
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
12922
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
12923
    break;
12924
  case ARM::BI__builtin_arm_mve_vcvtaq_m_u32_f32:
12925
    Param0 = 1;
12926
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12927
    Param2 = Intrinsic::arm_mve_vcvta_predicated;
12928
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
12929
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
12930
    break;
12931
  case ARM::BI__builtin_arm_mve_vcvtmq_m_s16_f16:
12932
    Param0 = 0;
12933
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12934
    Param2 = Intrinsic::arm_mve_vcvtm_predicated;
12935
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
12936
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
12937
    break;
12938
  case ARM::BI__builtin_arm_mve_vcvtmq_m_s32_f32:
12939
    Param0 = 0;
12940
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12941
    Param2 = Intrinsic::arm_mve_vcvtm_predicated;
12942
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
12943
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
12944
    break;
12945
  case ARM::BI__builtin_arm_mve_vcvtmq_m_u16_f16:
12946
    Param0 = 1;
12947
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12948
    Param2 = Intrinsic::arm_mve_vcvtm_predicated;
12949
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
12950
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
12951
    break;
12952
  case ARM::BI__builtin_arm_mve_vcvtmq_m_u32_f32:
12953
    Param0 = 1;
12954
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12955
    Param2 = Intrinsic::arm_mve_vcvtm_predicated;
12956
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
12957
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
12958
    break;
12959
  case ARM::BI__builtin_arm_mve_vcvtnq_m_s16_f16:
12960
    Param0 = 0;
12961
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12962
    Param2 = Intrinsic::arm_mve_vcvtn_predicated;
12963
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
12964
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
12965
    break;
12966
  case ARM::BI__builtin_arm_mve_vcvtnq_m_s32_f32:
12967
    Param0 = 0;
12968
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12969
    Param2 = Intrinsic::arm_mve_vcvtn_predicated;
12970
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
12971
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
12972
    break;
12973
  case ARM::BI__builtin_arm_mve_vcvtnq_m_u16_f16:
12974
    Param0 = 1;
12975
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12976
    Param2 = Intrinsic::arm_mve_vcvtn_predicated;
12977
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
12978
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
12979
    break;
12980
  case ARM::BI__builtin_arm_mve_vcvtnq_m_u32_f32:
12981
    Param0 = 1;
12982
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12983
    Param2 = Intrinsic::arm_mve_vcvtn_predicated;
12984
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
12985
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
12986
    break;
12987
  case ARM::BI__builtin_arm_mve_vcvtpq_m_s16_f16:
12988
    Param0 = 0;
12989
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
12990
    Param2 = Intrinsic::arm_mve_vcvtp_predicated;
12991
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
12992
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
12993
    break;
12994
  case ARM::BI__builtin_arm_mve_vcvtpq_m_s32_f32:
12995
    Param0 = 0;
12996
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
12997
    Param2 = Intrinsic::arm_mve_vcvtp_predicated;
12998
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
12999
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
13000
    break;
13001
  case ARM::BI__builtin_arm_mve_vcvtpq_m_u16_f16:
13002
    Param0 = 1;
13003
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13004
    Param2 = Intrinsic::arm_mve_vcvtp_predicated;
13005
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13006
    Param4 = llvm::FixedVectorType::get(HalfTy, 8);
13007
    break;
13008
  case ARM::BI__builtin_arm_mve_vcvtpq_m_u32_f32:
13009
    Param0 = 1;
13010
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13011
    Param2 = Intrinsic::arm_mve_vcvtp_predicated;
13012
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13013
    Param4 = llvm::FixedVectorType::get(FloatTy, 4);
13014
    break;
13015
  }
13016
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13017
  Value *Val1 = EmitScalarExpr(E->getArg(0));
13018
  Value *Val2 = EmitScalarExpr(E->getArg(1));
13019
  Value *Val3 = EmitScalarExpr(E->getArg(2));
13020
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
13021
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val4});
13022
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param4, Param1}), {Val0, Val1, Val2, Val5});
13023
}
13024
case ARM::BI__builtin_arm_mve_vcvtq_m_n_f16_s16:
13025
case ARM::BI__builtin_arm_mve_vcvtq_m_n_f16_u16:
13026
case ARM::BI__builtin_arm_mve_vcvtq_m_n_f32_s32:
13027
case ARM::BI__builtin_arm_mve_vcvtq_m_n_f32_u32:
13028
case ARM::BI__builtin_arm_mve_vcvtq_m_n_s16_f16:
13029
case ARM::BI__builtin_arm_mve_vcvtq_m_n_s32_f32:
13030
case ARM::BI__builtin_arm_mve_vcvtq_m_n_u16_f16:
13031
case ARM::BI__builtin_arm_mve_vcvtq_m_n_u32_f32: {
13032
  uint32_t  Param0;
13033
  llvm::Type * Param1;
13034
  llvm::Type * Param2;
13035
  llvm::Type * Param3;
13036
  switch (BuiltinID) {
13037
  case ARM::BI__builtin_arm_mve_vcvtq_m_n_f16_s16:
13038
    Param0 = 0;
13039
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13040
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13041
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13042
    break;
13043
  case ARM::BI__builtin_arm_mve_vcvtq_m_n_f16_u16:
13044
    Param0 = 1;
13045
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13046
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13047
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13048
    break;
13049
  case ARM::BI__builtin_arm_mve_vcvtq_m_n_f32_s32:
13050
    Param0 = 0;
13051
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13052
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13053
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13054
    break;
13055
  case ARM::BI__builtin_arm_mve_vcvtq_m_n_f32_u32:
13056
    Param0 = 1;
13057
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13058
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13059
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13060
    break;
13061
  case ARM::BI__builtin_arm_mve_vcvtq_m_n_s16_f16:
13062
    Param0 = 0;
13063
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13064
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13065
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13066
    break;
13067
  case ARM::BI__builtin_arm_mve_vcvtq_m_n_s32_f32:
13068
    Param0 = 0;
13069
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13070
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13071
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13072
    break;
13073
  case ARM::BI__builtin_arm_mve_vcvtq_m_n_u16_f16:
13074
    Param0 = 1;
13075
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13076
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13077
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13078
    break;
13079
  case ARM::BI__builtin_arm_mve_vcvtq_m_n_u32_f32:
13080
    Param0 = 1;
13081
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13082
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13083
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13084
    break;
13085
  }
13086
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13087
  Value *Val1 = EmitScalarExpr(E->getArg(0));
13088
  Value *Val2 = EmitScalarExpr(E->getArg(1));
13089
  Value *Val3 = EmitScalarExpr(E->getArg(2));
13090
  Value *Val4 = EmitScalarExpr(E->getArg(3));
13091
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
13092
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val5});
13093
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fix_predicated, {Param2, Param3, Param1}), {Val0, Val1, Val2, Val3, Val6});
13094
}
13095
case ARM::BI__builtin_arm_mve_vabavq_p_s16:
13096
case ARM::BI__builtin_arm_mve_vabavq_p_s32:
13097
case ARM::BI__builtin_arm_mve_vabavq_p_s8:
13098
case ARM::BI__builtin_arm_mve_vabavq_p_u16:
13099
case ARM::BI__builtin_arm_mve_vabavq_p_u32:
13100
case ARM::BI__builtin_arm_mve_vabavq_p_u8:
13101
case ARM::BI__builtin_arm_mve_vcmlaq_m_f16:
13102
case ARM::BI__builtin_arm_mve_vcmlaq_m_f32:
13103
case ARM::BI__builtin_arm_mve_vcmlaq_rot180_m_f16:
13104
case ARM::BI__builtin_arm_mve_vcmlaq_rot180_m_f32:
13105
case ARM::BI__builtin_arm_mve_vcmlaq_rot270_m_f16:
13106
case ARM::BI__builtin_arm_mve_vcmlaq_rot270_m_f32:
13107
case ARM::BI__builtin_arm_mve_vcmlaq_rot90_m_f16:
13108
case ARM::BI__builtin_arm_mve_vcmlaq_rot90_m_f32:
13109
case ARM::BI__builtin_arm_mve_vcmulq_m_f16:
13110
case ARM::BI__builtin_arm_mve_vcmulq_m_f32:
13111
case ARM::BI__builtin_arm_mve_vcmulq_rot180_m_f16:
13112
case ARM::BI__builtin_arm_mve_vcmulq_rot180_m_f32:
13113
case ARM::BI__builtin_arm_mve_vcmulq_rot270_m_f16:
13114
case ARM::BI__builtin_arm_mve_vcmulq_rot270_m_f32:
13115
case ARM::BI__builtin_arm_mve_vcmulq_rot90_m_f16:
13116
case ARM::BI__builtin_arm_mve_vcmulq_rot90_m_f32: {
13117
  uint32_t  Param0;
13118
  llvm::Type * Param1;
13119
  Intrinsic::ID  Param2;
13120
  llvm::Type * Param3;
13121
  switch (BuiltinID) {
13122
  case ARM::BI__builtin_arm_mve_vabavq_p_s16:
13123
    Param0 = 0;
13124
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13125
    Param2 = Intrinsic::arm_mve_vabav_predicated;
13126
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13127
    break;
13128
  case ARM::BI__builtin_arm_mve_vabavq_p_s32:
13129
    Param0 = 0;
13130
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13131
    Param2 = Intrinsic::arm_mve_vabav_predicated;
13132
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13133
    break;
13134
  case ARM::BI__builtin_arm_mve_vabavq_p_s8:
13135
    Param0 = 0;
13136
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13137
    Param2 = Intrinsic::arm_mve_vabav_predicated;
13138
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
13139
    break;
13140
  case ARM::BI__builtin_arm_mve_vabavq_p_u16:
13141
    Param0 = 1;
13142
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13143
    Param2 = Intrinsic::arm_mve_vabav_predicated;
13144
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13145
    break;
13146
  case ARM::BI__builtin_arm_mve_vabavq_p_u32:
13147
    Param0 = 1;
13148
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13149
    Param2 = Intrinsic::arm_mve_vabav_predicated;
13150
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13151
    break;
13152
  case ARM::BI__builtin_arm_mve_vabavq_p_u8:
13153
    Param0 = 1;
13154
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13155
    Param2 = Intrinsic::arm_mve_vabav_predicated;
13156
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
13157
    break;
13158
  case ARM::BI__builtin_arm_mve_vcmlaq_m_f16:
13159
    Param0 = 0;
13160
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13161
    Param2 = Intrinsic::arm_mve_vcmlaq_predicated;
13162
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13163
    break;
13164
  case ARM::BI__builtin_arm_mve_vcmlaq_m_f32:
13165
    Param0 = 0;
13166
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13167
    Param2 = Intrinsic::arm_mve_vcmlaq_predicated;
13168
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13169
    break;
13170
  case ARM::BI__builtin_arm_mve_vcmlaq_rot180_m_f16:
13171
    Param0 = 2;
13172
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13173
    Param2 = Intrinsic::arm_mve_vcmlaq_predicated;
13174
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13175
    break;
13176
  case ARM::BI__builtin_arm_mve_vcmlaq_rot180_m_f32:
13177
    Param0 = 2;
13178
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13179
    Param2 = Intrinsic::arm_mve_vcmlaq_predicated;
13180
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13181
    break;
13182
  case ARM::BI__builtin_arm_mve_vcmlaq_rot270_m_f16:
13183
    Param0 = 3;
13184
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13185
    Param2 = Intrinsic::arm_mve_vcmlaq_predicated;
13186
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13187
    break;
13188
  case ARM::BI__builtin_arm_mve_vcmlaq_rot270_m_f32:
13189
    Param0 = 3;
13190
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13191
    Param2 = Intrinsic::arm_mve_vcmlaq_predicated;
13192
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13193
    break;
13194
  case ARM::BI__builtin_arm_mve_vcmlaq_rot90_m_f16:
13195
    Param0 = 1;
13196
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13197
    Param2 = Intrinsic::arm_mve_vcmlaq_predicated;
13198
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13199
    break;
13200
  case ARM::BI__builtin_arm_mve_vcmlaq_rot90_m_f32:
13201
    Param0 = 1;
13202
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13203
    Param2 = Intrinsic::arm_mve_vcmlaq_predicated;
13204
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13205
    break;
13206
  case ARM::BI__builtin_arm_mve_vcmulq_m_f16:
13207
    Param0 = 0;
13208
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13209
    Param2 = Intrinsic::arm_mve_vcmulq_predicated;
13210
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13211
    break;
13212
  case ARM::BI__builtin_arm_mve_vcmulq_m_f32:
13213
    Param0 = 0;
13214
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13215
    Param2 = Intrinsic::arm_mve_vcmulq_predicated;
13216
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13217
    break;
13218
  case ARM::BI__builtin_arm_mve_vcmulq_rot180_m_f16:
13219
    Param0 = 2;
13220
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13221
    Param2 = Intrinsic::arm_mve_vcmulq_predicated;
13222
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13223
    break;
13224
  case ARM::BI__builtin_arm_mve_vcmulq_rot180_m_f32:
13225
    Param0 = 2;
13226
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13227
    Param2 = Intrinsic::arm_mve_vcmulq_predicated;
13228
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13229
    break;
13230
  case ARM::BI__builtin_arm_mve_vcmulq_rot270_m_f16:
13231
    Param0 = 3;
13232
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13233
    Param2 = Intrinsic::arm_mve_vcmulq_predicated;
13234
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13235
    break;
13236
  case ARM::BI__builtin_arm_mve_vcmulq_rot270_m_f32:
13237
    Param0 = 3;
13238
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13239
    Param2 = Intrinsic::arm_mve_vcmulq_predicated;
13240
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13241
    break;
13242
  case ARM::BI__builtin_arm_mve_vcmulq_rot90_m_f16:
13243
    Param0 = 1;
13244
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13245
    Param2 = Intrinsic::arm_mve_vcmulq_predicated;
13246
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13247
    break;
13248
  case ARM::BI__builtin_arm_mve_vcmulq_rot90_m_f32:
13249
    Param0 = 1;
13250
    Param1 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13251
    Param2 = Intrinsic::arm_mve_vcmulq_predicated;
13252
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13253
    break;
13254
  }
13255
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13256
  Value *Val1 = EmitScalarExpr(E->getArg(0));
13257
  Value *Val2 = EmitScalarExpr(E->getArg(1));
13258
  Value *Val3 = EmitScalarExpr(E->getArg(2));
13259
  Value *Val4 = EmitScalarExpr(E->getArg(3));
13260
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
13261
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param1}), {Val5});
13262
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {Param3, Param1}), {Val0, Val1, Val2, Val3, Val6});
13263
}
13264
case ARM::BI__builtin_arm_mve_vabavq_s16:
13265
case ARM::BI__builtin_arm_mve_vabavq_s32:
13266
case ARM::BI__builtin_arm_mve_vabavq_s8:
13267
case ARM::BI__builtin_arm_mve_vabavq_u16:
13268
case ARM::BI__builtin_arm_mve_vabavq_u32:
13269
case ARM::BI__builtin_arm_mve_vabavq_u8:
13270
case ARM::BI__builtin_arm_mve_vcmlaq_f16:
13271
case ARM::BI__builtin_arm_mve_vcmlaq_f32:
13272
case ARM::BI__builtin_arm_mve_vcmlaq_rot180_f16:
13273
case ARM::BI__builtin_arm_mve_vcmlaq_rot180_f32:
13274
case ARM::BI__builtin_arm_mve_vcmlaq_rot270_f16:
13275
case ARM::BI__builtin_arm_mve_vcmlaq_rot270_f32:
13276
case ARM::BI__builtin_arm_mve_vcmlaq_rot90_f16:
13277
case ARM::BI__builtin_arm_mve_vcmlaq_rot90_f32: {
13278
  uint32_t  Param0;
13279
  Intrinsic::ID  Param1;
13280
  llvm::Type * Param2;
13281
  switch (BuiltinID) {
13282
  case ARM::BI__builtin_arm_mve_vabavq_s16:
13283
    Param0 = 0;
13284
    Param1 = Intrinsic::arm_mve_vabav;
13285
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13286
    break;
13287
  case ARM::BI__builtin_arm_mve_vabavq_s32:
13288
    Param0 = 0;
13289
    Param1 = Intrinsic::arm_mve_vabav;
13290
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13291
    break;
13292
  case ARM::BI__builtin_arm_mve_vabavq_s8:
13293
    Param0 = 0;
13294
    Param1 = Intrinsic::arm_mve_vabav;
13295
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
13296
    break;
13297
  case ARM::BI__builtin_arm_mve_vabavq_u16:
13298
    Param0 = 1;
13299
    Param1 = Intrinsic::arm_mve_vabav;
13300
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13301
    break;
13302
  case ARM::BI__builtin_arm_mve_vabavq_u32:
13303
    Param0 = 1;
13304
    Param1 = Intrinsic::arm_mve_vabav;
13305
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13306
    break;
13307
  case ARM::BI__builtin_arm_mve_vabavq_u8:
13308
    Param0 = 1;
13309
    Param1 = Intrinsic::arm_mve_vabav;
13310
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
13311
    break;
13312
  case ARM::BI__builtin_arm_mve_vcmlaq_f16:
13313
    Param0 = 0;
13314
    Param1 = Intrinsic::arm_mve_vcmlaq;
13315
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13316
    break;
13317
  case ARM::BI__builtin_arm_mve_vcmlaq_f32:
13318
    Param0 = 0;
13319
    Param1 = Intrinsic::arm_mve_vcmlaq;
13320
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13321
    break;
13322
  case ARM::BI__builtin_arm_mve_vcmlaq_rot180_f16:
13323
    Param0 = 2;
13324
    Param1 = Intrinsic::arm_mve_vcmlaq;
13325
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13326
    break;
13327
  case ARM::BI__builtin_arm_mve_vcmlaq_rot180_f32:
13328
    Param0 = 2;
13329
    Param1 = Intrinsic::arm_mve_vcmlaq;
13330
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13331
    break;
13332
  case ARM::BI__builtin_arm_mve_vcmlaq_rot270_f16:
13333
    Param0 = 3;
13334
    Param1 = Intrinsic::arm_mve_vcmlaq;
13335
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13336
    break;
13337
  case ARM::BI__builtin_arm_mve_vcmlaq_rot270_f32:
13338
    Param0 = 3;
13339
    Param1 = Intrinsic::arm_mve_vcmlaq;
13340
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13341
    break;
13342
  case ARM::BI__builtin_arm_mve_vcmlaq_rot90_f16:
13343
    Param0 = 1;
13344
    Param1 = Intrinsic::arm_mve_vcmlaq;
13345
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13346
    break;
13347
  case ARM::BI__builtin_arm_mve_vcmlaq_rot90_f32:
13348
    Param0 = 1;
13349
    Param1 = Intrinsic::arm_mve_vcmlaq;
13350
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13351
    break;
13352
  }
13353
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13354
  Value *Val1 = EmitScalarExpr(E->getArg(0));
13355
  Value *Val2 = EmitScalarExpr(E->getArg(1));
13356
  Value *Val3 = EmitScalarExpr(E->getArg(2));
13357
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2}), {Val0, Val1, Val2, Val3});
13358
}
13359
case ARM::BI__builtin_arm_mve_vcmulq_f16:
13360
case ARM::BI__builtin_arm_mve_vcmulq_f32:
13361
case ARM::BI__builtin_arm_mve_vcmulq_rot180_f16:
13362
case ARM::BI__builtin_arm_mve_vcmulq_rot180_f32:
13363
case ARM::BI__builtin_arm_mve_vcmulq_rot270_f16:
13364
case ARM::BI__builtin_arm_mve_vcmulq_rot270_f32:
13365
case ARM::BI__builtin_arm_mve_vcmulq_rot90_f16:
13366
case ARM::BI__builtin_arm_mve_vcmulq_rot90_f32: {
13367
  uint32_t  Param0;
13368
  llvm::Type * Param1;
13369
  switch (BuiltinID) {
13370
  case ARM::BI__builtin_arm_mve_vcmulq_f16:
13371
    Param0 = 0;
13372
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
13373
    break;
13374
  case ARM::BI__builtin_arm_mve_vcmulq_f32:
13375
    Param0 = 0;
13376
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
13377
    break;
13378
  case ARM::BI__builtin_arm_mve_vcmulq_rot180_f16:
13379
    Param0 = 2;
13380
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
13381
    break;
13382
  case ARM::BI__builtin_arm_mve_vcmulq_rot180_f32:
13383
    Param0 = 2;
13384
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
13385
    break;
13386
  case ARM::BI__builtin_arm_mve_vcmulq_rot270_f16:
13387
    Param0 = 3;
13388
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
13389
    break;
13390
  case ARM::BI__builtin_arm_mve_vcmulq_rot270_f32:
13391
    Param0 = 3;
13392
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
13393
    break;
13394
  case ARM::BI__builtin_arm_mve_vcmulq_rot90_f16:
13395
    Param0 = 1;
13396
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
13397
    break;
13398
  case ARM::BI__builtin_arm_mve_vcmulq_rot90_f32:
13399
    Param0 = 1;
13400
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
13401
    break;
13402
  }
13403
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13404
  Value *Val1 = EmitScalarExpr(E->getArg(0));
13405
  Value *Val2 = EmitScalarExpr(E->getArg(1));
13406
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcmulq, {Param1}), {Val0, Val1, Val2});
13407
}
13408
case ARM::BI__builtin_arm_mve_vcvtq_n_f16_s16:
13409
case ARM::BI__builtin_arm_mve_vcvtq_n_f16_u16:
13410
case ARM::BI__builtin_arm_mve_vcvtq_n_f32_s32:
13411
case ARM::BI__builtin_arm_mve_vcvtq_n_f32_u32:
13412
case ARM::BI__builtin_arm_mve_vcvtq_n_s16_f16:
13413
case ARM::BI__builtin_arm_mve_vcvtq_n_s32_f32:
13414
case ARM::BI__builtin_arm_mve_vcvtq_n_u16_f16:
13415
case ARM::BI__builtin_arm_mve_vcvtq_n_u32_f32: {
13416
  uint32_t  Param0;
13417
  llvm::Type * Param1;
13418
  llvm::Type * Param2;
13419
  switch (BuiltinID) {
13420
  case ARM::BI__builtin_arm_mve_vcvtq_n_f16_s16:
13421
    Param0 = 0;
13422
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
13423
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13424
    break;
13425
  case ARM::BI__builtin_arm_mve_vcvtq_n_f16_u16:
13426
    Param0 = 1;
13427
    Param1 = llvm::FixedVectorType::get(HalfTy, 8);
13428
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13429
    break;
13430
  case ARM::BI__builtin_arm_mve_vcvtq_n_f32_s32:
13431
    Param0 = 0;
13432
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
13433
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13434
    break;
13435
  case ARM::BI__builtin_arm_mve_vcvtq_n_f32_u32:
13436
    Param0 = 1;
13437
    Param1 = llvm::FixedVectorType::get(FloatTy, 4);
13438
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13439
    break;
13440
  case ARM::BI__builtin_arm_mve_vcvtq_n_s16_f16:
13441
    Param0 = 0;
13442
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
13443
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13444
    break;
13445
  case ARM::BI__builtin_arm_mve_vcvtq_n_s32_f32:
13446
    Param0 = 0;
13447
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
13448
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13449
    break;
13450
  case ARM::BI__builtin_arm_mve_vcvtq_n_u16_f16:
13451
    Param0 = 1;
13452
    Param1 = llvm::FixedVectorType::get(Int16Ty, 8);
13453
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13454
    break;
13455
  case ARM::BI__builtin_arm_mve_vcvtq_n_u32_f32:
13456
    Param0 = 1;
13457
    Param1 = llvm::FixedVectorType::get(Int32Ty, 4);
13458
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13459
    break;
13460
  }
13461
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13462
  Value *Val1 = EmitScalarExpr(E->getArg(0));
13463
  Value *Val2 = EmitScalarExpr(E->getArg(1));
13464
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fix, {Param1, Param2}), {Val0, Val1, Val2});
13465
}
13466
case ARM::BI__builtin_arm_mve_vcvtaq_s16_f16:
13467
case ARM::BI__builtin_arm_mve_vcvtaq_s32_f32:
13468
case ARM::BI__builtin_arm_mve_vcvtaq_u16_f16:
13469
case ARM::BI__builtin_arm_mve_vcvtaq_u32_f32:
13470
case ARM::BI__builtin_arm_mve_vcvtmq_s16_f16:
13471
case ARM::BI__builtin_arm_mve_vcvtmq_s32_f32:
13472
case ARM::BI__builtin_arm_mve_vcvtmq_u16_f16:
13473
case ARM::BI__builtin_arm_mve_vcvtmq_u32_f32:
13474
case ARM::BI__builtin_arm_mve_vcvtnq_s16_f16:
13475
case ARM::BI__builtin_arm_mve_vcvtnq_s32_f32:
13476
case ARM::BI__builtin_arm_mve_vcvtnq_u16_f16:
13477
case ARM::BI__builtin_arm_mve_vcvtnq_u32_f32:
13478
case ARM::BI__builtin_arm_mve_vcvtpq_s16_f16:
13479
case ARM::BI__builtin_arm_mve_vcvtpq_s32_f32:
13480
case ARM::BI__builtin_arm_mve_vcvtpq_u16_f16:
13481
case ARM::BI__builtin_arm_mve_vcvtpq_u32_f32: {
13482
  uint32_t  Param0;
13483
  Intrinsic::ID  Param1;
13484
  llvm::Type * Param2;
13485
  llvm::Type * Param3;
13486
  switch (BuiltinID) {
13487
  case ARM::BI__builtin_arm_mve_vcvtaq_s16_f16:
13488
    Param0 = 0;
13489
    Param1 = Intrinsic::arm_mve_vcvta;
13490
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13491
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13492
    break;
13493
  case ARM::BI__builtin_arm_mve_vcvtaq_s32_f32:
13494
    Param0 = 0;
13495
    Param1 = Intrinsic::arm_mve_vcvta;
13496
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13497
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13498
    break;
13499
  case ARM::BI__builtin_arm_mve_vcvtaq_u16_f16:
13500
    Param0 = 1;
13501
    Param1 = Intrinsic::arm_mve_vcvta;
13502
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13503
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13504
    break;
13505
  case ARM::BI__builtin_arm_mve_vcvtaq_u32_f32:
13506
    Param0 = 1;
13507
    Param1 = Intrinsic::arm_mve_vcvta;
13508
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13509
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13510
    break;
13511
  case ARM::BI__builtin_arm_mve_vcvtmq_s16_f16:
13512
    Param0 = 0;
13513
    Param1 = Intrinsic::arm_mve_vcvtm;
13514
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13515
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13516
    break;
13517
  case ARM::BI__builtin_arm_mve_vcvtmq_s32_f32:
13518
    Param0 = 0;
13519
    Param1 = Intrinsic::arm_mve_vcvtm;
13520
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13521
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13522
    break;
13523
  case ARM::BI__builtin_arm_mve_vcvtmq_u16_f16:
13524
    Param0 = 1;
13525
    Param1 = Intrinsic::arm_mve_vcvtm;
13526
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13527
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13528
    break;
13529
  case ARM::BI__builtin_arm_mve_vcvtmq_u32_f32:
13530
    Param0 = 1;
13531
    Param1 = Intrinsic::arm_mve_vcvtm;
13532
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13533
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13534
    break;
13535
  case ARM::BI__builtin_arm_mve_vcvtnq_s16_f16:
13536
    Param0 = 0;
13537
    Param1 = Intrinsic::arm_mve_vcvtn;
13538
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13539
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13540
    break;
13541
  case ARM::BI__builtin_arm_mve_vcvtnq_s32_f32:
13542
    Param0 = 0;
13543
    Param1 = Intrinsic::arm_mve_vcvtn;
13544
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13545
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13546
    break;
13547
  case ARM::BI__builtin_arm_mve_vcvtnq_u16_f16:
13548
    Param0 = 1;
13549
    Param1 = Intrinsic::arm_mve_vcvtn;
13550
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13551
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13552
    break;
13553
  case ARM::BI__builtin_arm_mve_vcvtnq_u32_f32:
13554
    Param0 = 1;
13555
    Param1 = Intrinsic::arm_mve_vcvtn;
13556
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13557
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13558
    break;
13559
  case ARM::BI__builtin_arm_mve_vcvtpq_s16_f16:
13560
    Param0 = 0;
13561
    Param1 = Intrinsic::arm_mve_vcvtp;
13562
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13563
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13564
    break;
13565
  case ARM::BI__builtin_arm_mve_vcvtpq_s32_f32:
13566
    Param0 = 0;
13567
    Param1 = Intrinsic::arm_mve_vcvtp;
13568
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13569
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13570
    break;
13571
  case ARM::BI__builtin_arm_mve_vcvtpq_u16_f16:
13572
    Param0 = 1;
13573
    Param1 = Intrinsic::arm_mve_vcvtp;
13574
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13575
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13576
    break;
13577
  case ARM::BI__builtin_arm_mve_vcvtpq_u32_f32:
13578
    Param0 = 1;
13579
    Param1 = Intrinsic::arm_mve_vcvtp;
13580
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13581
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13582
    break;
13583
  }
13584
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13585
  Value *Val1 = EmitScalarExpr(E->getArg(0));
13586
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {Param2, Param3}), {Val0, Val1});
13587
}
13588
case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_f16:
13589
case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_f32:
13590
case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_s16:
13591
case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_s32:
13592
case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_s8:
13593
case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_u16:
13594
case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_u32:
13595
case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_u8:
13596
case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_f16:
13597
case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_f32:
13598
case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_s16:
13599
case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_s32:
13600
case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_s8:
13601
case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_u16:
13602
case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_u32:
13603
case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_u8:
13604
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_m_s16:
13605
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_m_s32:
13606
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_m_s8:
13607
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_m_s16:
13608
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_m_s32:
13609
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_m_s8: {
13610
  uint32_t  Param0;
13611
  uint32_t  Param1;
13612
  llvm::Type * Param2;
13613
  llvm::Type * Param3;
13614
  switch (BuiltinID) {
13615
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_f16:
13616
    Param0 = 1;
13617
    Param1 = 1;
13618
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13619
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13620
    break;
13621
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_f32:
13622
    Param0 = 1;
13623
    Param1 = 1;
13624
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13625
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13626
    break;
13627
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_s16:
13628
    Param0 = 1;
13629
    Param1 = 1;
13630
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13631
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13632
    break;
13633
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_s32:
13634
    Param0 = 1;
13635
    Param1 = 1;
13636
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13637
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13638
    break;
13639
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_s8:
13640
    Param0 = 1;
13641
    Param1 = 1;
13642
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13643
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
13644
    break;
13645
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_u16:
13646
    Param0 = 1;
13647
    Param1 = 1;
13648
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13649
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13650
    break;
13651
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_u32:
13652
    Param0 = 1;
13653
    Param1 = 1;
13654
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13655
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13656
    break;
13657
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_m_u8:
13658
    Param0 = 1;
13659
    Param1 = 1;
13660
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13661
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
13662
    break;
13663
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_f16:
13664
    Param0 = 1;
13665
    Param1 = 0;
13666
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13667
    Param3 = llvm::FixedVectorType::get(HalfTy, 8);
13668
    break;
13669
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_f32:
13670
    Param0 = 1;
13671
    Param1 = 0;
13672
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13673
    Param3 = llvm::FixedVectorType::get(FloatTy, 4);
13674
    break;
13675
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_s16:
13676
    Param0 = 1;
13677
    Param1 = 0;
13678
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13679
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13680
    break;
13681
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_s32:
13682
    Param0 = 1;
13683
    Param1 = 0;
13684
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13685
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13686
    break;
13687
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_s8:
13688
    Param0 = 1;
13689
    Param1 = 0;
13690
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13691
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
13692
    break;
13693
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_u16:
13694
    Param0 = 1;
13695
    Param1 = 0;
13696
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13697
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13698
    break;
13699
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_u32:
13700
    Param0 = 1;
13701
    Param1 = 0;
13702
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13703
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13704
    break;
13705
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_m_u8:
13706
    Param0 = 1;
13707
    Param1 = 0;
13708
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13709
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
13710
    break;
13711
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_m_s16:
13712
    Param0 = 0;
13713
    Param1 = 1;
13714
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13715
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13716
    break;
13717
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_m_s32:
13718
    Param0 = 0;
13719
    Param1 = 1;
13720
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13721
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13722
    break;
13723
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_m_s8:
13724
    Param0 = 0;
13725
    Param1 = 1;
13726
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13727
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
13728
    break;
13729
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_m_s16:
13730
    Param0 = 0;
13731
    Param1 = 0;
13732
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13733
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
13734
    break;
13735
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_m_s32:
13736
    Param0 = 0;
13737
    Param1 = 0;
13738
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13739
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
13740
    break;
13741
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_m_s8:
13742
    Param0 = 0;
13743
    Param1 = 0;
13744
    Param2 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13745
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
13746
    break;
13747
  }
13748
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13749
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param1);
13750
  Value *Val2 = EmitScalarExpr(E->getArg(0));
13751
  Value *Val3 = EmitScalarExpr(E->getArg(1));
13752
  Value *Val4 = EmitScalarExpr(E->getArg(2));
13753
  Value *Val5 = EmitScalarExpr(E->getArg(3));
13754
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
13755
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param2}), {Val6});
13756
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcaddq_predicated, {Param3, Param2}), {Val0, Val1, Val2, Val3, Val4, Val7});
13757
}
13758
case ARM::BI__builtin_arm_mve_vcaddq_rot270_f16:
13759
case ARM::BI__builtin_arm_mve_vcaddq_rot270_f32:
13760
case ARM::BI__builtin_arm_mve_vcaddq_rot270_s16:
13761
case ARM::BI__builtin_arm_mve_vcaddq_rot270_s32:
13762
case ARM::BI__builtin_arm_mve_vcaddq_rot270_s8:
13763
case ARM::BI__builtin_arm_mve_vcaddq_rot270_u16:
13764
case ARM::BI__builtin_arm_mve_vcaddq_rot270_u32:
13765
case ARM::BI__builtin_arm_mve_vcaddq_rot270_u8:
13766
case ARM::BI__builtin_arm_mve_vcaddq_rot90_f16:
13767
case ARM::BI__builtin_arm_mve_vcaddq_rot90_f32:
13768
case ARM::BI__builtin_arm_mve_vcaddq_rot90_s16:
13769
case ARM::BI__builtin_arm_mve_vcaddq_rot90_s32:
13770
case ARM::BI__builtin_arm_mve_vcaddq_rot90_s8:
13771
case ARM::BI__builtin_arm_mve_vcaddq_rot90_u16:
13772
case ARM::BI__builtin_arm_mve_vcaddq_rot90_u32:
13773
case ARM::BI__builtin_arm_mve_vcaddq_rot90_u8:
13774
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_s16:
13775
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_s32:
13776
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_s8:
13777
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_s16:
13778
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_s32:
13779
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_s8: {
13780
  uint32_t  Param0;
13781
  uint32_t  Param1;
13782
  llvm::Type * Param2;
13783
  switch (BuiltinID) {
13784
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_f16:
13785
    Param0 = 1;
13786
    Param1 = 1;
13787
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13788
    break;
13789
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_f32:
13790
    Param0 = 1;
13791
    Param1 = 1;
13792
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13793
    break;
13794
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_s16:
13795
    Param0 = 1;
13796
    Param1 = 1;
13797
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13798
    break;
13799
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_s32:
13800
    Param0 = 1;
13801
    Param1 = 1;
13802
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13803
    break;
13804
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_s8:
13805
    Param0 = 1;
13806
    Param1 = 1;
13807
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
13808
    break;
13809
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_u16:
13810
    Param0 = 1;
13811
    Param1 = 1;
13812
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13813
    break;
13814
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_u32:
13815
    Param0 = 1;
13816
    Param1 = 1;
13817
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13818
    break;
13819
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_u8:
13820
    Param0 = 1;
13821
    Param1 = 1;
13822
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
13823
    break;
13824
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_f16:
13825
    Param0 = 1;
13826
    Param1 = 0;
13827
    Param2 = llvm::FixedVectorType::get(HalfTy, 8);
13828
    break;
13829
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_f32:
13830
    Param0 = 1;
13831
    Param1 = 0;
13832
    Param2 = llvm::FixedVectorType::get(FloatTy, 4);
13833
    break;
13834
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_s16:
13835
    Param0 = 1;
13836
    Param1 = 0;
13837
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13838
    break;
13839
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_s32:
13840
    Param0 = 1;
13841
    Param1 = 0;
13842
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13843
    break;
13844
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_s8:
13845
    Param0 = 1;
13846
    Param1 = 0;
13847
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
13848
    break;
13849
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_u16:
13850
    Param0 = 1;
13851
    Param1 = 0;
13852
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13853
    break;
13854
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_u32:
13855
    Param0 = 1;
13856
    Param1 = 0;
13857
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13858
    break;
13859
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_u8:
13860
    Param0 = 1;
13861
    Param1 = 0;
13862
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
13863
    break;
13864
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_s16:
13865
    Param0 = 0;
13866
    Param1 = 1;
13867
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13868
    break;
13869
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_s32:
13870
    Param0 = 0;
13871
    Param1 = 1;
13872
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13873
    break;
13874
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_s8:
13875
    Param0 = 0;
13876
    Param1 = 1;
13877
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
13878
    break;
13879
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_s16:
13880
    Param0 = 0;
13881
    Param1 = 0;
13882
    Param2 = llvm::FixedVectorType::get(Int16Ty, 8);
13883
    break;
13884
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_s32:
13885
    Param0 = 0;
13886
    Param1 = 0;
13887
    Param2 = llvm::FixedVectorType::get(Int32Ty, 4);
13888
    break;
13889
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_s8:
13890
    Param0 = 0;
13891
    Param1 = 0;
13892
    Param2 = llvm::FixedVectorType::get(Int8Ty, 16);
13893
    break;
13894
  }
13895
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
13896
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param1);
13897
  Value *Val2 = EmitScalarExpr(E->getArg(0));
13898
  Value *Val3 = EmitScalarExpr(E->getArg(1));
13899
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcaddq, {Param2}), {Val0, Val1, Val2, Val3});
13900
}
13901
case ARM::BI__builtin_arm_mve_vmladavaq_p_s16:
13902
case ARM::BI__builtin_arm_mve_vmladavaq_p_s32:
13903
case ARM::BI__builtin_arm_mve_vmladavaq_p_s8:
13904
case ARM::BI__builtin_arm_mve_vmladavaq_p_u16:
13905
case ARM::BI__builtin_arm_mve_vmladavaq_p_u32:
13906
case ARM::BI__builtin_arm_mve_vmladavaq_p_u8:
13907
case ARM::BI__builtin_arm_mve_vmladavaxq_p_s16:
13908
case ARM::BI__builtin_arm_mve_vmladavaxq_p_s32:
13909
case ARM::BI__builtin_arm_mve_vmladavaxq_p_s8:
13910
case ARM::BI__builtin_arm_mve_vmlsdavaq_p_s16:
13911
case ARM::BI__builtin_arm_mve_vmlsdavaq_p_s32:
13912
case ARM::BI__builtin_arm_mve_vmlsdavaq_p_s8:
13913
case ARM::BI__builtin_arm_mve_vmlsdavaxq_p_s16:
13914
case ARM::BI__builtin_arm_mve_vmlsdavaxq_p_s32:
13915
case ARM::BI__builtin_arm_mve_vmlsdavaxq_p_s8: {
13916
  uint32_t  Param0;
13917
  uint32_t  Param1;
13918
  uint32_t  Param2;
13919
  llvm::Type * Param3;
13920
  llvm::Type * Param4;
13921
  switch (BuiltinID) {
13922
  case ARM::BI__builtin_arm_mve_vmladavaq_p_s16:
13923
    Param0 = 0;
13924
    Param1 = 0;
13925
    Param2 = 0;
13926
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13927
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
13928
    break;
13929
  case ARM::BI__builtin_arm_mve_vmladavaq_p_s32:
13930
    Param0 = 0;
13931
    Param1 = 0;
13932
    Param2 = 0;
13933
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13934
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
13935
    break;
13936
  case ARM::BI__builtin_arm_mve_vmladavaq_p_s8:
13937
    Param0 = 0;
13938
    Param1 = 0;
13939
    Param2 = 0;
13940
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13941
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
13942
    break;
13943
  case ARM::BI__builtin_arm_mve_vmladavaq_p_u16:
13944
    Param0 = 1;
13945
    Param1 = 0;
13946
    Param2 = 0;
13947
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13948
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
13949
    break;
13950
  case ARM::BI__builtin_arm_mve_vmladavaq_p_u32:
13951
    Param0 = 1;
13952
    Param1 = 0;
13953
    Param2 = 0;
13954
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13955
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
13956
    break;
13957
  case ARM::BI__builtin_arm_mve_vmladavaq_p_u8:
13958
    Param0 = 1;
13959
    Param1 = 0;
13960
    Param2 = 0;
13961
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13962
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
13963
    break;
13964
  case ARM::BI__builtin_arm_mve_vmladavaxq_p_s16:
13965
    Param0 = 0;
13966
    Param1 = 0;
13967
    Param2 = 1;
13968
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13969
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
13970
    break;
13971
  case ARM::BI__builtin_arm_mve_vmladavaxq_p_s32:
13972
    Param0 = 0;
13973
    Param1 = 0;
13974
    Param2 = 1;
13975
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13976
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
13977
    break;
13978
  case ARM::BI__builtin_arm_mve_vmladavaxq_p_s8:
13979
    Param0 = 0;
13980
    Param1 = 0;
13981
    Param2 = 1;
13982
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
13983
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
13984
    break;
13985
  case ARM::BI__builtin_arm_mve_vmlsdavaq_p_s16:
13986
    Param0 = 0;
13987
    Param1 = 1;
13988
    Param2 = 0;
13989
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
13990
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
13991
    break;
13992
  case ARM::BI__builtin_arm_mve_vmlsdavaq_p_s32:
13993
    Param0 = 0;
13994
    Param1 = 1;
13995
    Param2 = 0;
13996
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
13997
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
13998
    break;
13999
  case ARM::BI__builtin_arm_mve_vmlsdavaq_p_s8:
14000
    Param0 = 0;
14001
    Param1 = 1;
14002
    Param2 = 0;
14003
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
14004
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
14005
    break;
14006
  case ARM::BI__builtin_arm_mve_vmlsdavaxq_p_s16:
14007
    Param0 = 0;
14008
    Param1 = 1;
14009
    Param2 = 1;
14010
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14011
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14012
    break;
14013
  case ARM::BI__builtin_arm_mve_vmlsdavaxq_p_s32:
14014
    Param0 = 0;
14015
    Param1 = 1;
14016
    Param2 = 1;
14017
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14018
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14019
    break;
14020
  case ARM::BI__builtin_arm_mve_vmlsdavaxq_p_s8:
14021
    Param0 = 0;
14022
    Param1 = 1;
14023
    Param2 = 1;
14024
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
14025
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
14026
    break;
14027
  }
14028
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
14029
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param1);
14030
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param2);
14031
  Value *Val3 = EmitScalarExpr(E->getArg(0));
14032
  Value *Val4 = EmitScalarExpr(E->getArg(1));
14033
  Value *Val5 = EmitScalarExpr(E->getArg(2));
14034
  Value *Val6 = EmitScalarExpr(E->getArg(3));
14035
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
14036
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val7});
14037
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vmldava_predicated, {Param4, Param3}), {Val0, Val1, Val2, Val3, Val4, Val5, Val8});
14038
}
14039
case ARM::BI__builtin_arm_mve_vmladavaq_s16:
14040
case ARM::BI__builtin_arm_mve_vmladavaq_s32:
14041
case ARM::BI__builtin_arm_mve_vmladavaq_s8:
14042
case ARM::BI__builtin_arm_mve_vmladavaq_u16:
14043
case ARM::BI__builtin_arm_mve_vmladavaq_u32:
14044
case ARM::BI__builtin_arm_mve_vmladavaq_u8:
14045
case ARM::BI__builtin_arm_mve_vmladavaxq_s16:
14046
case ARM::BI__builtin_arm_mve_vmladavaxq_s32:
14047
case ARM::BI__builtin_arm_mve_vmladavaxq_s8:
14048
case ARM::BI__builtin_arm_mve_vmlsdavaq_s16:
14049
case ARM::BI__builtin_arm_mve_vmlsdavaq_s32:
14050
case ARM::BI__builtin_arm_mve_vmlsdavaq_s8:
14051
case ARM::BI__builtin_arm_mve_vmlsdavaxq_s16:
14052
case ARM::BI__builtin_arm_mve_vmlsdavaxq_s32:
14053
case ARM::BI__builtin_arm_mve_vmlsdavaxq_s8: {
14054
  uint32_t  Param0;
14055
  uint32_t  Param1;
14056
  uint32_t  Param2;
14057
  llvm::Type * Param3;
14058
  switch (BuiltinID) {
14059
  case ARM::BI__builtin_arm_mve_vmladavaq_s16:
14060
    Param0 = 0;
14061
    Param1 = 0;
14062
    Param2 = 0;
14063
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14064
    break;
14065
  case ARM::BI__builtin_arm_mve_vmladavaq_s32:
14066
    Param0 = 0;
14067
    Param1 = 0;
14068
    Param2 = 0;
14069
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14070
    break;
14071
  case ARM::BI__builtin_arm_mve_vmladavaq_s8:
14072
    Param0 = 0;
14073
    Param1 = 0;
14074
    Param2 = 0;
14075
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14076
    break;
14077
  case ARM::BI__builtin_arm_mve_vmladavaq_u16:
14078
    Param0 = 1;
14079
    Param1 = 0;
14080
    Param2 = 0;
14081
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14082
    break;
14083
  case ARM::BI__builtin_arm_mve_vmladavaq_u32:
14084
    Param0 = 1;
14085
    Param1 = 0;
14086
    Param2 = 0;
14087
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14088
    break;
14089
  case ARM::BI__builtin_arm_mve_vmladavaq_u8:
14090
    Param0 = 1;
14091
    Param1 = 0;
14092
    Param2 = 0;
14093
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14094
    break;
14095
  case ARM::BI__builtin_arm_mve_vmladavaxq_s16:
14096
    Param0 = 0;
14097
    Param1 = 0;
14098
    Param2 = 1;
14099
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14100
    break;
14101
  case ARM::BI__builtin_arm_mve_vmladavaxq_s32:
14102
    Param0 = 0;
14103
    Param1 = 0;
14104
    Param2 = 1;
14105
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14106
    break;
14107
  case ARM::BI__builtin_arm_mve_vmladavaxq_s8:
14108
    Param0 = 0;
14109
    Param1 = 0;
14110
    Param2 = 1;
14111
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14112
    break;
14113
  case ARM::BI__builtin_arm_mve_vmlsdavaq_s16:
14114
    Param0 = 0;
14115
    Param1 = 1;
14116
    Param2 = 0;
14117
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14118
    break;
14119
  case ARM::BI__builtin_arm_mve_vmlsdavaq_s32:
14120
    Param0 = 0;
14121
    Param1 = 1;
14122
    Param2 = 0;
14123
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14124
    break;
14125
  case ARM::BI__builtin_arm_mve_vmlsdavaq_s8:
14126
    Param0 = 0;
14127
    Param1 = 1;
14128
    Param2 = 0;
14129
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14130
    break;
14131
  case ARM::BI__builtin_arm_mve_vmlsdavaxq_s16:
14132
    Param0 = 0;
14133
    Param1 = 1;
14134
    Param2 = 1;
14135
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14136
    break;
14137
  case ARM::BI__builtin_arm_mve_vmlsdavaxq_s32:
14138
    Param0 = 0;
14139
    Param1 = 1;
14140
    Param2 = 1;
14141
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14142
    break;
14143
  case ARM::BI__builtin_arm_mve_vmlsdavaxq_s8:
14144
    Param0 = 0;
14145
    Param1 = 1;
14146
    Param2 = 1;
14147
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14148
    break;
14149
  }
14150
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
14151
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param1);
14152
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param2);
14153
  Value *Val3 = EmitScalarExpr(E->getArg(0));
14154
  Value *Val4 = EmitScalarExpr(E->getArg(1));
14155
  Value *Val5 = EmitScalarExpr(E->getArg(2));
14156
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vmldava, {Param3}), {Val0, Val1, Val2, Val3, Val4, Val5});
14157
}
14158
case ARM::BI__builtin_arm_mve_vmladavq_p_s16:
14159
case ARM::BI__builtin_arm_mve_vmladavq_p_s32:
14160
case ARM::BI__builtin_arm_mve_vmladavq_p_s8:
14161
case ARM::BI__builtin_arm_mve_vmladavq_p_u16:
14162
case ARM::BI__builtin_arm_mve_vmladavq_p_u32:
14163
case ARM::BI__builtin_arm_mve_vmladavq_p_u8:
14164
case ARM::BI__builtin_arm_mve_vmladavxq_p_s16:
14165
case ARM::BI__builtin_arm_mve_vmladavxq_p_s32:
14166
case ARM::BI__builtin_arm_mve_vmladavxq_p_s8:
14167
case ARM::BI__builtin_arm_mve_vmlsdavq_p_s16:
14168
case ARM::BI__builtin_arm_mve_vmlsdavq_p_s32:
14169
case ARM::BI__builtin_arm_mve_vmlsdavq_p_s8:
14170
case ARM::BI__builtin_arm_mve_vmlsdavxq_p_s16:
14171
case ARM::BI__builtin_arm_mve_vmlsdavxq_p_s32:
14172
case ARM::BI__builtin_arm_mve_vmlsdavxq_p_s8: {
14173
  uint32_t  Param0;
14174
  uint32_t  Param1;
14175
  uint32_t  Param2;
14176
  llvm::Type * Param3;
14177
  llvm::Type * Param4;
14178
  switch (BuiltinID) {
14179
  case ARM::BI__builtin_arm_mve_vmladavq_p_s16:
14180
    Param0 = 0;
14181
    Param1 = 0;
14182
    Param2 = 0;
14183
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14184
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14185
    break;
14186
  case ARM::BI__builtin_arm_mve_vmladavq_p_s32:
14187
    Param0 = 0;
14188
    Param1 = 0;
14189
    Param2 = 0;
14190
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14191
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14192
    break;
14193
  case ARM::BI__builtin_arm_mve_vmladavq_p_s8:
14194
    Param0 = 0;
14195
    Param1 = 0;
14196
    Param2 = 0;
14197
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
14198
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
14199
    break;
14200
  case ARM::BI__builtin_arm_mve_vmladavq_p_u16:
14201
    Param0 = 1;
14202
    Param1 = 0;
14203
    Param2 = 0;
14204
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14205
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14206
    break;
14207
  case ARM::BI__builtin_arm_mve_vmladavq_p_u32:
14208
    Param0 = 1;
14209
    Param1 = 0;
14210
    Param2 = 0;
14211
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14212
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14213
    break;
14214
  case ARM::BI__builtin_arm_mve_vmladavq_p_u8:
14215
    Param0 = 1;
14216
    Param1 = 0;
14217
    Param2 = 0;
14218
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
14219
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
14220
    break;
14221
  case ARM::BI__builtin_arm_mve_vmladavxq_p_s16:
14222
    Param0 = 0;
14223
    Param1 = 0;
14224
    Param2 = 1;
14225
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14226
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14227
    break;
14228
  case ARM::BI__builtin_arm_mve_vmladavxq_p_s32:
14229
    Param0 = 0;
14230
    Param1 = 0;
14231
    Param2 = 1;
14232
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14233
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14234
    break;
14235
  case ARM::BI__builtin_arm_mve_vmladavxq_p_s8:
14236
    Param0 = 0;
14237
    Param1 = 0;
14238
    Param2 = 1;
14239
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
14240
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
14241
    break;
14242
  case ARM::BI__builtin_arm_mve_vmlsdavq_p_s16:
14243
    Param0 = 0;
14244
    Param1 = 1;
14245
    Param2 = 0;
14246
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14247
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14248
    break;
14249
  case ARM::BI__builtin_arm_mve_vmlsdavq_p_s32:
14250
    Param0 = 0;
14251
    Param1 = 1;
14252
    Param2 = 0;
14253
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14254
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14255
    break;
14256
  case ARM::BI__builtin_arm_mve_vmlsdavq_p_s8:
14257
    Param0 = 0;
14258
    Param1 = 1;
14259
    Param2 = 0;
14260
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
14261
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
14262
    break;
14263
  case ARM::BI__builtin_arm_mve_vmlsdavxq_p_s16:
14264
    Param0 = 0;
14265
    Param1 = 1;
14266
    Param2 = 1;
14267
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14268
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14269
    break;
14270
  case ARM::BI__builtin_arm_mve_vmlsdavxq_p_s32:
14271
    Param0 = 0;
14272
    Param1 = 1;
14273
    Param2 = 1;
14274
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14275
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14276
    break;
14277
  case ARM::BI__builtin_arm_mve_vmlsdavxq_p_s8:
14278
    Param0 = 0;
14279
    Param1 = 1;
14280
    Param2 = 1;
14281
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 16);
14282
    Param4 = llvm::FixedVectorType::get(Int8Ty, 16);
14283
    break;
14284
  }
14285
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
14286
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param1);
14287
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param2);
14288
  llvm::Type *Val3 = Int32Ty;
14289
  Value *Val4 = llvm::Constant::getNullValue(Val3);
14290
  Value *Val5 = EmitScalarExpr(E->getArg(0));
14291
  Value *Val6 = EmitScalarExpr(E->getArg(1));
14292
  Value *Val7 = EmitScalarExpr(E->getArg(2));
14293
  Value *Val8 = Builder.CreateIntCast(Val7, Int32Ty, false);
14294
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val8});
14295
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vmldava_predicated, {Param4, Param3}), {Val0, Val1, Val2, Val4, Val5, Val6, Val9});
14296
}
14297
case ARM::BI__builtin_arm_mve_vmladavq_s16:
14298
case ARM::BI__builtin_arm_mve_vmladavq_s32:
14299
case ARM::BI__builtin_arm_mve_vmladavq_s8:
14300
case ARM::BI__builtin_arm_mve_vmladavq_u16:
14301
case ARM::BI__builtin_arm_mve_vmladavq_u32:
14302
case ARM::BI__builtin_arm_mve_vmladavq_u8:
14303
case ARM::BI__builtin_arm_mve_vmladavxq_s16:
14304
case ARM::BI__builtin_arm_mve_vmladavxq_s32:
14305
case ARM::BI__builtin_arm_mve_vmladavxq_s8:
14306
case ARM::BI__builtin_arm_mve_vmlsdavq_s16:
14307
case ARM::BI__builtin_arm_mve_vmlsdavq_s32:
14308
case ARM::BI__builtin_arm_mve_vmlsdavq_s8:
14309
case ARM::BI__builtin_arm_mve_vmlsdavxq_s16:
14310
case ARM::BI__builtin_arm_mve_vmlsdavxq_s32:
14311
case ARM::BI__builtin_arm_mve_vmlsdavxq_s8: {
14312
  uint32_t  Param0;
14313
  uint32_t  Param1;
14314
  uint32_t  Param2;
14315
  llvm::Type * Param3;
14316
  switch (BuiltinID) {
14317
  case ARM::BI__builtin_arm_mve_vmladavq_s16:
14318
    Param0 = 0;
14319
    Param1 = 0;
14320
    Param2 = 0;
14321
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14322
    break;
14323
  case ARM::BI__builtin_arm_mve_vmladavq_s32:
14324
    Param0 = 0;
14325
    Param1 = 0;
14326
    Param2 = 0;
14327
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14328
    break;
14329
  case ARM::BI__builtin_arm_mve_vmladavq_s8:
14330
    Param0 = 0;
14331
    Param1 = 0;
14332
    Param2 = 0;
14333
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14334
    break;
14335
  case ARM::BI__builtin_arm_mve_vmladavq_u16:
14336
    Param0 = 1;
14337
    Param1 = 0;
14338
    Param2 = 0;
14339
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14340
    break;
14341
  case ARM::BI__builtin_arm_mve_vmladavq_u32:
14342
    Param0 = 1;
14343
    Param1 = 0;
14344
    Param2 = 0;
14345
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14346
    break;
14347
  case ARM::BI__builtin_arm_mve_vmladavq_u8:
14348
    Param0 = 1;
14349
    Param1 = 0;
14350
    Param2 = 0;
14351
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14352
    break;
14353
  case ARM::BI__builtin_arm_mve_vmladavxq_s16:
14354
    Param0 = 0;
14355
    Param1 = 0;
14356
    Param2 = 1;
14357
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14358
    break;
14359
  case ARM::BI__builtin_arm_mve_vmladavxq_s32:
14360
    Param0 = 0;
14361
    Param1 = 0;
14362
    Param2 = 1;
14363
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14364
    break;
14365
  case ARM::BI__builtin_arm_mve_vmladavxq_s8:
14366
    Param0 = 0;
14367
    Param1 = 0;
14368
    Param2 = 1;
14369
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14370
    break;
14371
  case ARM::BI__builtin_arm_mve_vmlsdavq_s16:
14372
    Param0 = 0;
14373
    Param1 = 1;
14374
    Param2 = 0;
14375
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14376
    break;
14377
  case ARM::BI__builtin_arm_mve_vmlsdavq_s32:
14378
    Param0 = 0;
14379
    Param1 = 1;
14380
    Param2 = 0;
14381
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14382
    break;
14383
  case ARM::BI__builtin_arm_mve_vmlsdavq_s8:
14384
    Param0 = 0;
14385
    Param1 = 1;
14386
    Param2 = 0;
14387
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14388
    break;
14389
  case ARM::BI__builtin_arm_mve_vmlsdavxq_s16:
14390
    Param0 = 0;
14391
    Param1 = 1;
14392
    Param2 = 1;
14393
    Param3 = llvm::FixedVectorType::get(Int16Ty, 8);
14394
    break;
14395
  case ARM::BI__builtin_arm_mve_vmlsdavxq_s32:
14396
    Param0 = 0;
14397
    Param1 = 1;
14398
    Param2 = 1;
14399
    Param3 = llvm::FixedVectorType::get(Int32Ty, 4);
14400
    break;
14401
  case ARM::BI__builtin_arm_mve_vmlsdavxq_s8:
14402
    Param0 = 0;
14403
    Param1 = 1;
14404
    Param2 = 1;
14405
    Param3 = llvm::FixedVectorType::get(Int8Ty, 16);
14406
    break;
14407
  }
14408
  Value *Val0 = llvm::ConstantInt::get(Int32Ty, Param0);
14409
  Value *Val1 = llvm::ConstantInt::get(Int32Ty, Param1);
14410
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param2);
14411
  llvm::Type *Val3 = Int32Ty;
14412
  Value *Val4 = llvm::Constant::getNullValue(Val3);
14413
  Value *Val5 = EmitScalarExpr(E->getArg(0));
14414
  Value *Val6 = EmitScalarExpr(E->getArg(1));
14415
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vmldava, {Param3}), {Val0, Val1, Val2, Val4, Val5, Val6});
14416
}
14417
case ARM::BI__builtin_arm_mve_vmlaldavq_s16:
14418
case ARM::BI__builtin_arm_mve_vmlaldavq_s32:
14419
case ARM::BI__builtin_arm_mve_vmlaldavq_u16:
14420
case ARM::BI__builtin_arm_mve_vmlaldavq_u32:
14421
case ARM::BI__builtin_arm_mve_vmlaldavxq_s16:
14422
case ARM::BI__builtin_arm_mve_vmlaldavxq_s32:
14423
case ARM::BI__builtin_arm_mve_vmlsldavq_s16:
14424
case ARM::BI__builtin_arm_mve_vmlsldavq_s32:
14425
case ARM::BI__builtin_arm_mve_vmlsldavxq_s16:
14426
case ARM::BI__builtin_arm_mve_vmlsldavxq_s32:
14427
case ARM::BI__builtin_arm_mve_vrmlaldavhq_s32:
14428
case ARM::BI__builtin_arm_mve_vrmlaldavhq_u32:
14429
case ARM::BI__builtin_arm_mve_vrmlaldavhxq_s32:
14430
case ARM::BI__builtin_arm_mve_vrmlsldavhq_s32:
14431
case ARM::BI__builtin_arm_mve_vrmlsldavhxq_s32: {
14432
  uint32_t  Param0;
14433
  uint32_t  Param1;
14434
  uint32_t  Param2;
14435
  Intrinsic::ID  Param3;
14436
  llvm::Type * Param4;
14437
  switch (BuiltinID) {
14438
  case ARM::BI__builtin_arm_mve_vmlaldavq_s16:
14439
    Param0 = 0;
14440
    Param1 = 0;
14441
    Param2 = 0;
14442
    Param3 = Intrinsic::arm_mve_vmlldava;
14443
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14444
    break;
14445
  case ARM::BI__builtin_arm_mve_vmlaldavq_s32:
14446
    Param0 = 0;
14447
    Param1 = 0;
14448
    Param2 = 0;
14449
    Param3 = Intrinsic::arm_mve_vmlldava;
14450
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14451
    break;
14452
  case ARM::BI__builtin_arm_mve_vmlaldavq_u16:
14453
    Param0 = 1;
14454
    Param1 = 0;
14455
    Param2 = 0;
14456
    Param3 = Intrinsic::arm_mve_vmlldava;
14457
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14458
    break;
14459
  case ARM::BI__builtin_arm_mve_vmlaldavq_u32:
14460
    Param0 = 1;
14461
    Param1 = 0;
14462
    Param2 = 0;
14463
    Param3 = Intrinsic::arm_mve_vmlldava;
14464
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14465
    break;
14466
  case ARM::BI__builtin_arm_mve_vmlaldavxq_s16:
14467
    Param0 = 0;
14468
    Param1 = 0;
14469
    Param2 = 1;
14470
    Param3 = Intrinsic::arm_mve_vmlldava;
14471
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14472
    break;
14473
  case ARM::BI__builtin_arm_mve_vmlaldavxq_s32:
14474
    Param0 = 0;
14475
    Param1 = 0;
14476
    Param2 = 1;
14477
    Param3 = Intrinsic::arm_mve_vmlldava;
14478
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14479
    break;
14480
  case ARM::BI__builtin_arm_mve_vmlsldavq_s16:
14481
    Param0 = 0;
14482
    Param1 = 1;
14483
    Param2 = 0;
14484
    Param3 = Intrinsic::arm_mve_vmlldava;
14485
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14486
    break;
14487
  case ARM::BI__builtin_arm_mve_vmlsldavq_s32:
14488
    Param0 = 0;
14489
    Param1 = 1;
14490
    Param2 = 0;
14491
    Param3 = Intrinsic::arm_mve_vmlldava;
14492
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14493
    break;
14494
  case ARM::BI__builtin_arm_mve_vmlsldavxq_s16:
14495
    Param0 = 0;
14496
    Param1 = 1;
14497
    Param2 = 1;
14498
    Param3 = Intrinsic::arm_mve_vmlldava;
14499
    Param4 = llvm::FixedVectorType::get(Int16Ty, 8);
14500
    break;
14501
  case ARM::BI__builtin_arm_mve_vmlsldavxq_s32:
14502
    Param0 = 0;
14503
    Param1 = 1;
14504
    Param2 = 1;
14505
    Param3 = Intrinsic::arm_mve_vmlldava;
14506
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14507
    break;
14508
  case ARM::BI__builtin_arm_mve_vrmlaldavhq_s32:
14509
    Param0 = 0;
14510
    Param1 = 0;
14511
    Param2 = 0;
14512
    Param3 = Intrinsic::arm_mve_vrmlldavha;
14513
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14514
    break;
14515
  case ARM::BI__builtin_arm_mve_vrmlaldavhq_u32:
14516
    Param0 = 1;
14517
    Param1 = 0;
14518
    Param2 = 0;
14519
    Param3 = Intrinsic::arm_mve_vrmlldavha;
14520
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14521
    break;
14522
  case ARM::BI__builtin_arm_mve_vrmlaldavhxq_s32:
14523
    Param0 = 0;
14524
    Param1 = 0;
14525
    Param2 = 1;
14526
    Param3 = Intrinsic::arm_mve_vrmlldavha;
14527
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14528
    break;
14529
  case ARM::BI__builtin_arm_mve_vrmlsldavhq_s32:
14530
    Param0 = 0;
14531
    Param1 = 1;
14532
    Param2 = 0;
14533
    Param3 = Intrinsic::arm_mve_vrmlldavha;
14534
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14535
    break;
14536
  case ARM::BI__builtin_arm_mve_vrmlsldavhxq_s32:
14537
    Param0 = 0;
14538
    Param1 = 1;
14539
    Param2 = 1;
14540
    Param3 = Intrinsic::arm_mve_vrmlldavha;
14541
    Param4 = llvm::FixedVectorType::get(Int32Ty, 4);
14542
    break;
14543
  }
14544
  llvm::Type *Val0 = Int32Ty;
14545
  Value *Val1 = llvm::Constant::getNullValue(Val0);
14546
  llvm::Type *Val2 = Int32Ty;
14547
  Value *Val3 = llvm::Constant::getNullValue(Val2);
14548
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
14549
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param1);
14550
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param2);
14551
  Value *Val7 = EmitScalarExpr(E->getArg(0));
14552
  Value *Val8 = EmitScalarExpr(E->getArg(1));
14553
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Param3, {Param4}), {Val4, Val5, Val6, Val3, Val1, Val7, Val8});
14554
  Value *Val10 = Builder.CreateExtractValue(Val9, static_cast<unsigned>(1));
14555
  Value *Val11 = Builder.CreateIntCast(Val10, Int64Ty, false);
14556
  Value *Val12 = llvm::ConstantInt::get(Int64Ty, 32);
14557
  Value *Val13 = Builder.CreateShl(Val11, Val12);
14558
  Value *Val14 = Builder.CreateExtractValue(Val9, static_cast<unsigned>(0));
14559
  Value *Val15 = Builder.CreateIntCast(Val14, Int64Ty, false);
14560
  return Builder.CreateOr(Val13, Val15);
14561
}
14562
case ARM::BI__builtin_arm_mve_vmlaldavq_p_s16:
14563
case ARM::BI__builtin_arm_mve_vmlaldavq_p_s32:
14564
case ARM::BI__builtin_arm_mve_vmlaldavq_p_u16:
14565
case ARM::BI__builtin_arm_mve_vmlaldavq_p_u32:
14566
case ARM::BI__builtin_arm_mve_vmlaldavxq_p_s16:
14567
case ARM::BI__builtin_arm_mve_vmlaldavxq_p_s32:
14568
case ARM::BI__builtin_arm_mve_vmlsldavq_p_s16:
14569
case ARM::BI__builtin_arm_mve_vmlsldavq_p_s32:
14570
case ARM::BI__builtin_arm_mve_vmlsldavxq_p_s16:
14571
case ARM::BI__builtin_arm_mve_vmlsldavxq_p_s32:
14572
case ARM::BI__builtin_arm_mve_vrmlaldavhq_p_s32:
14573
case ARM::BI__builtin_arm_mve_vrmlaldavhq_p_u32:
14574
case ARM::BI__builtin_arm_mve_vrmlaldavhxq_p_s32:
14575
case ARM::BI__builtin_arm_mve_vrmlsldavhq_p_s32:
14576
case ARM::BI__builtin_arm_mve_vrmlsldavhxq_p_s32: {
14577
  uint32_t  Param0;
14578
  uint32_t  Param1;
14579
  uint32_t  Param2;
14580
  llvm::Type * Param3;
14581
  Intrinsic::ID  Param4;
14582
  llvm::Type * Param5;
14583
  switch (BuiltinID) {
14584
  case ARM::BI__builtin_arm_mve_vmlaldavq_p_s16:
14585
    Param0 = 0;
14586
    Param1 = 0;
14587
    Param2 = 0;
14588
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14589
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14590
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
14591
    break;
14592
  case ARM::BI__builtin_arm_mve_vmlaldavq_p_s32:
14593
    Param0 = 0;
14594
    Param1 = 0;
14595
    Param2 = 0;
14596
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14597
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14598
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14599
    break;
14600
  case ARM::BI__builtin_arm_mve_vmlaldavq_p_u16:
14601
    Param0 = 1;
14602
    Param1 = 0;
14603
    Param2 = 0;
14604
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14605
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14606
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
14607
    break;
14608
  case ARM::BI__builtin_arm_mve_vmlaldavq_p_u32:
14609
    Param0 = 1;
14610
    Param1 = 0;
14611
    Param2 = 0;
14612
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14613
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14614
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14615
    break;
14616
  case ARM::BI__builtin_arm_mve_vmlaldavxq_p_s16:
14617
    Param0 = 0;
14618
    Param1 = 0;
14619
    Param2 = 1;
14620
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14621
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14622
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
14623
    break;
14624
  case ARM::BI__builtin_arm_mve_vmlaldavxq_p_s32:
14625
    Param0 = 0;
14626
    Param1 = 0;
14627
    Param2 = 1;
14628
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14629
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14630
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14631
    break;
14632
  case ARM::BI__builtin_arm_mve_vmlsldavq_p_s16:
14633
    Param0 = 0;
14634
    Param1 = 1;
14635
    Param2 = 0;
14636
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14637
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14638
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
14639
    break;
14640
  case ARM::BI__builtin_arm_mve_vmlsldavq_p_s32:
14641
    Param0 = 0;
14642
    Param1 = 1;
14643
    Param2 = 0;
14644
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14645
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14646
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14647
    break;
14648
  case ARM::BI__builtin_arm_mve_vmlsldavxq_p_s16:
14649
    Param0 = 0;
14650
    Param1 = 1;
14651
    Param2 = 1;
14652
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 8);
14653
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14654
    Param5 = llvm::FixedVectorType::get(Int16Ty, 8);
14655
    break;
14656
  case ARM::BI__builtin_arm_mve_vmlsldavxq_p_s32:
14657
    Param0 = 0;
14658
    Param1 = 1;
14659
    Param2 = 1;
14660
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14661
    Param4 = Intrinsic::arm_mve_vmlldava_predicated;
14662
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14663
    break;
14664
  case ARM::BI__builtin_arm_mve_vrmlaldavhq_p_s32:
14665
    Param0 = 0;
14666
    Param1 = 0;
14667
    Param2 = 0;
14668
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14669
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
14670
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14671
    break;
14672
  case ARM::BI__builtin_arm_mve_vrmlaldavhq_p_u32:
14673
    Param0 = 1;
14674
    Param1 = 0;
14675
    Param2 = 0;
14676
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14677
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
14678
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14679
    break;
14680
  case ARM::BI__builtin_arm_mve_vrmlaldavhxq_p_s32:
14681
    Param0 = 0;
14682
    Param1 = 0;
14683
    Param2 = 1;
14684
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14685
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
14686
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14687
    break;
14688
  case ARM::BI__builtin_arm_mve_vrmlsldavhq_p_s32:
14689
    Param0 = 0;
14690
    Param1 = 1;
14691
    Param2 = 0;
14692
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14693
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
14694
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14695
    break;
14696
  case ARM::BI__builtin_arm_mve_vrmlsldavhxq_p_s32:
14697
    Param0 = 0;
14698
    Param1 = 1;
14699
    Param2 = 1;
14700
    Param3 = llvm::FixedVectorType::get(Builder.getInt1Ty(), 4);
14701
    Param4 = Intrinsic::arm_mve_vrmlldavha_predicated;
14702
    Param5 = llvm::FixedVectorType::get(Int32Ty, 4);
14703
    break;
14704
  }
14705
  llvm::Type *Val0 = Int32Ty;
14706
  Value *Val1 = llvm::Constant::getNullValue(Val0);
14707
  llvm::Type *Val2 = Int32Ty;
14708
  Value *Val3 = llvm::Constant::getNullValue(Val2);
14709
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
14710
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param1);
14711
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param2);
14712
  Value *Val7 = EmitScalarExpr(E->getArg(0));
14713
  Value *Val8 = EmitScalarExpr(E->getArg(1));
14714
  Value *Val9 = EmitScalarExpr(E->getArg(2));
14715
  Value *Val10 = Builder.CreateIntCast(Val9, Int32Ty, false);
14716
  Value *Val11 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {Param3}), {Val10});
14717
  Value *Val12 = Builder.CreateCall(CGM.getIntrinsic(Param4, {Param5, Param3}), {Val4, Val5, Val6, Val3, Val1, Val7, Val8, Val11});
14718
  Value *Val13 = Builder.CreateExtractValue(Val12, static_cast<unsigned>(1));
14719
  Value *Val14 = Builder.CreateIntCast(Val13, Int64Ty, false);
14720
  Value *Val15 = llvm::ConstantInt::get(Int64Ty, 32);
14721
  Value *Val16 = Builder.CreateShl(Val14, Val15);
14722
  Value *Val17 = Builder.CreateExtractValue(Val12, static_cast<unsigned>(0));
14723
  Value *Val18 = Builder.CreateIntCast(Val17, Int64Ty, false);
14724
  return Builder.CreateOr(Val16, Val18);
14725
}
14726
case ARM::BI__builtin_arm_mve_vaddq_x_n_f32:
14727
case ARM::BI__builtin_arm_mve_vmulq_x_n_f32:
14728
case ARM::BI__builtin_arm_mve_vsubq_x_n_f32: {
14729
  Intrinsic::ID  Param0;
14730
  switch (BuiltinID) {
14731
  case ARM::BI__builtin_arm_mve_vaddq_x_n_f32:
14732
    Param0 = Intrinsic::arm_mve_add_predicated;
14733
    break;
14734
  case ARM::BI__builtin_arm_mve_vmulq_x_n_f32:
14735
    Param0 = Intrinsic::arm_mve_mul_predicated;
14736
    break;
14737
  case ARM::BI__builtin_arm_mve_vsubq_x_n_f32:
14738
    Param0 = Intrinsic::arm_mve_sub_predicated;
14739
    break;
14740
  }
14741
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14742
  Value *Val1 = UndefValue::get(Val0);
14743
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14744
  Value *Val3 = EmitScalarExpr(E->getArg(1));
14745
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
14746
  Value *Val5 = EmitScalarExpr(E->getArg(2));
14747
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
14748
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
14749
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val4, Val7, Val1});
14750
}
14751
case ARM::BI__builtin_arm_mve_vabsq_x_f32:
14752
case ARM::BI__builtin_arm_mve_vnegq_x_f32:
14753
case ARM::BI__builtin_arm_mve_vrndaq_x_f32:
14754
case ARM::BI__builtin_arm_mve_vrndmq_x_f32:
14755
case ARM::BI__builtin_arm_mve_vrndnq_x_f32:
14756
case ARM::BI__builtin_arm_mve_vrndpq_x_f32:
14757
case ARM::BI__builtin_arm_mve_vrndq_x_f32:
14758
case ARM::BI__builtin_arm_mve_vrndxq_x_f32: {
14759
  Intrinsic::ID  Param0;
14760
  switch (BuiltinID) {
14761
  case ARM::BI__builtin_arm_mve_vabsq_x_f32:
14762
    Param0 = Intrinsic::arm_mve_abs_predicated;
14763
    break;
14764
  case ARM::BI__builtin_arm_mve_vnegq_x_f32:
14765
    Param0 = Intrinsic::arm_mve_neg_predicated;
14766
    break;
14767
  case ARM::BI__builtin_arm_mve_vrndaq_x_f32:
14768
    Param0 = Intrinsic::arm_mve_vrinta_predicated;
14769
    break;
14770
  case ARM::BI__builtin_arm_mve_vrndmq_x_f32:
14771
    Param0 = Intrinsic::arm_mve_vrintm_predicated;
14772
    break;
14773
  case ARM::BI__builtin_arm_mve_vrndnq_x_f32:
14774
    Param0 = Intrinsic::arm_mve_vrintn_predicated;
14775
    break;
14776
  case ARM::BI__builtin_arm_mve_vrndpq_x_f32:
14777
    Param0 = Intrinsic::arm_mve_vrintp_predicated;
14778
    break;
14779
  case ARM::BI__builtin_arm_mve_vrndq_x_f32:
14780
    Param0 = Intrinsic::arm_mve_vrintz_predicated;
14781
    break;
14782
  case ARM::BI__builtin_arm_mve_vrndxq_x_f32:
14783
    Param0 = Intrinsic::arm_mve_vrintx_predicated;
14784
    break;
14785
  }
14786
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14787
  Value *Val1 = UndefValue::get(Val0);
14788
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14789
  Value *Val3 = EmitScalarExpr(E->getArg(1));
14790
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
14791
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4});
14792
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val5, Val1});
14793
}
14794
case ARM::BI__builtin_arm_mve_vbrsrq_x_n_f32: {
14795
  Intrinsic::ID  Param0;
14796
  switch (BuiltinID) {
14797
  case ARM::BI__builtin_arm_mve_vbrsrq_x_n_f32:
14798
    Param0 = Intrinsic::arm_mve_vbrsr_predicated;
14799
    break;
14800
  }
14801
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14802
  Value *Val1 = UndefValue::get(Val0);
14803
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14804
  Value *Val3 = EmitScalarExpr(E->getArg(1));
14805
  Value *Val4 = EmitScalarExpr(E->getArg(2));
14806
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
14807
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
14808
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1, Val2, Val3, Val6});
14809
}
14810
case ARM::BI__builtin_arm_mve_vaddq_x_f32:
14811
case ARM::BI__builtin_arm_mve_vmulq_x_f32:
14812
case ARM::BI__builtin_arm_mve_vsubq_x_f32: {
14813
  Intrinsic::ID  Param0;
14814
  switch (BuiltinID) {
14815
  case ARM::BI__builtin_arm_mve_vaddq_x_f32:
14816
    Param0 = Intrinsic::arm_mve_add_predicated;
14817
    break;
14818
  case ARM::BI__builtin_arm_mve_vmulq_x_f32:
14819
    Param0 = Intrinsic::arm_mve_mul_predicated;
14820
    break;
14821
  case ARM::BI__builtin_arm_mve_vsubq_x_f32:
14822
    Param0 = Intrinsic::arm_mve_sub_predicated;
14823
    break;
14824
  }
14825
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14826
  Value *Val1 = UndefValue::get(Val0);
14827
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14828
  Value *Val3 = EmitScalarExpr(E->getArg(1));
14829
  Value *Val4 = EmitScalarExpr(E->getArg(2));
14830
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
14831
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
14832
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val6, Val1});
14833
}
14834
case ARM::BI__builtin_arm_mve_vabdq_x_f32:
14835
case ARM::BI__builtin_arm_mve_vmaxnmq_x_f32:
14836
case ARM::BI__builtin_arm_mve_vminnmq_x_f32: {
14837
  Intrinsic::ID  Param0;
14838
  switch (BuiltinID) {
14839
  case ARM::BI__builtin_arm_mve_vabdq_x_f32:
14840
    Param0 = Intrinsic::arm_mve_abd_predicated;
14841
    break;
14842
  case ARM::BI__builtin_arm_mve_vmaxnmq_x_f32:
14843
    Param0 = Intrinsic::arm_mve_max_predicated;
14844
    break;
14845
  case ARM::BI__builtin_arm_mve_vminnmq_x_f32:
14846
    Param0 = Intrinsic::arm_mve_min_predicated;
14847
    break;
14848
  }
14849
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14850
  Value *Val1 = UndefValue::get(Val0);
14851
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14852
  Value *Val3 = EmitScalarExpr(E->getArg(1));
14853
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, 0);
14854
  Value *Val5 = EmitScalarExpr(E->getArg(2));
14855
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
14856
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
14857
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val4, Val7, Val1});
14858
}
14859
case ARM::BI__builtin_arm_mve_vrev64q_x_f32: {
14860
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14861
  Value *Val1 = UndefValue::get(Val0);
14862
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14863
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, 64);
14864
  Value *Val4 = EmitScalarExpr(E->getArg(1));
14865
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
14866
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
14867
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vrev_predicated, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val6, Val1});
14868
}
14869
case ARM::BI__builtin_arm_mve_vcvtq_x_f32_s32:
14870
case ARM::BI__builtin_arm_mve_vcvtq_x_f32_u32: {
14871
  uint32_t  Param0;
14872
  switch (BuiltinID) {
14873
  case ARM::BI__builtin_arm_mve_vcvtq_x_f32_s32:
14874
    Param0 = 0;
14875
    break;
14876
  case ARM::BI__builtin_arm_mve_vcvtq_x_f32_u32:
14877
    Param0 = 1;
14878
    break;
14879
  }
14880
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14881
  Value *Val1 = UndefValue::get(Val0);
14882
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14883
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
14884
  Value *Val4 = EmitScalarExpr(E->getArg(1));
14885
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
14886
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
14887
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fp_int_predicated, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val6, Val1});
14888
}
14889
case ARM::BI__builtin_arm_mve_vcvtbq_x_f32_f16:
14890
case ARM::BI__builtin_arm_mve_vcvttq_x_f32_f16: {
14891
  uint32_t  Param0;
14892
  switch (BuiltinID) {
14893
  case ARM::BI__builtin_arm_mve_vcvtbq_x_f32_f16:
14894
    Param0 = 0;
14895
    break;
14896
  case ARM::BI__builtin_arm_mve_vcvttq_x_f32_f16:
14897
    Param0 = 1;
14898
    break;
14899
  }
14900
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14901
  Value *Val1 = UndefValue::get(Val0);
14902
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14903
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
14904
  Value *Val4 = EmitScalarExpr(E->getArg(1));
14905
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
14906
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
14907
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_widen_predicated), {Val1, Val2, Val3, Val6});
14908
}
14909
case ARM::BI__builtin_arm_mve_vandq_x_f32:
14910
case ARM::BI__builtin_arm_mve_vbicq_x_f32:
14911
case ARM::BI__builtin_arm_mve_veorq_x_f32:
14912
case ARM::BI__builtin_arm_mve_vornq_x_f32:
14913
case ARM::BI__builtin_arm_mve_vorrq_x_f32: {
14914
  Intrinsic::ID  Param0;
14915
  switch (BuiltinID) {
14916
  case ARM::BI__builtin_arm_mve_vandq_x_f32:
14917
    Param0 = Intrinsic::arm_mve_and_predicated;
14918
    break;
14919
  case ARM::BI__builtin_arm_mve_vbicq_x_f32:
14920
    Param0 = Intrinsic::arm_mve_bic_predicated;
14921
    break;
14922
  case ARM::BI__builtin_arm_mve_veorq_x_f32:
14923
    Param0 = Intrinsic::arm_mve_eor_predicated;
14924
    break;
14925
  case ARM::BI__builtin_arm_mve_vornq_x_f32:
14926
    Param0 = Intrinsic::arm_mve_orn_predicated;
14927
    break;
14928
  case ARM::BI__builtin_arm_mve_vorrq_x_f32:
14929
    Param0 = Intrinsic::arm_mve_orr_predicated;
14930
    break;
14931
  }
14932
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14933
  Value *Val1 = UndefValue::get(Val0);
14934
  Value *Val2 = EmitScalarExpr(E->getArg(0));
14935
  llvm::Type *Val3 = llvm::FixedVectorType::get(Int32Ty, 4);
14936
  Value *Val4 = Builder.CreateBitCast(Val2, Val3);
14937
  Value *Val5 = EmitScalarExpr(E->getArg(1));
14938
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int32Ty, 4);
14939
  Value *Val7 = Builder.CreateBitCast(Val5, Val6);
14940
  Value *Val8 = EmitScalarExpr(E->getArg(2));
14941
  Value *Val9 = Builder.CreateIntCast(Val8, Int32Ty, false);
14942
  Value *Val10 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val9});
14943
  llvm::Type *Val11 = llvm::FixedVectorType::get(Int32Ty, 4);
14944
  Value *Val12 = Builder.CreateBitCast(Val1, Val11);
14945
  Value *Val13 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4, Val7, Val10, Val12});
14946
  llvm::Type *Val14 = llvm::FixedVectorType::get(FloatTy, 4);
14947
  return Builder.CreateBitCast(Val13, Val14);
14948
}
14949
case ARM::BI__builtin_arm_mve_vdupq_x_n_f32: {
14950
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14951
  Value *Val1 = UndefValue::get(Val0);
14952
  Value *Val2 = EmitScalarExpr(E->getArg(1));
14953
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
14954
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val3});
14955
  Value *Val5 = EmitScalarExpr(E->getArg(0));
14956
  Value *Val6 = ARMMVEVectorSplat(Builder, Val5);
14957
  return Builder.CreateSelect(Val4, Val6, Val1);
14958
}
14959
case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_f32:
14960
case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_f32: {
14961
  uint32_t  Param0;
14962
  switch (BuiltinID) {
14963
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_f32:
14964
    Param0 = 1;
14965
    break;
14966
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_f32:
14967
    Param0 = 0;
14968
    break;
14969
  }
14970
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
14971
  Value *Val1 = UndefValue::get(Val0);
14972
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 1);
14973
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
14974
  Value *Val4 = EmitScalarExpr(E->getArg(0));
14975
  Value *Val5 = EmitScalarExpr(E->getArg(1));
14976
  Value *Val6 = EmitScalarExpr(E->getArg(2));
14977
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
14978
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
14979
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcaddq_predicated, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val1, Val4, Val5, Val8});
14980
}
14981
case ARM::BI__builtin_arm_mve_vcmulq_rot180_x_f32:
14982
case ARM::BI__builtin_arm_mve_vcmulq_rot270_x_f32:
14983
case ARM::BI__builtin_arm_mve_vcmulq_rot90_x_f32:
14984
case ARM::BI__builtin_arm_mve_vcmulq_x_f32: {
14985
  uint32_t  Param0;
14986
  switch (BuiltinID) {
14987
  case ARM::BI__builtin_arm_mve_vcmulq_rot180_x_f32:
14988
    Param0 = 2;
14989
    break;
14990
  case ARM::BI__builtin_arm_mve_vcmulq_rot270_x_f32:
14991
    Param0 = 3;
14992
    break;
14993
  case ARM::BI__builtin_arm_mve_vcmulq_rot90_x_f32:
14994
    Param0 = 1;
14995
    break;
14996
  case ARM::BI__builtin_arm_mve_vcmulq_x_f32:
14997
    Param0 = 0;
14998
    break;
14999
  }
15000
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
15001
  Value *Val1 = UndefValue::get(Val0);
15002
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
15003
  Value *Val3 = EmitScalarExpr(E->getArg(0));
15004
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15005
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15006
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15007
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
15008
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcmulq_predicated, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val1, Val3, Val4, Val7});
15009
}
15010
case ARM::BI__builtin_arm_mve_vcvtq_x_n_f32_s32:
15011
case ARM::BI__builtin_arm_mve_vcvtq_x_n_f32_u32: {
15012
  uint32_t  Param0;
15013
  switch (BuiltinID) {
15014
  case ARM::BI__builtin_arm_mve_vcvtq_x_n_f32_s32:
15015
    Param0 = 0;
15016
    break;
15017
  case ARM::BI__builtin_arm_mve_vcvtq_x_n_f32_u32:
15018
    Param0 = 1;
15019
    break;
15020
  }
15021
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
15022
  Value *Val1 = UndefValue::get(Val0);
15023
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
15024
  Value *Val3 = EmitScalarExpr(E->getArg(0));
15025
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15026
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15027
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15028
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
15029
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fix_predicated, {llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val1, Val3, Val4, Val7});
15030
}
15031
case ARM::BI__builtin_arm_mve_vuninitializedq_f32:
15032
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_f32: {
15033
  llvm::Type *Val0 = llvm::FixedVectorType::get(FloatTy, 4);
15034
  return UndefValue::get(Val0);
15035
}
15036
case ARM::BI__builtin_arm_mve_vaddq_x_n_f16:
15037
case ARM::BI__builtin_arm_mve_vmulq_x_n_f16:
15038
case ARM::BI__builtin_arm_mve_vsubq_x_n_f16: {
15039
  Intrinsic::ID  Param0;
15040
  switch (BuiltinID) {
15041
  case ARM::BI__builtin_arm_mve_vaddq_x_n_f16:
15042
    Param0 = Intrinsic::arm_mve_add_predicated;
15043
    break;
15044
  case ARM::BI__builtin_arm_mve_vmulq_x_n_f16:
15045
    Param0 = Intrinsic::arm_mve_mul_predicated;
15046
    break;
15047
  case ARM::BI__builtin_arm_mve_vsubq_x_n_f16:
15048
    Param0 = Intrinsic::arm_mve_sub_predicated;
15049
    break;
15050
  }
15051
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15052
  Value *Val1 = UndefValue::get(Val0);
15053
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15054
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15055
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
15056
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15057
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15058
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15059
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val4, Val7, Val1});
15060
}
15061
case ARM::BI__builtin_arm_mve_vabsq_x_f16:
15062
case ARM::BI__builtin_arm_mve_vnegq_x_f16:
15063
case ARM::BI__builtin_arm_mve_vrndaq_x_f16:
15064
case ARM::BI__builtin_arm_mve_vrndmq_x_f16:
15065
case ARM::BI__builtin_arm_mve_vrndnq_x_f16:
15066
case ARM::BI__builtin_arm_mve_vrndpq_x_f16:
15067
case ARM::BI__builtin_arm_mve_vrndq_x_f16:
15068
case ARM::BI__builtin_arm_mve_vrndxq_x_f16: {
15069
  Intrinsic::ID  Param0;
15070
  switch (BuiltinID) {
15071
  case ARM::BI__builtin_arm_mve_vabsq_x_f16:
15072
    Param0 = Intrinsic::arm_mve_abs_predicated;
15073
    break;
15074
  case ARM::BI__builtin_arm_mve_vnegq_x_f16:
15075
    Param0 = Intrinsic::arm_mve_neg_predicated;
15076
    break;
15077
  case ARM::BI__builtin_arm_mve_vrndaq_x_f16:
15078
    Param0 = Intrinsic::arm_mve_vrinta_predicated;
15079
    break;
15080
  case ARM::BI__builtin_arm_mve_vrndmq_x_f16:
15081
    Param0 = Intrinsic::arm_mve_vrintm_predicated;
15082
    break;
15083
  case ARM::BI__builtin_arm_mve_vrndnq_x_f16:
15084
    Param0 = Intrinsic::arm_mve_vrintn_predicated;
15085
    break;
15086
  case ARM::BI__builtin_arm_mve_vrndpq_x_f16:
15087
    Param0 = Intrinsic::arm_mve_vrintp_predicated;
15088
    break;
15089
  case ARM::BI__builtin_arm_mve_vrndq_x_f16:
15090
    Param0 = Intrinsic::arm_mve_vrintz_predicated;
15091
    break;
15092
  case ARM::BI__builtin_arm_mve_vrndxq_x_f16:
15093
    Param0 = Intrinsic::arm_mve_vrintx_predicated;
15094
    break;
15095
  }
15096
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15097
  Value *Val1 = UndefValue::get(Val0);
15098
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15099
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15100
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
15101
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val4});
15102
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val5, Val1});
15103
}
15104
case ARM::BI__builtin_arm_mve_vbrsrq_x_n_f16: {
15105
  Intrinsic::ID  Param0;
15106
  switch (BuiltinID) {
15107
  case ARM::BI__builtin_arm_mve_vbrsrq_x_n_f16:
15108
    Param0 = Intrinsic::arm_mve_vbrsr_predicated;
15109
    break;
15110
  }
15111
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15112
  Value *Val1 = UndefValue::get(Val0);
15113
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15114
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15115
  Value *Val4 = EmitScalarExpr(E->getArg(2));
15116
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15117
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15118
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1, Val2, Val3, Val6});
15119
}
15120
case ARM::BI__builtin_arm_mve_vaddq_x_f16:
15121
case ARM::BI__builtin_arm_mve_vmulq_x_f16:
15122
case ARM::BI__builtin_arm_mve_vsubq_x_f16: {
15123
  Intrinsic::ID  Param0;
15124
  switch (BuiltinID) {
15125
  case ARM::BI__builtin_arm_mve_vaddq_x_f16:
15126
    Param0 = Intrinsic::arm_mve_add_predicated;
15127
    break;
15128
  case ARM::BI__builtin_arm_mve_vmulq_x_f16:
15129
    Param0 = Intrinsic::arm_mve_mul_predicated;
15130
    break;
15131
  case ARM::BI__builtin_arm_mve_vsubq_x_f16:
15132
    Param0 = Intrinsic::arm_mve_sub_predicated;
15133
    break;
15134
  }
15135
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15136
  Value *Val1 = UndefValue::get(Val0);
15137
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15138
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15139
  Value *Val4 = EmitScalarExpr(E->getArg(2));
15140
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15141
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15142
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val6, Val1});
15143
}
15144
case ARM::BI__builtin_arm_mve_vabdq_x_f16:
15145
case ARM::BI__builtin_arm_mve_vmaxnmq_x_f16:
15146
case ARM::BI__builtin_arm_mve_vminnmq_x_f16: {
15147
  Intrinsic::ID  Param0;
15148
  switch (BuiltinID) {
15149
  case ARM::BI__builtin_arm_mve_vabdq_x_f16:
15150
    Param0 = Intrinsic::arm_mve_abd_predicated;
15151
    break;
15152
  case ARM::BI__builtin_arm_mve_vmaxnmq_x_f16:
15153
    Param0 = Intrinsic::arm_mve_max_predicated;
15154
    break;
15155
  case ARM::BI__builtin_arm_mve_vminnmq_x_f16:
15156
    Param0 = Intrinsic::arm_mve_min_predicated;
15157
    break;
15158
  }
15159
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15160
  Value *Val1 = UndefValue::get(Val0);
15161
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15162
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15163
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, 0);
15164
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15165
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15166
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15167
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val4, Val7, Val1});
15168
}
15169
case ARM::BI__builtin_arm_mve_vcvtq_x_f16_s16:
15170
case ARM::BI__builtin_arm_mve_vcvtq_x_f16_u16: {
15171
  uint32_t  Param0;
15172
  switch (BuiltinID) {
15173
  case ARM::BI__builtin_arm_mve_vcvtq_x_f16_s16:
15174
    Param0 = 0;
15175
    break;
15176
  case ARM::BI__builtin_arm_mve_vcvtq_x_f16_u16:
15177
    Param0 = 1;
15178
    break;
15179
  }
15180
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15181
  Value *Val1 = UndefValue::get(Val0);
15182
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15183
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
15184
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15185
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15186
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15187
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fp_int_predicated, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val6, Val1});
15188
}
15189
case ARM::BI__builtin_arm_mve_vrev32q_x_f16:
15190
case ARM::BI__builtin_arm_mve_vrev64q_x_f16: {
15191
  uint32_t  Param0;
15192
  switch (BuiltinID) {
15193
  case ARM::BI__builtin_arm_mve_vrev32q_x_f16:
15194
    Param0 = 32;
15195
    break;
15196
  case ARM::BI__builtin_arm_mve_vrev64q_x_f16:
15197
    Param0 = 64;
15198
    break;
15199
  }
15200
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15201
  Value *Val1 = UndefValue::get(Val0);
15202
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15203
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
15204
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15205
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15206
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15207
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vrev_predicated, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val6, Val1});
15208
}
15209
case ARM::BI__builtin_arm_mve_vandq_x_f16:
15210
case ARM::BI__builtin_arm_mve_vbicq_x_f16:
15211
case ARM::BI__builtin_arm_mve_veorq_x_f16:
15212
case ARM::BI__builtin_arm_mve_vornq_x_f16:
15213
case ARM::BI__builtin_arm_mve_vorrq_x_f16: {
15214
  Intrinsic::ID  Param0;
15215
  switch (BuiltinID) {
15216
  case ARM::BI__builtin_arm_mve_vandq_x_f16:
15217
    Param0 = Intrinsic::arm_mve_and_predicated;
15218
    break;
15219
  case ARM::BI__builtin_arm_mve_vbicq_x_f16:
15220
    Param0 = Intrinsic::arm_mve_bic_predicated;
15221
    break;
15222
  case ARM::BI__builtin_arm_mve_veorq_x_f16:
15223
    Param0 = Intrinsic::arm_mve_eor_predicated;
15224
    break;
15225
  case ARM::BI__builtin_arm_mve_vornq_x_f16:
15226
    Param0 = Intrinsic::arm_mve_orn_predicated;
15227
    break;
15228
  case ARM::BI__builtin_arm_mve_vorrq_x_f16:
15229
    Param0 = Intrinsic::arm_mve_orr_predicated;
15230
    break;
15231
  }
15232
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15233
  Value *Val1 = UndefValue::get(Val0);
15234
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15235
  llvm::Type *Val3 = llvm::FixedVectorType::get(Int16Ty, 8);
15236
  Value *Val4 = Builder.CreateBitCast(Val2, Val3);
15237
  Value *Val5 = EmitScalarExpr(E->getArg(1));
15238
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int16Ty, 8);
15239
  Value *Val7 = Builder.CreateBitCast(Val5, Val6);
15240
  Value *Val8 = EmitScalarExpr(E->getArg(2));
15241
  Value *Val9 = Builder.CreateIntCast(Val8, Int32Ty, false);
15242
  Value *Val10 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val9});
15243
  llvm::Type *Val11 = llvm::FixedVectorType::get(Int16Ty, 8);
15244
  Value *Val12 = Builder.CreateBitCast(Val1, Val11);
15245
  Value *Val13 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val4, Val7, Val10, Val12});
15246
  llvm::Type *Val14 = llvm::FixedVectorType::get(HalfTy, 8);
15247
  return Builder.CreateBitCast(Val13, Val14);
15248
}
15249
case ARM::BI__builtin_arm_mve_vdupq_x_n_f16: {
15250
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15251
  Value *Val1 = UndefValue::get(Val0);
15252
  Value *Val2 = EmitScalarExpr(E->getArg(1));
15253
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
15254
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val3});
15255
  Value *Val5 = EmitScalarExpr(E->getArg(0));
15256
  Value *Val6 = ARMMVEVectorSplat(Builder, Val5);
15257
  return Builder.CreateSelect(Val4, Val6, Val1);
15258
}
15259
case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_f16:
15260
case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_f16: {
15261
  uint32_t  Param0;
15262
  switch (BuiltinID) {
15263
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_f16:
15264
    Param0 = 1;
15265
    break;
15266
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_f16:
15267
    Param0 = 0;
15268
    break;
15269
  }
15270
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15271
  Value *Val1 = UndefValue::get(Val0);
15272
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, 1);
15273
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
15274
  Value *Val4 = EmitScalarExpr(E->getArg(0));
15275
  Value *Val5 = EmitScalarExpr(E->getArg(1));
15276
  Value *Val6 = EmitScalarExpr(E->getArg(2));
15277
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
15278
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val7});
15279
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcaddq_predicated, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val1, Val4, Val5, Val8});
15280
}
15281
case ARM::BI__builtin_arm_mve_vcmulq_rot180_x_f16:
15282
case ARM::BI__builtin_arm_mve_vcmulq_rot270_x_f16:
15283
case ARM::BI__builtin_arm_mve_vcmulq_rot90_x_f16:
15284
case ARM::BI__builtin_arm_mve_vcmulq_x_f16: {
15285
  uint32_t  Param0;
15286
  switch (BuiltinID) {
15287
  case ARM::BI__builtin_arm_mve_vcmulq_rot180_x_f16:
15288
    Param0 = 2;
15289
    break;
15290
  case ARM::BI__builtin_arm_mve_vcmulq_rot270_x_f16:
15291
    Param0 = 3;
15292
    break;
15293
  case ARM::BI__builtin_arm_mve_vcmulq_rot90_x_f16:
15294
    Param0 = 1;
15295
    break;
15296
  case ARM::BI__builtin_arm_mve_vcmulq_x_f16:
15297
    Param0 = 0;
15298
    break;
15299
  }
15300
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15301
  Value *Val1 = UndefValue::get(Val0);
15302
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
15303
  Value *Val3 = EmitScalarExpr(E->getArg(0));
15304
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15305
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15306
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15307
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15308
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcmulq_predicated, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val1, Val3, Val4, Val7});
15309
}
15310
case ARM::BI__builtin_arm_mve_vcvtq_x_n_f16_s16:
15311
case ARM::BI__builtin_arm_mve_vcvtq_x_n_f16_u16: {
15312
  uint32_t  Param0;
15313
  switch (BuiltinID) {
15314
  case ARM::BI__builtin_arm_mve_vcvtq_x_n_f16_s16:
15315
    Param0 = 0;
15316
    break;
15317
  case ARM::BI__builtin_arm_mve_vcvtq_x_n_f16_u16:
15318
    Param0 = 1;
15319
    break;
15320
  }
15321
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15322
  Value *Val1 = UndefValue::get(Val0);
15323
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
15324
  Value *Val3 = EmitScalarExpr(E->getArg(0));
15325
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15326
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15327
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15328
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15329
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fix_predicated, {llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val1, Val3, Val4, Val7});
15330
}
15331
case ARM::BI__builtin_arm_mve_vuninitializedq_f16:
15332
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_f16: {
15333
  llvm::Type *Val0 = llvm::FixedVectorType::get(HalfTy, 8);
15334
  return UndefValue::get(Val0);
15335
}
15336
case ARM::BI__builtin_arm_mve_vddupq_x_wb_u16:
15337
case ARM::BI__builtin_arm_mve_vidupq_x_wb_u16: {
15338
  Intrinsic::ID  Param0;
15339
  switch (BuiltinID) {
15340
  case ARM::BI__builtin_arm_mve_vddupq_x_wb_u16:
15341
    Param0 = Intrinsic::arm_mve_vddup_predicated;
15342
    break;
15343
  case ARM::BI__builtin_arm_mve_vidupq_x_wb_u16:
15344
    Param0 = Intrinsic::arm_mve_vidup_predicated;
15345
    break;
15346
  }
15347
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15348
  Value *Val1 = UndefValue::get(Val0);
15349
  Address Val2 = EmitPointerWithAlignment(E->getArg(0));
15350
  Value *Val3 = Builder.CreateLoad(Val2);
15351
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15352
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15353
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15354
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15355
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1, Val3, Val4, Val7});
15356
  Value *Val9 = Builder.CreateExtractValue(Val8, static_cast<unsigned>(1));
15357
  Builder.CreateStore(Val9, Val2);
15358
  return Builder.CreateExtractValue(Val8, static_cast<unsigned>(0));
15359
}
15360
case ARM::BI__builtin_arm_mve_vdwdupq_x_wb_u16:
15361
case ARM::BI__builtin_arm_mve_viwdupq_x_wb_u16: {
15362
  Intrinsic::ID  Param0;
15363
  switch (BuiltinID) {
15364
  case ARM::BI__builtin_arm_mve_vdwdupq_x_wb_u16:
15365
    Param0 = Intrinsic::arm_mve_vdwdup_predicated;
15366
    break;
15367
  case ARM::BI__builtin_arm_mve_viwdupq_x_wb_u16:
15368
    Param0 = Intrinsic::arm_mve_viwdup_predicated;
15369
    break;
15370
  }
15371
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15372
  Value *Val1 = UndefValue::get(Val0);
15373
  Address Val2 = EmitPointerWithAlignment(E->getArg(0));
15374
  Value *Val3 = Builder.CreateLoad(Val2);
15375
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15376
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15377
  Value *Val6 = EmitScalarExpr(E->getArg(3));
15378
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
15379
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val7});
15380
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1, Val3, Val4, Val5, Val8});
15381
  Value *Val10 = Builder.CreateExtractValue(Val9, static_cast<unsigned>(1));
15382
  Builder.CreateStore(Val10, Val2);
15383
  return Builder.CreateExtractValue(Val9, static_cast<unsigned>(0));
15384
}
15385
case ARM::BI__builtin_arm_mve_vaddq_x_n_s16:
15386
case ARM::BI__builtin_arm_mve_vaddq_x_n_u16:
15387
case ARM::BI__builtin_arm_mve_vmulq_x_n_s16:
15388
case ARM::BI__builtin_arm_mve_vmulq_x_n_u16:
15389
case ARM::BI__builtin_arm_mve_vsubq_x_n_s16:
15390
case ARM::BI__builtin_arm_mve_vsubq_x_n_u16: {
15391
  Intrinsic::ID  Param0;
15392
  switch (BuiltinID) {
15393
  case ARM::BI__builtin_arm_mve_vaddq_x_n_s16:
15394
    Param0 = Intrinsic::arm_mve_add_predicated;
15395
    break;
15396
  case ARM::BI__builtin_arm_mve_vaddq_x_n_u16:
15397
    Param0 = Intrinsic::arm_mve_add_predicated;
15398
    break;
15399
  case ARM::BI__builtin_arm_mve_vmulq_x_n_s16:
15400
    Param0 = Intrinsic::arm_mve_mul_predicated;
15401
    break;
15402
  case ARM::BI__builtin_arm_mve_vmulq_x_n_u16:
15403
    Param0 = Intrinsic::arm_mve_mul_predicated;
15404
    break;
15405
  case ARM::BI__builtin_arm_mve_vsubq_x_n_s16:
15406
    Param0 = Intrinsic::arm_mve_sub_predicated;
15407
    break;
15408
  case ARM::BI__builtin_arm_mve_vsubq_x_n_u16:
15409
    Param0 = Intrinsic::arm_mve_sub_predicated;
15410
    break;
15411
  }
15412
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15413
  Value *Val1 = UndefValue::get(Val0);
15414
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15415
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15416
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
15417
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15418
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15419
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15420
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val4, Val7, Val1});
15421
}
15422
case ARM::BI__builtin_arm_mve_vhaddq_x_n_s16:
15423
case ARM::BI__builtin_arm_mve_vhaddq_x_n_u16:
15424
case ARM::BI__builtin_arm_mve_vhsubq_x_n_s16:
15425
case ARM::BI__builtin_arm_mve_vhsubq_x_n_u16: {
15426
  uint32_t  Param0;
15427
  Intrinsic::ID  Param1;
15428
  switch (BuiltinID) {
15429
  case ARM::BI__builtin_arm_mve_vhaddq_x_n_s16:
15430
    Param0 = 0;
15431
    Param1 = Intrinsic::arm_mve_hadd_predicated;
15432
    break;
15433
  case ARM::BI__builtin_arm_mve_vhaddq_x_n_u16:
15434
    Param0 = 1;
15435
    Param1 = Intrinsic::arm_mve_hadd_predicated;
15436
    break;
15437
  case ARM::BI__builtin_arm_mve_vhsubq_x_n_s16:
15438
    Param0 = 0;
15439
    Param1 = Intrinsic::arm_mve_hsub_predicated;
15440
    break;
15441
  case ARM::BI__builtin_arm_mve_vhsubq_x_n_u16:
15442
    Param0 = 1;
15443
    Param1 = Intrinsic::arm_mve_hsub_predicated;
15444
    break;
15445
  }
15446
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15447
  Value *Val1 = UndefValue::get(Val0);
15448
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15449
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15450
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
15451
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param0);
15452
  Value *Val6 = EmitScalarExpr(E->getArg(2));
15453
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
15454
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val7});
15455
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val4, Val5, Val8, Val1});
15456
}
15457
case ARM::BI__builtin_arm_mve_vabsq_x_s16:
15458
case ARM::BI__builtin_arm_mve_vclsq_x_s16:
15459
case ARM::BI__builtin_arm_mve_vclzq_x_s16:
15460
case ARM::BI__builtin_arm_mve_vclzq_x_u16:
15461
case ARM::BI__builtin_arm_mve_vmvnq_x_s16:
15462
case ARM::BI__builtin_arm_mve_vmvnq_x_u16:
15463
case ARM::BI__builtin_arm_mve_vnegq_x_s16: {
15464
  Intrinsic::ID  Param0;
15465
  switch (BuiltinID) {
15466
  case ARM::BI__builtin_arm_mve_vabsq_x_s16:
15467
    Param0 = Intrinsic::arm_mve_abs_predicated;
15468
    break;
15469
  case ARM::BI__builtin_arm_mve_vclsq_x_s16:
15470
    Param0 = Intrinsic::arm_mve_cls_predicated;
15471
    break;
15472
  case ARM::BI__builtin_arm_mve_vclzq_x_s16:
15473
    Param0 = Intrinsic::arm_mve_clz_predicated;
15474
    break;
15475
  case ARM::BI__builtin_arm_mve_vclzq_x_u16:
15476
    Param0 = Intrinsic::arm_mve_clz_predicated;
15477
    break;
15478
  case ARM::BI__builtin_arm_mve_vmvnq_x_s16:
15479
    Param0 = Intrinsic::arm_mve_mvn_predicated;
15480
    break;
15481
  case ARM::BI__builtin_arm_mve_vmvnq_x_u16:
15482
    Param0 = Intrinsic::arm_mve_mvn_predicated;
15483
    break;
15484
  case ARM::BI__builtin_arm_mve_vnegq_x_s16:
15485
    Param0 = Intrinsic::arm_mve_neg_predicated;
15486
    break;
15487
  }
15488
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15489
  Value *Val1 = UndefValue::get(Val0);
15490
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15491
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15492
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
15493
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val4});
15494
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val5, Val1});
15495
}
15496
case ARM::BI__builtin_arm_mve_vddupq_x_n_u16:
15497
case ARM::BI__builtin_arm_mve_vidupq_x_n_u16: {
15498
  Intrinsic::ID  Param0;
15499
  switch (BuiltinID) {
15500
  case ARM::BI__builtin_arm_mve_vddupq_x_n_u16:
15501
    Param0 = Intrinsic::arm_mve_vddup_predicated;
15502
    break;
15503
  case ARM::BI__builtin_arm_mve_vidupq_x_n_u16:
15504
    Param0 = Intrinsic::arm_mve_vidup_predicated;
15505
    break;
15506
  }
15507
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15508
  Value *Val1 = UndefValue::get(Val0);
15509
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15510
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15511
  Value *Val4 = EmitScalarExpr(E->getArg(2));
15512
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15513
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15514
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1, Val2, Val3, Val6});
15515
  return Builder.CreateExtractValue(Val7, static_cast<unsigned>(0));
15516
}
15517
case ARM::BI__builtin_arm_mve_vbrsrq_x_n_s16:
15518
case ARM::BI__builtin_arm_mve_vbrsrq_x_n_u16: {
15519
  Intrinsic::ID  Param0;
15520
  switch (BuiltinID) {
15521
  case ARM::BI__builtin_arm_mve_vbrsrq_x_n_s16:
15522
    Param0 = Intrinsic::arm_mve_vbrsr_predicated;
15523
    break;
15524
  case ARM::BI__builtin_arm_mve_vbrsrq_x_n_u16:
15525
    Param0 = Intrinsic::arm_mve_vbrsr_predicated;
15526
    break;
15527
  }
15528
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15529
  Value *Val1 = UndefValue::get(Val0);
15530
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15531
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15532
  Value *Val4 = EmitScalarExpr(E->getArg(2));
15533
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15534
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15535
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1, Val2, Val3, Val6});
15536
}
15537
case ARM::BI__builtin_arm_mve_vaddq_x_s16:
15538
case ARM::BI__builtin_arm_mve_vaddq_x_u16:
15539
case ARM::BI__builtin_arm_mve_vmulq_x_s16:
15540
case ARM::BI__builtin_arm_mve_vmulq_x_u16:
15541
case ARM::BI__builtin_arm_mve_vshlq_x_n_s16:
15542
case ARM::BI__builtin_arm_mve_vshlq_x_n_u16:
15543
case ARM::BI__builtin_arm_mve_vsubq_x_s16:
15544
case ARM::BI__builtin_arm_mve_vsubq_x_u16: {
15545
  Intrinsic::ID  Param0;
15546
  switch (BuiltinID) {
15547
  case ARM::BI__builtin_arm_mve_vaddq_x_s16:
15548
    Param0 = Intrinsic::arm_mve_add_predicated;
15549
    break;
15550
  case ARM::BI__builtin_arm_mve_vaddq_x_u16:
15551
    Param0 = Intrinsic::arm_mve_add_predicated;
15552
    break;
15553
  case ARM::BI__builtin_arm_mve_vmulq_x_s16:
15554
    Param0 = Intrinsic::arm_mve_mul_predicated;
15555
    break;
15556
  case ARM::BI__builtin_arm_mve_vmulq_x_u16:
15557
    Param0 = Intrinsic::arm_mve_mul_predicated;
15558
    break;
15559
  case ARM::BI__builtin_arm_mve_vshlq_x_n_s16:
15560
    Param0 = Intrinsic::arm_mve_shl_imm_predicated;
15561
    break;
15562
  case ARM::BI__builtin_arm_mve_vshlq_x_n_u16:
15563
    Param0 = Intrinsic::arm_mve_shl_imm_predicated;
15564
    break;
15565
  case ARM::BI__builtin_arm_mve_vsubq_x_s16:
15566
    Param0 = Intrinsic::arm_mve_sub_predicated;
15567
    break;
15568
  case ARM::BI__builtin_arm_mve_vsubq_x_u16:
15569
    Param0 = Intrinsic::arm_mve_sub_predicated;
15570
    break;
15571
  }
15572
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15573
  Value *Val1 = UndefValue::get(Val0);
15574
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15575
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15576
  Value *Val4 = EmitScalarExpr(E->getArg(2));
15577
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15578
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15579
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val6, Val1});
15580
}
15581
case ARM::BI__builtin_arm_mve_vdwdupq_x_n_u16:
15582
case ARM::BI__builtin_arm_mve_viwdupq_x_n_u16: {
15583
  Intrinsic::ID  Param0;
15584
  switch (BuiltinID) {
15585
  case ARM::BI__builtin_arm_mve_vdwdupq_x_n_u16:
15586
    Param0 = Intrinsic::arm_mve_vdwdup_predicated;
15587
    break;
15588
  case ARM::BI__builtin_arm_mve_viwdupq_x_n_u16:
15589
    Param0 = Intrinsic::arm_mve_viwdup_predicated;
15590
    break;
15591
  }
15592
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15593
  Value *Val1 = UndefValue::get(Val0);
15594
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15595
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15596
  Value *Val4 = EmitScalarExpr(E->getArg(2));
15597
  Value *Val5 = EmitScalarExpr(E->getArg(3));
15598
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15599
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15600
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val1, Val2, Val3, Val4, Val7});
15601
  return Builder.CreateExtractValue(Val8, static_cast<unsigned>(0));
15602
}
15603
case ARM::BI__builtin_arm_mve_vrshlq_x_s16:
15604
case ARM::BI__builtin_arm_mve_vrshlq_x_u16:
15605
case ARM::BI__builtin_arm_mve_vshlq_x_s16:
15606
case ARM::BI__builtin_arm_mve_vshlq_x_u16: {
15607
  uint32_t  Param0;
15608
  uint32_t  Param1;
15609
  switch (BuiltinID) {
15610
  case ARM::BI__builtin_arm_mve_vrshlq_x_s16:
15611
    Param0 = 1;
15612
    Param1 = 0;
15613
    break;
15614
  case ARM::BI__builtin_arm_mve_vrshlq_x_u16:
15615
    Param0 = 1;
15616
    Param1 = 1;
15617
    break;
15618
  case ARM::BI__builtin_arm_mve_vshlq_x_s16:
15619
    Param0 = 0;
15620
    Param1 = 0;
15621
    break;
15622
  case ARM::BI__builtin_arm_mve_vshlq_x_u16:
15623
    Param0 = 0;
15624
    Param1 = 1;
15625
    break;
15626
  }
15627
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15628
  Value *Val1 = UndefValue::get(Val0);
15629
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15630
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15631
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, 0);
15632
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param0);
15633
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param1);
15634
  Value *Val7 = EmitScalarExpr(E->getArg(2));
15635
  Value *Val8 = Builder.CreateIntCast(Val7, Int32Ty, false);
15636
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val8});
15637
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshl_vector_predicated, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val4, Val5, Val6, Val9, Val1});
15638
}
15639
case ARM::BI__builtin_arm_mve_vmullbq_poly_x_p8:
15640
case ARM::BI__builtin_arm_mve_vmulltq_poly_x_p8: {
15641
  uint32_t  Param0;
15642
  switch (BuiltinID) {
15643
  case ARM::BI__builtin_arm_mve_vmullbq_poly_x_p8:
15644
    Param0 = 0;
15645
    break;
15646
  case ARM::BI__builtin_arm_mve_vmulltq_poly_x_p8:
15647
    Param0 = 1;
15648
    break;
15649
  }
15650
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15651
  Value *Val1 = UndefValue::get(Val0);
15652
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15653
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15654
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
15655
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15656
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15657
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15658
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_mull_poly_predicated, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val4, Val7, Val1});
15659
}
15660
case ARM::BI__builtin_arm_mve_vabdq_x_s16:
15661
case ARM::BI__builtin_arm_mve_vabdq_x_u16:
15662
case ARM::BI__builtin_arm_mve_vhaddq_x_s16:
15663
case ARM::BI__builtin_arm_mve_vhaddq_x_u16:
15664
case ARM::BI__builtin_arm_mve_vhsubq_x_s16:
15665
case ARM::BI__builtin_arm_mve_vhsubq_x_u16:
15666
case ARM::BI__builtin_arm_mve_vmaxq_x_s16:
15667
case ARM::BI__builtin_arm_mve_vmaxq_x_u16:
15668
case ARM::BI__builtin_arm_mve_vminq_x_s16:
15669
case ARM::BI__builtin_arm_mve_vminq_x_u16:
15670
case ARM::BI__builtin_arm_mve_vmulhq_x_s16:
15671
case ARM::BI__builtin_arm_mve_vmulhq_x_u16:
15672
case ARM::BI__builtin_arm_mve_vrhaddq_x_s16:
15673
case ARM::BI__builtin_arm_mve_vrhaddq_x_u16:
15674
case ARM::BI__builtin_arm_mve_vrmulhq_x_s16:
15675
case ARM::BI__builtin_arm_mve_vrmulhq_x_u16:
15676
case ARM::BI__builtin_arm_mve_vrshrq_x_n_s16:
15677
case ARM::BI__builtin_arm_mve_vrshrq_x_n_u16:
15678
case ARM::BI__builtin_arm_mve_vshrq_x_n_s16:
15679
case ARM::BI__builtin_arm_mve_vshrq_x_n_u16: {
15680
  uint32_t  Param0;
15681
  Intrinsic::ID  Param1;
15682
  switch (BuiltinID) {
15683
  case ARM::BI__builtin_arm_mve_vabdq_x_s16:
15684
    Param0 = 0;
15685
    Param1 = Intrinsic::arm_mve_abd_predicated;
15686
    break;
15687
  case ARM::BI__builtin_arm_mve_vabdq_x_u16:
15688
    Param0 = 1;
15689
    Param1 = Intrinsic::arm_mve_abd_predicated;
15690
    break;
15691
  case ARM::BI__builtin_arm_mve_vhaddq_x_s16:
15692
    Param0 = 0;
15693
    Param1 = Intrinsic::arm_mve_hadd_predicated;
15694
    break;
15695
  case ARM::BI__builtin_arm_mve_vhaddq_x_u16:
15696
    Param0 = 1;
15697
    Param1 = Intrinsic::arm_mve_hadd_predicated;
15698
    break;
15699
  case ARM::BI__builtin_arm_mve_vhsubq_x_s16:
15700
    Param0 = 0;
15701
    Param1 = Intrinsic::arm_mve_hsub_predicated;
15702
    break;
15703
  case ARM::BI__builtin_arm_mve_vhsubq_x_u16:
15704
    Param0 = 1;
15705
    Param1 = Intrinsic::arm_mve_hsub_predicated;
15706
    break;
15707
  case ARM::BI__builtin_arm_mve_vmaxq_x_s16:
15708
    Param0 = 0;
15709
    Param1 = Intrinsic::arm_mve_max_predicated;
15710
    break;
15711
  case ARM::BI__builtin_arm_mve_vmaxq_x_u16:
15712
    Param0 = 1;
15713
    Param1 = Intrinsic::arm_mve_max_predicated;
15714
    break;
15715
  case ARM::BI__builtin_arm_mve_vminq_x_s16:
15716
    Param0 = 0;
15717
    Param1 = Intrinsic::arm_mve_min_predicated;
15718
    break;
15719
  case ARM::BI__builtin_arm_mve_vminq_x_u16:
15720
    Param0 = 1;
15721
    Param1 = Intrinsic::arm_mve_min_predicated;
15722
    break;
15723
  case ARM::BI__builtin_arm_mve_vmulhq_x_s16:
15724
    Param0 = 0;
15725
    Param1 = Intrinsic::arm_mve_mulh_predicated;
15726
    break;
15727
  case ARM::BI__builtin_arm_mve_vmulhq_x_u16:
15728
    Param0 = 1;
15729
    Param1 = Intrinsic::arm_mve_mulh_predicated;
15730
    break;
15731
  case ARM::BI__builtin_arm_mve_vrhaddq_x_s16:
15732
    Param0 = 0;
15733
    Param1 = Intrinsic::arm_mve_rhadd_predicated;
15734
    break;
15735
  case ARM::BI__builtin_arm_mve_vrhaddq_x_u16:
15736
    Param0 = 1;
15737
    Param1 = Intrinsic::arm_mve_rhadd_predicated;
15738
    break;
15739
  case ARM::BI__builtin_arm_mve_vrmulhq_x_s16:
15740
    Param0 = 0;
15741
    Param1 = Intrinsic::arm_mve_rmulh_predicated;
15742
    break;
15743
  case ARM::BI__builtin_arm_mve_vrmulhq_x_u16:
15744
    Param0 = 1;
15745
    Param1 = Intrinsic::arm_mve_rmulh_predicated;
15746
    break;
15747
  case ARM::BI__builtin_arm_mve_vrshrq_x_n_s16:
15748
    Param0 = 0;
15749
    Param1 = Intrinsic::arm_mve_vrshr_imm_predicated;
15750
    break;
15751
  case ARM::BI__builtin_arm_mve_vrshrq_x_n_u16:
15752
    Param0 = 1;
15753
    Param1 = Intrinsic::arm_mve_vrshr_imm_predicated;
15754
    break;
15755
  case ARM::BI__builtin_arm_mve_vshrq_x_n_s16:
15756
    Param0 = 0;
15757
    Param1 = Intrinsic::arm_mve_shr_imm_predicated;
15758
    break;
15759
  case ARM::BI__builtin_arm_mve_vshrq_x_n_u16:
15760
    Param0 = 1;
15761
    Param1 = Intrinsic::arm_mve_shr_imm_predicated;
15762
    break;
15763
  }
15764
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15765
  Value *Val1 = UndefValue::get(Val0);
15766
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15767
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15768
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
15769
  Value *Val5 = EmitScalarExpr(E->getArg(2));
15770
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15771
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15772
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val4, Val7, Val1});
15773
}
15774
case ARM::BI__builtin_arm_mve_vmullbq_int_x_s8:
15775
case ARM::BI__builtin_arm_mve_vmullbq_int_x_u8:
15776
case ARM::BI__builtin_arm_mve_vmulltq_int_x_s8:
15777
case ARM::BI__builtin_arm_mve_vmulltq_int_x_u8:
15778
case ARM::BI__builtin_arm_mve_vshllbq_x_n_s8:
15779
case ARM::BI__builtin_arm_mve_vshllbq_x_n_u8:
15780
case ARM::BI__builtin_arm_mve_vshlltq_x_n_s8:
15781
case ARM::BI__builtin_arm_mve_vshlltq_x_n_u8: {
15782
  uint32_t  Param0;
15783
  uint32_t  Param1;
15784
  Intrinsic::ID  Param2;
15785
  switch (BuiltinID) {
15786
  case ARM::BI__builtin_arm_mve_vmullbq_int_x_s8:
15787
    Param0 = 0;
15788
    Param1 = 0;
15789
    Param2 = Intrinsic::arm_mve_mull_int_predicated;
15790
    break;
15791
  case ARM::BI__builtin_arm_mve_vmullbq_int_x_u8:
15792
    Param0 = 1;
15793
    Param1 = 0;
15794
    Param2 = Intrinsic::arm_mve_mull_int_predicated;
15795
    break;
15796
  case ARM::BI__builtin_arm_mve_vmulltq_int_x_s8:
15797
    Param0 = 0;
15798
    Param1 = 1;
15799
    Param2 = Intrinsic::arm_mve_mull_int_predicated;
15800
    break;
15801
  case ARM::BI__builtin_arm_mve_vmulltq_int_x_u8:
15802
    Param0 = 1;
15803
    Param1 = 1;
15804
    Param2 = Intrinsic::arm_mve_mull_int_predicated;
15805
    break;
15806
  case ARM::BI__builtin_arm_mve_vshllbq_x_n_s8:
15807
    Param0 = 0;
15808
    Param1 = 0;
15809
    Param2 = Intrinsic::arm_mve_vshll_imm_predicated;
15810
    break;
15811
  case ARM::BI__builtin_arm_mve_vshllbq_x_n_u8:
15812
    Param0 = 1;
15813
    Param1 = 0;
15814
    Param2 = Intrinsic::arm_mve_vshll_imm_predicated;
15815
    break;
15816
  case ARM::BI__builtin_arm_mve_vshlltq_x_n_s8:
15817
    Param0 = 0;
15818
    Param1 = 1;
15819
    Param2 = Intrinsic::arm_mve_vshll_imm_predicated;
15820
    break;
15821
  case ARM::BI__builtin_arm_mve_vshlltq_x_n_u8:
15822
    Param0 = 1;
15823
    Param1 = 1;
15824
    Param2 = Intrinsic::arm_mve_vshll_imm_predicated;
15825
    break;
15826
  }
15827
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15828
  Value *Val1 = UndefValue::get(Val0);
15829
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15830
  Value *Val3 = EmitScalarExpr(E->getArg(1));
15831
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
15832
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param1);
15833
  Value *Val6 = EmitScalarExpr(E->getArg(2));
15834
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
15835
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val7});
15836
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val4, Val5, Val8, Val1});
15837
}
15838
case ARM::BI__builtin_arm_mve_vcvtq_x_s16_f16:
15839
case ARM::BI__builtin_arm_mve_vcvtq_x_u16_f16: {
15840
  uint32_t  Param0;
15841
  switch (BuiltinID) {
15842
  case ARM::BI__builtin_arm_mve_vcvtq_x_s16_f16:
15843
    Param0 = 0;
15844
    break;
15845
  case ARM::BI__builtin_arm_mve_vcvtq_x_u16_f16:
15846
    Param0 = 1;
15847
    break;
15848
  }
15849
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15850
  Value *Val1 = UndefValue::get(Val0);
15851
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15852
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
15853
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15854
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15855
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15856
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fp_int_predicated, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val6, Val1});
15857
}
15858
case ARM::BI__builtin_arm_mve_vrev32q_x_s16:
15859
case ARM::BI__builtin_arm_mve_vrev32q_x_u16:
15860
case ARM::BI__builtin_arm_mve_vrev64q_x_s16:
15861
case ARM::BI__builtin_arm_mve_vrev64q_x_u16: {
15862
  uint32_t  Param0;
15863
  switch (BuiltinID) {
15864
  case ARM::BI__builtin_arm_mve_vrev32q_x_s16:
15865
    Param0 = 32;
15866
    break;
15867
  case ARM::BI__builtin_arm_mve_vrev32q_x_u16:
15868
    Param0 = 32;
15869
    break;
15870
  case ARM::BI__builtin_arm_mve_vrev64q_x_s16:
15871
    Param0 = 64;
15872
    break;
15873
  case ARM::BI__builtin_arm_mve_vrev64q_x_u16:
15874
    Param0 = 64;
15875
    break;
15876
  }
15877
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15878
  Value *Val1 = UndefValue::get(Val0);
15879
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15880
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
15881
  Value *Val4 = EmitScalarExpr(E->getArg(1));
15882
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
15883
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
15884
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vrev_predicated, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val6, Val1});
15885
}
15886
case ARM::BI__builtin_arm_mve_vmovlbq_x_s8:
15887
case ARM::BI__builtin_arm_mve_vmovlbq_x_u8:
15888
case ARM::BI__builtin_arm_mve_vmovltq_x_s8:
15889
case ARM::BI__builtin_arm_mve_vmovltq_x_u8: {
15890
  uint32_t  Param0;
15891
  uint32_t  Param1;
15892
  switch (BuiltinID) {
15893
  case ARM::BI__builtin_arm_mve_vmovlbq_x_s8:
15894
    Param0 = 0;
15895
    Param1 = 0;
15896
    break;
15897
  case ARM::BI__builtin_arm_mve_vmovlbq_x_u8:
15898
    Param0 = 1;
15899
    Param1 = 0;
15900
    break;
15901
  case ARM::BI__builtin_arm_mve_vmovltq_x_s8:
15902
    Param0 = 0;
15903
    Param1 = 1;
15904
    break;
15905
  case ARM::BI__builtin_arm_mve_vmovltq_x_u8:
15906
    Param0 = 1;
15907
    Param1 = 1;
15908
    break;
15909
  }
15910
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15911
  Value *Val1 = UndefValue::get(Val0);
15912
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15913
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
15914
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param1);
15915
  Value *Val5 = EmitScalarExpr(E->getArg(1));
15916
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
15917
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
15918
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vmovl_predicated, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val4, Val7, Val1});
15919
}
15920
case ARM::BI__builtin_arm_mve_vandq_x_s16:
15921
case ARM::BI__builtin_arm_mve_vandq_x_u16:
15922
case ARM::BI__builtin_arm_mve_vbicq_x_s16:
15923
case ARM::BI__builtin_arm_mve_vbicq_x_u16:
15924
case ARM::BI__builtin_arm_mve_veorq_x_s16:
15925
case ARM::BI__builtin_arm_mve_veorq_x_u16:
15926
case ARM::BI__builtin_arm_mve_vornq_x_s16:
15927
case ARM::BI__builtin_arm_mve_vornq_x_u16:
15928
case ARM::BI__builtin_arm_mve_vorrq_x_s16:
15929
case ARM::BI__builtin_arm_mve_vorrq_x_u16: {
15930
  Intrinsic::ID  Param0;
15931
  switch (BuiltinID) {
15932
  case ARM::BI__builtin_arm_mve_vandq_x_s16:
15933
    Param0 = Intrinsic::arm_mve_and_predicated;
15934
    break;
15935
  case ARM::BI__builtin_arm_mve_vandq_x_u16:
15936
    Param0 = Intrinsic::arm_mve_and_predicated;
15937
    break;
15938
  case ARM::BI__builtin_arm_mve_vbicq_x_s16:
15939
    Param0 = Intrinsic::arm_mve_bic_predicated;
15940
    break;
15941
  case ARM::BI__builtin_arm_mve_vbicq_x_u16:
15942
    Param0 = Intrinsic::arm_mve_bic_predicated;
15943
    break;
15944
  case ARM::BI__builtin_arm_mve_veorq_x_s16:
15945
    Param0 = Intrinsic::arm_mve_eor_predicated;
15946
    break;
15947
  case ARM::BI__builtin_arm_mve_veorq_x_u16:
15948
    Param0 = Intrinsic::arm_mve_eor_predicated;
15949
    break;
15950
  case ARM::BI__builtin_arm_mve_vornq_x_s16:
15951
    Param0 = Intrinsic::arm_mve_orn_predicated;
15952
    break;
15953
  case ARM::BI__builtin_arm_mve_vornq_x_u16:
15954
    Param0 = Intrinsic::arm_mve_orn_predicated;
15955
    break;
15956
  case ARM::BI__builtin_arm_mve_vorrq_x_s16:
15957
    Param0 = Intrinsic::arm_mve_orr_predicated;
15958
    break;
15959
  case ARM::BI__builtin_arm_mve_vorrq_x_u16:
15960
    Param0 = Intrinsic::arm_mve_orr_predicated;
15961
    break;
15962
  }
15963
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15964
  Value *Val1 = UndefValue::get(Val0);
15965
  Value *Val2 = EmitScalarExpr(E->getArg(0));
15966
  llvm::Type *Val3 = llvm::FixedVectorType::get(Int16Ty, 8);
15967
  Value *Val4 = Builder.CreateBitCast(Val2, Val3);
15968
  Value *Val5 = EmitScalarExpr(E->getArg(1));
15969
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int16Ty, 8);
15970
  Value *Val7 = Builder.CreateBitCast(Val5, Val6);
15971
  Value *Val8 = EmitScalarExpr(E->getArg(2));
15972
  Value *Val9 = Builder.CreateIntCast(Val8, Int32Ty, false);
15973
  Value *Val10 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val9});
15974
  llvm::Type *Val11 = llvm::FixedVectorType::get(Int16Ty, 8);
15975
  Value *Val12 = Builder.CreateBitCast(Val1, Val11);
15976
  Value *Val13 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val4, Val7, Val10, Val12});
15977
  llvm::Type *Val14 = llvm::FixedVectorType::get(Int16Ty, 8);
15978
  return Builder.CreateBitCast(Val13, Val14);
15979
}
15980
case ARM::BI__builtin_arm_mve_vdupq_x_n_s16:
15981
case ARM::BI__builtin_arm_mve_vdupq_x_n_u16: {
15982
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
15983
  Value *Val1 = UndefValue::get(Val0);
15984
  Value *Val2 = EmitScalarExpr(E->getArg(1));
15985
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
15986
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val3});
15987
  Value *Val5 = EmitScalarExpr(E->getArg(0));
15988
  Value *Val6 = ARMMVEVectorSplat(Builder, Val5);
15989
  return Builder.CreateSelect(Val4, Val6, Val1);
15990
}
15991
case ARM::BI__builtin_arm_mve_vmvnq_x_n_s16:
15992
case ARM::BI__builtin_arm_mve_vmvnq_x_n_u16: {
15993
  bool  Param0;
15994
  switch (BuiltinID) {
15995
  case ARM::BI__builtin_arm_mve_vmvnq_x_n_s16:
15996
    Param0 = true;
15997
    break;
15998
  case ARM::BI__builtin_arm_mve_vmvnq_x_n_u16:
15999
    Param0 = false;
16000
    break;
16001
  }
16002
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
16003
  Value *Val1 = UndefValue::get(Val0);
16004
  Value *Val2 = EmitScalarExpr(E->getArg(1));
16005
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
16006
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val3});
16007
  Value *Val5 = EmitScalarExpr(E->getArg(0));
16008
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16009
  Value *Val7 = Builder.CreateIntCast(Val6, Int16Ty, Param0);
16010
  Value *Val8 = ARMMVEVectorSplat(Builder, Val7);
16011
  Value *Val9 = Builder.CreateNot(Val8);
16012
  return Builder.CreateSelect(Val4, Val9, Val1);
16013
}
16014
case ARM::BI__builtin_arm_mve_vcvtaq_x_s16_f16:
16015
case ARM::BI__builtin_arm_mve_vcvtaq_x_u16_f16:
16016
case ARM::BI__builtin_arm_mve_vcvtmq_x_s16_f16:
16017
case ARM::BI__builtin_arm_mve_vcvtmq_x_u16_f16:
16018
case ARM::BI__builtin_arm_mve_vcvtnq_x_s16_f16:
16019
case ARM::BI__builtin_arm_mve_vcvtnq_x_u16_f16:
16020
case ARM::BI__builtin_arm_mve_vcvtpq_x_s16_f16:
16021
case ARM::BI__builtin_arm_mve_vcvtpq_x_u16_f16: {
16022
  uint32_t  Param0;
16023
  Intrinsic::ID  Param1;
16024
  switch (BuiltinID) {
16025
  case ARM::BI__builtin_arm_mve_vcvtaq_x_s16_f16:
16026
    Param0 = 0;
16027
    Param1 = Intrinsic::arm_mve_vcvta_predicated;
16028
    break;
16029
  case ARM::BI__builtin_arm_mve_vcvtaq_x_u16_f16:
16030
    Param0 = 1;
16031
    Param1 = Intrinsic::arm_mve_vcvta_predicated;
16032
    break;
16033
  case ARM::BI__builtin_arm_mve_vcvtmq_x_s16_f16:
16034
    Param0 = 0;
16035
    Param1 = Intrinsic::arm_mve_vcvtm_predicated;
16036
    break;
16037
  case ARM::BI__builtin_arm_mve_vcvtmq_x_u16_f16:
16038
    Param0 = 1;
16039
    Param1 = Intrinsic::arm_mve_vcvtm_predicated;
16040
    break;
16041
  case ARM::BI__builtin_arm_mve_vcvtnq_x_s16_f16:
16042
    Param0 = 0;
16043
    Param1 = Intrinsic::arm_mve_vcvtn_predicated;
16044
    break;
16045
  case ARM::BI__builtin_arm_mve_vcvtnq_x_u16_f16:
16046
    Param0 = 1;
16047
    Param1 = Intrinsic::arm_mve_vcvtn_predicated;
16048
    break;
16049
  case ARM::BI__builtin_arm_mve_vcvtpq_x_s16_f16:
16050
    Param0 = 0;
16051
    Param1 = Intrinsic::arm_mve_vcvtp_predicated;
16052
    break;
16053
  case ARM::BI__builtin_arm_mve_vcvtpq_x_u16_f16:
16054
    Param0 = 1;
16055
    Param1 = Intrinsic::arm_mve_vcvtp_predicated;
16056
    break;
16057
  }
16058
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
16059
  Value *Val1 = UndefValue::get(Val0);
16060
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
16061
  Value *Val3 = EmitScalarExpr(E->getArg(0));
16062
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16063
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
16064
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val5});
16065
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val1, Val3, Val6});
16066
}
16067
case ARM::BI__builtin_arm_mve_vcvtq_x_n_s16_f16:
16068
case ARM::BI__builtin_arm_mve_vcvtq_x_n_u16_f16: {
16069
  uint32_t  Param0;
16070
  switch (BuiltinID) {
16071
  case ARM::BI__builtin_arm_mve_vcvtq_x_n_s16_f16:
16072
    Param0 = 0;
16073
    break;
16074
  case ARM::BI__builtin_arm_mve_vcvtq_x_n_u16_f16:
16075
    Param0 = 1;
16076
    break;
16077
  }
16078
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
16079
  Value *Val1 = UndefValue::get(Val0);
16080
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
16081
  Value *Val3 = EmitScalarExpr(E->getArg(0));
16082
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16083
  Value *Val5 = EmitScalarExpr(E->getArg(2));
16084
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16085
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val6});
16086
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fix_predicated, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(HalfTy, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val1, Val3, Val4, Val7});
16087
}
16088
case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_s16:
16089
case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_u16:
16090
case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_s16:
16091
case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_u16:
16092
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_x_s16:
16093
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_x_s16: {
16094
  uint32_t  Param0;
16095
  uint32_t  Param1;
16096
  switch (BuiltinID) {
16097
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_s16:
16098
    Param0 = 1;
16099
    Param1 = 1;
16100
    break;
16101
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_u16:
16102
    Param0 = 1;
16103
    Param1 = 1;
16104
    break;
16105
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_s16:
16106
    Param0 = 1;
16107
    Param1 = 0;
16108
    break;
16109
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_u16:
16110
    Param0 = 1;
16111
    Param1 = 0;
16112
    break;
16113
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_x_s16:
16114
    Param0 = 0;
16115
    Param1 = 1;
16116
    break;
16117
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_x_s16:
16118
    Param0 = 0;
16119
    Param1 = 0;
16120
    break;
16121
  }
16122
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
16123
  Value *Val1 = UndefValue::get(Val0);
16124
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
16125
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
16126
  Value *Val4 = EmitScalarExpr(E->getArg(0));
16127
  Value *Val5 = EmitScalarExpr(E->getArg(1));
16128
  Value *Val6 = EmitScalarExpr(E->getArg(2));
16129
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
16130
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val7});
16131
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcaddq_predicated, {llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 8)}), {Val2, Val3, Val1, Val4, Val5, Val8});
16132
}
16133
case ARM::BI__builtin_arm_mve_vnegq_s16: {
16134
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
16135
  Value *Val1 = llvm::Constant::getNullValue(Val0);
16136
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16137
  return Builder.CreateSub(Val1, Val2);
16138
}
16139
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_s16:
16140
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_u16:
16141
case ARM::BI__builtin_arm_mve_vuninitializedq_s16:
16142
case ARM::BI__builtin_arm_mve_vuninitializedq_u16: {
16143
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int16Ty, 8);
16144
  return UndefValue::get(Val0);
16145
}
16146
case ARM::BI__builtin_arm_mve_vddupq_x_wb_u32:
16147
case ARM::BI__builtin_arm_mve_vidupq_x_wb_u32: {
16148
  Intrinsic::ID  Param0;
16149
  switch (BuiltinID) {
16150
  case ARM::BI__builtin_arm_mve_vddupq_x_wb_u32:
16151
    Param0 = Intrinsic::arm_mve_vddup_predicated;
16152
    break;
16153
  case ARM::BI__builtin_arm_mve_vidupq_x_wb_u32:
16154
    Param0 = Intrinsic::arm_mve_vidup_predicated;
16155
    break;
16156
  }
16157
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16158
  Value *Val1 = UndefValue::get(Val0);
16159
  Address Val2 = EmitPointerWithAlignment(E->getArg(0));
16160
  Value *Val3 = Builder.CreateLoad(Val2);
16161
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16162
  Value *Val5 = EmitScalarExpr(E->getArg(2));
16163
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16164
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
16165
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1, Val3, Val4, Val7});
16166
  Value *Val9 = Builder.CreateExtractValue(Val8, static_cast<unsigned>(1));
16167
  Builder.CreateStore(Val9, Val2);
16168
  return Builder.CreateExtractValue(Val8, static_cast<unsigned>(0));
16169
}
16170
case ARM::BI__builtin_arm_mve_vdwdupq_x_wb_u32:
16171
case ARM::BI__builtin_arm_mve_viwdupq_x_wb_u32: {
16172
  Intrinsic::ID  Param0;
16173
  switch (BuiltinID) {
16174
  case ARM::BI__builtin_arm_mve_vdwdupq_x_wb_u32:
16175
    Param0 = Intrinsic::arm_mve_vdwdup_predicated;
16176
    break;
16177
  case ARM::BI__builtin_arm_mve_viwdupq_x_wb_u32:
16178
    Param0 = Intrinsic::arm_mve_viwdup_predicated;
16179
    break;
16180
  }
16181
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16182
  Value *Val1 = UndefValue::get(Val0);
16183
  Address Val2 = EmitPointerWithAlignment(E->getArg(0));
16184
  Value *Val3 = Builder.CreateLoad(Val2);
16185
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16186
  Value *Val5 = EmitScalarExpr(E->getArg(2));
16187
  Value *Val6 = EmitScalarExpr(E->getArg(3));
16188
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
16189
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
16190
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1, Val3, Val4, Val5, Val8});
16191
  Value *Val10 = Builder.CreateExtractValue(Val9, static_cast<unsigned>(1));
16192
  Builder.CreateStore(Val10, Val2);
16193
  return Builder.CreateExtractValue(Val9, static_cast<unsigned>(0));
16194
}
16195
case ARM::BI__builtin_arm_mve_vaddq_x_n_s32:
16196
case ARM::BI__builtin_arm_mve_vaddq_x_n_u32:
16197
case ARM::BI__builtin_arm_mve_vmulq_x_n_s32:
16198
case ARM::BI__builtin_arm_mve_vmulq_x_n_u32:
16199
case ARM::BI__builtin_arm_mve_vsubq_x_n_s32:
16200
case ARM::BI__builtin_arm_mve_vsubq_x_n_u32: {
16201
  Intrinsic::ID  Param0;
16202
  switch (BuiltinID) {
16203
  case ARM::BI__builtin_arm_mve_vaddq_x_n_s32:
16204
    Param0 = Intrinsic::arm_mve_add_predicated;
16205
    break;
16206
  case ARM::BI__builtin_arm_mve_vaddq_x_n_u32:
16207
    Param0 = Intrinsic::arm_mve_add_predicated;
16208
    break;
16209
  case ARM::BI__builtin_arm_mve_vmulq_x_n_s32:
16210
    Param0 = Intrinsic::arm_mve_mul_predicated;
16211
    break;
16212
  case ARM::BI__builtin_arm_mve_vmulq_x_n_u32:
16213
    Param0 = Intrinsic::arm_mve_mul_predicated;
16214
    break;
16215
  case ARM::BI__builtin_arm_mve_vsubq_x_n_s32:
16216
    Param0 = Intrinsic::arm_mve_sub_predicated;
16217
    break;
16218
  case ARM::BI__builtin_arm_mve_vsubq_x_n_u32:
16219
    Param0 = Intrinsic::arm_mve_sub_predicated;
16220
    break;
16221
  }
16222
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16223
  Value *Val1 = UndefValue::get(Val0);
16224
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16225
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16226
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
16227
  Value *Val5 = EmitScalarExpr(E->getArg(2));
16228
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16229
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
16230
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val4, Val7, Val1});
16231
}
16232
case ARM::BI__builtin_arm_mve_vhaddq_x_n_s32:
16233
case ARM::BI__builtin_arm_mve_vhaddq_x_n_u32:
16234
case ARM::BI__builtin_arm_mve_vhsubq_x_n_s32:
16235
case ARM::BI__builtin_arm_mve_vhsubq_x_n_u32: {
16236
  uint32_t  Param0;
16237
  Intrinsic::ID  Param1;
16238
  switch (BuiltinID) {
16239
  case ARM::BI__builtin_arm_mve_vhaddq_x_n_s32:
16240
    Param0 = 0;
16241
    Param1 = Intrinsic::arm_mve_hadd_predicated;
16242
    break;
16243
  case ARM::BI__builtin_arm_mve_vhaddq_x_n_u32:
16244
    Param0 = 1;
16245
    Param1 = Intrinsic::arm_mve_hadd_predicated;
16246
    break;
16247
  case ARM::BI__builtin_arm_mve_vhsubq_x_n_s32:
16248
    Param0 = 0;
16249
    Param1 = Intrinsic::arm_mve_hsub_predicated;
16250
    break;
16251
  case ARM::BI__builtin_arm_mve_vhsubq_x_n_u32:
16252
    Param0 = 1;
16253
    Param1 = Intrinsic::arm_mve_hsub_predicated;
16254
    break;
16255
  }
16256
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16257
  Value *Val1 = UndefValue::get(Val0);
16258
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16259
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16260
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
16261
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param0);
16262
  Value *Val6 = EmitScalarExpr(E->getArg(2));
16263
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
16264
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
16265
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val4, Val5, Val8, Val1});
16266
}
16267
case ARM::BI__builtin_arm_mve_vabsq_x_s32:
16268
case ARM::BI__builtin_arm_mve_vclsq_x_s32:
16269
case ARM::BI__builtin_arm_mve_vclzq_x_s32:
16270
case ARM::BI__builtin_arm_mve_vclzq_x_u32:
16271
case ARM::BI__builtin_arm_mve_vmvnq_x_s32:
16272
case ARM::BI__builtin_arm_mve_vmvnq_x_u32:
16273
case ARM::BI__builtin_arm_mve_vnegq_x_s32: {
16274
  Intrinsic::ID  Param0;
16275
  switch (BuiltinID) {
16276
  case ARM::BI__builtin_arm_mve_vabsq_x_s32:
16277
    Param0 = Intrinsic::arm_mve_abs_predicated;
16278
    break;
16279
  case ARM::BI__builtin_arm_mve_vclsq_x_s32:
16280
    Param0 = Intrinsic::arm_mve_cls_predicated;
16281
    break;
16282
  case ARM::BI__builtin_arm_mve_vclzq_x_s32:
16283
    Param0 = Intrinsic::arm_mve_clz_predicated;
16284
    break;
16285
  case ARM::BI__builtin_arm_mve_vclzq_x_u32:
16286
    Param0 = Intrinsic::arm_mve_clz_predicated;
16287
    break;
16288
  case ARM::BI__builtin_arm_mve_vmvnq_x_s32:
16289
    Param0 = Intrinsic::arm_mve_mvn_predicated;
16290
    break;
16291
  case ARM::BI__builtin_arm_mve_vmvnq_x_u32:
16292
    Param0 = Intrinsic::arm_mve_mvn_predicated;
16293
    break;
16294
  case ARM::BI__builtin_arm_mve_vnegq_x_s32:
16295
    Param0 = Intrinsic::arm_mve_neg_predicated;
16296
    break;
16297
  }
16298
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16299
  Value *Val1 = UndefValue::get(Val0);
16300
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16301
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16302
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
16303
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4});
16304
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val5, Val1});
16305
}
16306
case ARM::BI__builtin_arm_mve_vddupq_x_n_u32:
16307
case ARM::BI__builtin_arm_mve_vidupq_x_n_u32: {
16308
  Intrinsic::ID  Param0;
16309
  switch (BuiltinID) {
16310
  case ARM::BI__builtin_arm_mve_vddupq_x_n_u32:
16311
    Param0 = Intrinsic::arm_mve_vddup_predicated;
16312
    break;
16313
  case ARM::BI__builtin_arm_mve_vidupq_x_n_u32:
16314
    Param0 = Intrinsic::arm_mve_vidup_predicated;
16315
    break;
16316
  }
16317
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16318
  Value *Val1 = UndefValue::get(Val0);
16319
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16320
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16321
  Value *Val4 = EmitScalarExpr(E->getArg(2));
16322
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
16323
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
16324
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1, Val2, Val3, Val6});
16325
  return Builder.CreateExtractValue(Val7, static_cast<unsigned>(0));
16326
}
16327
case ARM::BI__builtin_arm_mve_vbrsrq_x_n_s32:
16328
case ARM::BI__builtin_arm_mve_vbrsrq_x_n_u32: {
16329
  Intrinsic::ID  Param0;
16330
  switch (BuiltinID) {
16331
  case ARM::BI__builtin_arm_mve_vbrsrq_x_n_s32:
16332
    Param0 = Intrinsic::arm_mve_vbrsr_predicated;
16333
    break;
16334
  case ARM::BI__builtin_arm_mve_vbrsrq_x_n_u32:
16335
    Param0 = Intrinsic::arm_mve_vbrsr_predicated;
16336
    break;
16337
  }
16338
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16339
  Value *Val1 = UndefValue::get(Val0);
16340
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16341
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16342
  Value *Val4 = EmitScalarExpr(E->getArg(2));
16343
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
16344
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
16345
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1, Val2, Val3, Val6});
16346
}
16347
case ARM::BI__builtin_arm_mve_vaddq_x_s32:
16348
case ARM::BI__builtin_arm_mve_vaddq_x_u32:
16349
case ARM::BI__builtin_arm_mve_vmulq_x_s32:
16350
case ARM::BI__builtin_arm_mve_vmulq_x_u32:
16351
case ARM::BI__builtin_arm_mve_vshlq_x_n_s32:
16352
case ARM::BI__builtin_arm_mve_vshlq_x_n_u32:
16353
case ARM::BI__builtin_arm_mve_vsubq_x_s32:
16354
case ARM::BI__builtin_arm_mve_vsubq_x_u32: {
16355
  Intrinsic::ID  Param0;
16356
  switch (BuiltinID) {
16357
  case ARM::BI__builtin_arm_mve_vaddq_x_s32:
16358
    Param0 = Intrinsic::arm_mve_add_predicated;
16359
    break;
16360
  case ARM::BI__builtin_arm_mve_vaddq_x_u32:
16361
    Param0 = Intrinsic::arm_mve_add_predicated;
16362
    break;
16363
  case ARM::BI__builtin_arm_mve_vmulq_x_s32:
16364
    Param0 = Intrinsic::arm_mve_mul_predicated;
16365
    break;
16366
  case ARM::BI__builtin_arm_mve_vmulq_x_u32:
16367
    Param0 = Intrinsic::arm_mve_mul_predicated;
16368
    break;
16369
  case ARM::BI__builtin_arm_mve_vshlq_x_n_s32:
16370
    Param0 = Intrinsic::arm_mve_shl_imm_predicated;
16371
    break;
16372
  case ARM::BI__builtin_arm_mve_vshlq_x_n_u32:
16373
    Param0 = Intrinsic::arm_mve_shl_imm_predicated;
16374
    break;
16375
  case ARM::BI__builtin_arm_mve_vsubq_x_s32:
16376
    Param0 = Intrinsic::arm_mve_sub_predicated;
16377
    break;
16378
  case ARM::BI__builtin_arm_mve_vsubq_x_u32:
16379
    Param0 = Intrinsic::arm_mve_sub_predicated;
16380
    break;
16381
  }
16382
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16383
  Value *Val1 = UndefValue::get(Val0);
16384
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16385
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16386
  Value *Val4 = EmitScalarExpr(E->getArg(2));
16387
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
16388
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
16389
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val6, Val1});
16390
}
16391
case ARM::BI__builtin_arm_mve_vdwdupq_x_n_u32:
16392
case ARM::BI__builtin_arm_mve_viwdupq_x_n_u32: {
16393
  Intrinsic::ID  Param0;
16394
  switch (BuiltinID) {
16395
  case ARM::BI__builtin_arm_mve_vdwdupq_x_n_u32:
16396
    Param0 = Intrinsic::arm_mve_vdwdup_predicated;
16397
    break;
16398
  case ARM::BI__builtin_arm_mve_viwdupq_x_n_u32:
16399
    Param0 = Intrinsic::arm_mve_viwdup_predicated;
16400
    break;
16401
  }
16402
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16403
  Value *Val1 = UndefValue::get(Val0);
16404
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16405
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16406
  Value *Val4 = EmitScalarExpr(E->getArg(2));
16407
  Value *Val5 = EmitScalarExpr(E->getArg(3));
16408
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16409
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
16410
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val1, Val2, Val3, Val4, Val7});
16411
  return Builder.CreateExtractValue(Val8, static_cast<unsigned>(0));
16412
}
16413
case ARM::BI__builtin_arm_mve_vrshlq_x_s32:
16414
case ARM::BI__builtin_arm_mve_vrshlq_x_u32:
16415
case ARM::BI__builtin_arm_mve_vshlq_x_s32:
16416
case ARM::BI__builtin_arm_mve_vshlq_x_u32: {
16417
  uint32_t  Param0;
16418
  uint32_t  Param1;
16419
  switch (BuiltinID) {
16420
  case ARM::BI__builtin_arm_mve_vrshlq_x_s32:
16421
    Param0 = 1;
16422
    Param1 = 0;
16423
    break;
16424
  case ARM::BI__builtin_arm_mve_vrshlq_x_u32:
16425
    Param0 = 1;
16426
    Param1 = 1;
16427
    break;
16428
  case ARM::BI__builtin_arm_mve_vshlq_x_s32:
16429
    Param0 = 0;
16430
    Param1 = 0;
16431
    break;
16432
  case ARM::BI__builtin_arm_mve_vshlq_x_u32:
16433
    Param0 = 0;
16434
    Param1 = 1;
16435
    break;
16436
  }
16437
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16438
  Value *Val1 = UndefValue::get(Val0);
16439
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16440
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16441
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, 0);
16442
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param0);
16443
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param1);
16444
  Value *Val7 = EmitScalarExpr(E->getArg(2));
16445
  Value *Val8 = Builder.CreateIntCast(Val7, Int32Ty, false);
16446
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val8});
16447
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshl_vector_predicated, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val4, Val5, Val6, Val9, Val1});
16448
}
16449
case ARM::BI__builtin_arm_mve_vmullbq_poly_x_p16:
16450
case ARM::BI__builtin_arm_mve_vmulltq_poly_x_p16: {
16451
  uint32_t  Param0;
16452
  switch (BuiltinID) {
16453
  case ARM::BI__builtin_arm_mve_vmullbq_poly_x_p16:
16454
    Param0 = 0;
16455
    break;
16456
  case ARM::BI__builtin_arm_mve_vmulltq_poly_x_p16:
16457
    Param0 = 1;
16458
    break;
16459
  }
16460
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16461
  Value *Val1 = UndefValue::get(Val0);
16462
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16463
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16464
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
16465
  Value *Val5 = EmitScalarExpr(E->getArg(2));
16466
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16467
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
16468
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_mull_poly_predicated, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val4, Val7, Val1});
16469
}
16470
case ARM::BI__builtin_arm_mve_vabdq_x_s32:
16471
case ARM::BI__builtin_arm_mve_vabdq_x_u32:
16472
case ARM::BI__builtin_arm_mve_vhaddq_x_s32:
16473
case ARM::BI__builtin_arm_mve_vhaddq_x_u32:
16474
case ARM::BI__builtin_arm_mve_vhsubq_x_s32:
16475
case ARM::BI__builtin_arm_mve_vhsubq_x_u32:
16476
case ARM::BI__builtin_arm_mve_vmaxq_x_s32:
16477
case ARM::BI__builtin_arm_mve_vmaxq_x_u32:
16478
case ARM::BI__builtin_arm_mve_vminq_x_s32:
16479
case ARM::BI__builtin_arm_mve_vminq_x_u32:
16480
case ARM::BI__builtin_arm_mve_vmulhq_x_s32:
16481
case ARM::BI__builtin_arm_mve_vmulhq_x_u32:
16482
case ARM::BI__builtin_arm_mve_vrhaddq_x_s32:
16483
case ARM::BI__builtin_arm_mve_vrhaddq_x_u32:
16484
case ARM::BI__builtin_arm_mve_vrmulhq_x_s32:
16485
case ARM::BI__builtin_arm_mve_vrmulhq_x_u32:
16486
case ARM::BI__builtin_arm_mve_vrshrq_x_n_s32:
16487
case ARM::BI__builtin_arm_mve_vrshrq_x_n_u32:
16488
case ARM::BI__builtin_arm_mve_vshrq_x_n_s32:
16489
case ARM::BI__builtin_arm_mve_vshrq_x_n_u32: {
16490
  uint32_t  Param0;
16491
  Intrinsic::ID  Param1;
16492
  switch (BuiltinID) {
16493
  case ARM::BI__builtin_arm_mve_vabdq_x_s32:
16494
    Param0 = 0;
16495
    Param1 = Intrinsic::arm_mve_abd_predicated;
16496
    break;
16497
  case ARM::BI__builtin_arm_mve_vabdq_x_u32:
16498
    Param0 = 1;
16499
    Param1 = Intrinsic::arm_mve_abd_predicated;
16500
    break;
16501
  case ARM::BI__builtin_arm_mve_vhaddq_x_s32:
16502
    Param0 = 0;
16503
    Param1 = Intrinsic::arm_mve_hadd_predicated;
16504
    break;
16505
  case ARM::BI__builtin_arm_mve_vhaddq_x_u32:
16506
    Param0 = 1;
16507
    Param1 = Intrinsic::arm_mve_hadd_predicated;
16508
    break;
16509
  case ARM::BI__builtin_arm_mve_vhsubq_x_s32:
16510
    Param0 = 0;
16511
    Param1 = Intrinsic::arm_mve_hsub_predicated;
16512
    break;
16513
  case ARM::BI__builtin_arm_mve_vhsubq_x_u32:
16514
    Param0 = 1;
16515
    Param1 = Intrinsic::arm_mve_hsub_predicated;
16516
    break;
16517
  case ARM::BI__builtin_arm_mve_vmaxq_x_s32:
16518
    Param0 = 0;
16519
    Param1 = Intrinsic::arm_mve_max_predicated;
16520
    break;
16521
  case ARM::BI__builtin_arm_mve_vmaxq_x_u32:
16522
    Param0 = 1;
16523
    Param1 = Intrinsic::arm_mve_max_predicated;
16524
    break;
16525
  case ARM::BI__builtin_arm_mve_vminq_x_s32:
16526
    Param0 = 0;
16527
    Param1 = Intrinsic::arm_mve_min_predicated;
16528
    break;
16529
  case ARM::BI__builtin_arm_mve_vminq_x_u32:
16530
    Param0 = 1;
16531
    Param1 = Intrinsic::arm_mve_min_predicated;
16532
    break;
16533
  case ARM::BI__builtin_arm_mve_vmulhq_x_s32:
16534
    Param0 = 0;
16535
    Param1 = Intrinsic::arm_mve_mulh_predicated;
16536
    break;
16537
  case ARM::BI__builtin_arm_mve_vmulhq_x_u32:
16538
    Param0 = 1;
16539
    Param1 = Intrinsic::arm_mve_mulh_predicated;
16540
    break;
16541
  case ARM::BI__builtin_arm_mve_vrhaddq_x_s32:
16542
    Param0 = 0;
16543
    Param1 = Intrinsic::arm_mve_rhadd_predicated;
16544
    break;
16545
  case ARM::BI__builtin_arm_mve_vrhaddq_x_u32:
16546
    Param0 = 1;
16547
    Param1 = Intrinsic::arm_mve_rhadd_predicated;
16548
    break;
16549
  case ARM::BI__builtin_arm_mve_vrmulhq_x_s32:
16550
    Param0 = 0;
16551
    Param1 = Intrinsic::arm_mve_rmulh_predicated;
16552
    break;
16553
  case ARM::BI__builtin_arm_mve_vrmulhq_x_u32:
16554
    Param0 = 1;
16555
    Param1 = Intrinsic::arm_mve_rmulh_predicated;
16556
    break;
16557
  case ARM::BI__builtin_arm_mve_vrshrq_x_n_s32:
16558
    Param0 = 0;
16559
    Param1 = Intrinsic::arm_mve_vrshr_imm_predicated;
16560
    break;
16561
  case ARM::BI__builtin_arm_mve_vrshrq_x_n_u32:
16562
    Param0 = 1;
16563
    Param1 = Intrinsic::arm_mve_vrshr_imm_predicated;
16564
    break;
16565
  case ARM::BI__builtin_arm_mve_vshrq_x_n_s32:
16566
    Param0 = 0;
16567
    Param1 = Intrinsic::arm_mve_shr_imm_predicated;
16568
    break;
16569
  case ARM::BI__builtin_arm_mve_vshrq_x_n_u32:
16570
    Param0 = 1;
16571
    Param1 = Intrinsic::arm_mve_shr_imm_predicated;
16572
    break;
16573
  }
16574
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16575
  Value *Val1 = UndefValue::get(Val0);
16576
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16577
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16578
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
16579
  Value *Val5 = EmitScalarExpr(E->getArg(2));
16580
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16581
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
16582
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val4, Val7, Val1});
16583
}
16584
case ARM::BI__builtin_arm_mve_vmullbq_int_x_s16:
16585
case ARM::BI__builtin_arm_mve_vmullbq_int_x_u16:
16586
case ARM::BI__builtin_arm_mve_vmulltq_int_x_s16:
16587
case ARM::BI__builtin_arm_mve_vmulltq_int_x_u16:
16588
case ARM::BI__builtin_arm_mve_vshllbq_x_n_s16:
16589
case ARM::BI__builtin_arm_mve_vshllbq_x_n_u16:
16590
case ARM::BI__builtin_arm_mve_vshlltq_x_n_s16:
16591
case ARM::BI__builtin_arm_mve_vshlltq_x_n_u16: {
16592
  uint32_t  Param0;
16593
  uint32_t  Param1;
16594
  Intrinsic::ID  Param2;
16595
  switch (BuiltinID) {
16596
  case ARM::BI__builtin_arm_mve_vmullbq_int_x_s16:
16597
    Param0 = 0;
16598
    Param1 = 0;
16599
    Param2 = Intrinsic::arm_mve_mull_int_predicated;
16600
    break;
16601
  case ARM::BI__builtin_arm_mve_vmullbq_int_x_u16:
16602
    Param0 = 1;
16603
    Param1 = 0;
16604
    Param2 = Intrinsic::arm_mve_mull_int_predicated;
16605
    break;
16606
  case ARM::BI__builtin_arm_mve_vmulltq_int_x_s16:
16607
    Param0 = 0;
16608
    Param1 = 1;
16609
    Param2 = Intrinsic::arm_mve_mull_int_predicated;
16610
    break;
16611
  case ARM::BI__builtin_arm_mve_vmulltq_int_x_u16:
16612
    Param0 = 1;
16613
    Param1 = 1;
16614
    Param2 = Intrinsic::arm_mve_mull_int_predicated;
16615
    break;
16616
  case ARM::BI__builtin_arm_mve_vshllbq_x_n_s16:
16617
    Param0 = 0;
16618
    Param1 = 0;
16619
    Param2 = Intrinsic::arm_mve_vshll_imm_predicated;
16620
    break;
16621
  case ARM::BI__builtin_arm_mve_vshllbq_x_n_u16:
16622
    Param0 = 1;
16623
    Param1 = 0;
16624
    Param2 = Intrinsic::arm_mve_vshll_imm_predicated;
16625
    break;
16626
  case ARM::BI__builtin_arm_mve_vshlltq_x_n_s16:
16627
    Param0 = 0;
16628
    Param1 = 1;
16629
    Param2 = Intrinsic::arm_mve_vshll_imm_predicated;
16630
    break;
16631
  case ARM::BI__builtin_arm_mve_vshlltq_x_n_u16:
16632
    Param0 = 1;
16633
    Param1 = 1;
16634
    Param2 = Intrinsic::arm_mve_vshll_imm_predicated;
16635
    break;
16636
  }
16637
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16638
  Value *Val1 = UndefValue::get(Val0);
16639
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16640
  Value *Val3 = EmitScalarExpr(E->getArg(1));
16641
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
16642
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param1);
16643
  Value *Val6 = EmitScalarExpr(E->getArg(2));
16644
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
16645
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
16646
  return Builder.CreateCall(CGM.getIntrinsic(Param2, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val4, Val5, Val8, Val1});
16647
}
16648
case ARM::BI__builtin_arm_mve_vrev64q_x_s32:
16649
case ARM::BI__builtin_arm_mve_vrev64q_x_u32: {
16650
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16651
  Value *Val1 = UndefValue::get(Val0);
16652
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16653
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, 64);
16654
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16655
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
16656
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
16657
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vrev_predicated, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val6, Val1});
16658
}
16659
case ARM::BI__builtin_arm_mve_vcvtq_x_s32_f32:
16660
case ARM::BI__builtin_arm_mve_vcvtq_x_u32_f32: {
16661
  uint32_t  Param0;
16662
  switch (BuiltinID) {
16663
  case ARM::BI__builtin_arm_mve_vcvtq_x_s32_f32:
16664
    Param0 = 0;
16665
    break;
16666
  case ARM::BI__builtin_arm_mve_vcvtq_x_u32_f32:
16667
    Param0 = 1;
16668
    break;
16669
  }
16670
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16671
  Value *Val1 = UndefValue::get(Val0);
16672
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16673
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
16674
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16675
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
16676
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
16677
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fp_int_predicated, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val6, Val1});
16678
}
16679
case ARM::BI__builtin_arm_mve_vmovlbq_x_s16:
16680
case ARM::BI__builtin_arm_mve_vmovlbq_x_u16:
16681
case ARM::BI__builtin_arm_mve_vmovltq_x_s16:
16682
case ARM::BI__builtin_arm_mve_vmovltq_x_u16: {
16683
  uint32_t  Param0;
16684
  uint32_t  Param1;
16685
  switch (BuiltinID) {
16686
  case ARM::BI__builtin_arm_mve_vmovlbq_x_s16:
16687
    Param0 = 0;
16688
    Param1 = 0;
16689
    break;
16690
  case ARM::BI__builtin_arm_mve_vmovlbq_x_u16:
16691
    Param0 = 1;
16692
    Param1 = 0;
16693
    break;
16694
  case ARM::BI__builtin_arm_mve_vmovltq_x_s16:
16695
    Param0 = 0;
16696
    Param1 = 1;
16697
    break;
16698
  case ARM::BI__builtin_arm_mve_vmovltq_x_u16:
16699
    Param0 = 1;
16700
    Param1 = 1;
16701
    break;
16702
  }
16703
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16704
  Value *Val1 = UndefValue::get(Val0);
16705
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16706
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
16707
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param1);
16708
  Value *Val5 = EmitScalarExpr(E->getArg(1));
16709
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16710
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
16711
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vmovl_predicated, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Int16Ty, 8), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val4, Val7, Val1});
16712
}
16713
case ARM::BI__builtin_arm_mve_vandq_x_s32:
16714
case ARM::BI__builtin_arm_mve_vandq_x_u32:
16715
case ARM::BI__builtin_arm_mve_vbicq_x_s32:
16716
case ARM::BI__builtin_arm_mve_vbicq_x_u32:
16717
case ARM::BI__builtin_arm_mve_veorq_x_s32:
16718
case ARM::BI__builtin_arm_mve_veorq_x_u32:
16719
case ARM::BI__builtin_arm_mve_vornq_x_s32:
16720
case ARM::BI__builtin_arm_mve_vornq_x_u32:
16721
case ARM::BI__builtin_arm_mve_vorrq_x_s32:
16722
case ARM::BI__builtin_arm_mve_vorrq_x_u32: {
16723
  Intrinsic::ID  Param0;
16724
  switch (BuiltinID) {
16725
  case ARM::BI__builtin_arm_mve_vandq_x_s32:
16726
    Param0 = Intrinsic::arm_mve_and_predicated;
16727
    break;
16728
  case ARM::BI__builtin_arm_mve_vandq_x_u32:
16729
    Param0 = Intrinsic::arm_mve_and_predicated;
16730
    break;
16731
  case ARM::BI__builtin_arm_mve_vbicq_x_s32:
16732
    Param0 = Intrinsic::arm_mve_bic_predicated;
16733
    break;
16734
  case ARM::BI__builtin_arm_mve_vbicq_x_u32:
16735
    Param0 = Intrinsic::arm_mve_bic_predicated;
16736
    break;
16737
  case ARM::BI__builtin_arm_mve_veorq_x_s32:
16738
    Param0 = Intrinsic::arm_mve_eor_predicated;
16739
    break;
16740
  case ARM::BI__builtin_arm_mve_veorq_x_u32:
16741
    Param0 = Intrinsic::arm_mve_eor_predicated;
16742
    break;
16743
  case ARM::BI__builtin_arm_mve_vornq_x_s32:
16744
    Param0 = Intrinsic::arm_mve_orn_predicated;
16745
    break;
16746
  case ARM::BI__builtin_arm_mve_vornq_x_u32:
16747
    Param0 = Intrinsic::arm_mve_orn_predicated;
16748
    break;
16749
  case ARM::BI__builtin_arm_mve_vorrq_x_s32:
16750
    Param0 = Intrinsic::arm_mve_orr_predicated;
16751
    break;
16752
  case ARM::BI__builtin_arm_mve_vorrq_x_u32:
16753
    Param0 = Intrinsic::arm_mve_orr_predicated;
16754
    break;
16755
  }
16756
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16757
  Value *Val1 = UndefValue::get(Val0);
16758
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16759
  llvm::Type *Val3 = llvm::FixedVectorType::get(Int32Ty, 4);
16760
  Value *Val4 = Builder.CreateBitCast(Val2, Val3);
16761
  Value *Val5 = EmitScalarExpr(E->getArg(1));
16762
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int32Ty, 4);
16763
  Value *Val7 = Builder.CreateBitCast(Val5, Val6);
16764
  Value *Val8 = EmitScalarExpr(E->getArg(2));
16765
  Value *Val9 = Builder.CreateIntCast(Val8, Int32Ty, false);
16766
  Value *Val10 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val9});
16767
  llvm::Type *Val11 = llvm::FixedVectorType::get(Int32Ty, 4);
16768
  Value *Val12 = Builder.CreateBitCast(Val1, Val11);
16769
  Value *Val13 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val4, Val7, Val10, Val12});
16770
  llvm::Type *Val14 = llvm::FixedVectorType::get(Int32Ty, 4);
16771
  return Builder.CreateBitCast(Val13, Val14);
16772
}
16773
case ARM::BI__builtin_arm_mve_vdupq_x_n_s32:
16774
case ARM::BI__builtin_arm_mve_vdupq_x_n_u32: {
16775
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16776
  Value *Val1 = UndefValue::get(Val0);
16777
  Value *Val2 = EmitScalarExpr(E->getArg(1));
16778
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
16779
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val3});
16780
  Value *Val5 = EmitScalarExpr(E->getArg(0));
16781
  Value *Val6 = ARMMVEVectorSplat(Builder, Val5);
16782
  return Builder.CreateSelect(Val4, Val6, Val1);
16783
}
16784
case ARM::BI__builtin_arm_mve_vmvnq_x_n_s32:
16785
case ARM::BI__builtin_arm_mve_vmvnq_x_n_u32: {
16786
  bool  Param0;
16787
  switch (BuiltinID) {
16788
  case ARM::BI__builtin_arm_mve_vmvnq_x_n_s32:
16789
    Param0 = true;
16790
    break;
16791
  case ARM::BI__builtin_arm_mve_vmvnq_x_n_u32:
16792
    Param0 = false;
16793
    break;
16794
  }
16795
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16796
  Value *Val1 = UndefValue::get(Val0);
16797
  Value *Val2 = EmitScalarExpr(E->getArg(1));
16798
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
16799
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val3});
16800
  Value *Val5 = EmitScalarExpr(E->getArg(0));
16801
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, Param0);
16802
  Value *Val7 = ARMMVEVectorSplat(Builder, Val6);
16803
  Value *Val8 = Builder.CreateNot(Val7);
16804
  return Builder.CreateSelect(Val4, Val8, Val1);
16805
}
16806
case ARM::BI__builtin_arm_mve_vcvtaq_x_s32_f32:
16807
case ARM::BI__builtin_arm_mve_vcvtaq_x_u32_f32:
16808
case ARM::BI__builtin_arm_mve_vcvtmq_x_s32_f32:
16809
case ARM::BI__builtin_arm_mve_vcvtmq_x_u32_f32:
16810
case ARM::BI__builtin_arm_mve_vcvtnq_x_s32_f32:
16811
case ARM::BI__builtin_arm_mve_vcvtnq_x_u32_f32:
16812
case ARM::BI__builtin_arm_mve_vcvtpq_x_s32_f32:
16813
case ARM::BI__builtin_arm_mve_vcvtpq_x_u32_f32: {
16814
  uint32_t  Param0;
16815
  Intrinsic::ID  Param1;
16816
  switch (BuiltinID) {
16817
  case ARM::BI__builtin_arm_mve_vcvtaq_x_s32_f32:
16818
    Param0 = 0;
16819
    Param1 = Intrinsic::arm_mve_vcvta_predicated;
16820
    break;
16821
  case ARM::BI__builtin_arm_mve_vcvtaq_x_u32_f32:
16822
    Param0 = 1;
16823
    Param1 = Intrinsic::arm_mve_vcvta_predicated;
16824
    break;
16825
  case ARM::BI__builtin_arm_mve_vcvtmq_x_s32_f32:
16826
    Param0 = 0;
16827
    Param1 = Intrinsic::arm_mve_vcvtm_predicated;
16828
    break;
16829
  case ARM::BI__builtin_arm_mve_vcvtmq_x_u32_f32:
16830
    Param0 = 1;
16831
    Param1 = Intrinsic::arm_mve_vcvtm_predicated;
16832
    break;
16833
  case ARM::BI__builtin_arm_mve_vcvtnq_x_s32_f32:
16834
    Param0 = 0;
16835
    Param1 = Intrinsic::arm_mve_vcvtn_predicated;
16836
    break;
16837
  case ARM::BI__builtin_arm_mve_vcvtnq_x_u32_f32:
16838
    Param0 = 1;
16839
    Param1 = Intrinsic::arm_mve_vcvtn_predicated;
16840
    break;
16841
  case ARM::BI__builtin_arm_mve_vcvtpq_x_s32_f32:
16842
    Param0 = 0;
16843
    Param1 = Intrinsic::arm_mve_vcvtp_predicated;
16844
    break;
16845
  case ARM::BI__builtin_arm_mve_vcvtpq_x_u32_f32:
16846
    Param0 = 1;
16847
    Param1 = Intrinsic::arm_mve_vcvtp_predicated;
16848
    break;
16849
  }
16850
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16851
  Value *Val1 = UndefValue::get(Val0);
16852
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
16853
  Value *Val3 = EmitScalarExpr(E->getArg(0));
16854
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16855
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
16856
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val5});
16857
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val1, Val3, Val6});
16858
}
16859
case ARM::BI__builtin_arm_mve_vcvtq_x_n_s32_f32:
16860
case ARM::BI__builtin_arm_mve_vcvtq_x_n_u32_f32: {
16861
  uint32_t  Param0;
16862
  switch (BuiltinID) {
16863
  case ARM::BI__builtin_arm_mve_vcvtq_x_n_s32_f32:
16864
    Param0 = 0;
16865
    break;
16866
  case ARM::BI__builtin_arm_mve_vcvtq_x_n_u32_f32:
16867
    Param0 = 1;
16868
    break;
16869
  }
16870
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16871
  Value *Val1 = UndefValue::get(Val0);
16872
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
16873
  Value *Val3 = EmitScalarExpr(E->getArg(0));
16874
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16875
  Value *Val5 = EmitScalarExpr(E->getArg(2));
16876
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
16877
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val6});
16878
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcvt_fix_predicated, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(FloatTy, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val1, Val3, Val4, Val7});
16879
}
16880
case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_s32:
16881
case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_u32:
16882
case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_s32:
16883
case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_u32:
16884
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_x_s32:
16885
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_x_s32: {
16886
  uint32_t  Param0;
16887
  uint32_t  Param1;
16888
  switch (BuiltinID) {
16889
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_s32:
16890
    Param0 = 1;
16891
    Param1 = 1;
16892
    break;
16893
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_u32:
16894
    Param0 = 1;
16895
    Param1 = 1;
16896
    break;
16897
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_s32:
16898
    Param0 = 1;
16899
    Param1 = 0;
16900
    break;
16901
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_u32:
16902
    Param0 = 1;
16903
    Param1 = 0;
16904
    break;
16905
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_x_s32:
16906
    Param0 = 0;
16907
    Param1 = 1;
16908
    break;
16909
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_x_s32:
16910
    Param0 = 0;
16911
    Param1 = 0;
16912
    break;
16913
  }
16914
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16915
  Value *Val1 = UndefValue::get(Val0);
16916
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
16917
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
16918
  Value *Val4 = EmitScalarExpr(E->getArg(0));
16919
  Value *Val5 = EmitScalarExpr(E->getArg(1));
16920
  Value *Val6 = EmitScalarExpr(E->getArg(2));
16921
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
16922
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val7});
16923
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcaddq_predicated, {llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 4)}), {Val2, Val3, Val1, Val4, Val5, Val8});
16924
}
16925
case ARM::BI__builtin_arm_mve_vnegq_s32: {
16926
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16927
  Value *Val1 = llvm::Constant::getNullValue(Val0);
16928
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16929
  return Builder.CreateSub(Val1, Val2);
16930
}
16931
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_s32:
16932
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_u32:
16933
case ARM::BI__builtin_arm_mve_vuninitializedq_s32:
16934
case ARM::BI__builtin_arm_mve_vuninitializedq_u32: {
16935
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int32Ty, 4);
16936
  return UndefValue::get(Val0);
16937
}
16938
case ARM::BI__builtin_arm_mve_vcreateq_f32: {
16939
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int64Ty, 2);
16940
  Value *Val1 = UndefValue::get(Val0);
16941
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16942
  Value *Val3 = Builder.CreateInsertElement(Val1, Val2, static_cast<uint64_t>(0));
16943
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16944
  Value *Val5 = Builder.CreateInsertElement(Val3, Val4, static_cast<uint64_t>(1));
16945
  llvm::Type *Val6 = llvm::FixedVectorType::get(FloatTy, 4);
16946
  return ARMMVEVectorReinterpret(Builder, this, Val5, Val6);
16947
}
16948
case ARM::BI__builtin_arm_mve_vcreateq_f16: {
16949
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int64Ty, 2);
16950
  Value *Val1 = UndefValue::get(Val0);
16951
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16952
  Value *Val3 = Builder.CreateInsertElement(Val1, Val2, static_cast<uint64_t>(0));
16953
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16954
  Value *Val5 = Builder.CreateInsertElement(Val3, Val4, static_cast<uint64_t>(1));
16955
  llvm::Type *Val6 = llvm::FixedVectorType::get(HalfTy, 8);
16956
  return ARMMVEVectorReinterpret(Builder, this, Val5, Val6);
16957
}
16958
case ARM::BI__builtin_arm_mve_vcreateq_s16:
16959
case ARM::BI__builtin_arm_mve_vcreateq_u16: {
16960
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int64Ty, 2);
16961
  Value *Val1 = UndefValue::get(Val0);
16962
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16963
  Value *Val3 = Builder.CreateInsertElement(Val1, Val2, static_cast<uint64_t>(0));
16964
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16965
  Value *Val5 = Builder.CreateInsertElement(Val3, Val4, static_cast<uint64_t>(1));
16966
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int16Ty, 8);
16967
  return ARMMVEVectorReinterpret(Builder, this, Val5, Val6);
16968
}
16969
case ARM::BI__builtin_arm_mve_vcreateq_s32:
16970
case ARM::BI__builtin_arm_mve_vcreateq_u32: {
16971
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int64Ty, 2);
16972
  Value *Val1 = UndefValue::get(Val0);
16973
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16974
  Value *Val3 = Builder.CreateInsertElement(Val1, Val2, static_cast<uint64_t>(0));
16975
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16976
  Value *Val5 = Builder.CreateInsertElement(Val3, Val4, static_cast<uint64_t>(1));
16977
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int32Ty, 4);
16978
  return ARMMVEVectorReinterpret(Builder, this, Val5, Val6);
16979
}
16980
case ARM::BI__builtin_arm_mve_vcreateq_s64:
16981
case ARM::BI__builtin_arm_mve_vcreateq_u64: {
16982
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int64Ty, 2);
16983
  Value *Val1 = UndefValue::get(Val0);
16984
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16985
  Value *Val3 = Builder.CreateInsertElement(Val1, Val2, static_cast<uint64_t>(0));
16986
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16987
  Value *Val5 = Builder.CreateInsertElement(Val3, Val4, static_cast<uint64_t>(1));
16988
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int64Ty, 2);
16989
  return ARMMVEVectorReinterpret(Builder, this, Val5, Val6);
16990
}
16991
case ARM::BI__builtin_arm_mve_vcreateq_s8:
16992
case ARM::BI__builtin_arm_mve_vcreateq_u8: {
16993
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int64Ty, 2);
16994
  Value *Val1 = UndefValue::get(Val0);
16995
  Value *Val2 = EmitScalarExpr(E->getArg(0));
16996
  Value *Val3 = Builder.CreateInsertElement(Val1, Val2, static_cast<uint64_t>(0));
16997
  Value *Val4 = EmitScalarExpr(E->getArg(1));
16998
  Value *Val5 = Builder.CreateInsertElement(Val3, Val4, static_cast<uint64_t>(1));
16999
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int8Ty, 16);
17000
  return ARMMVEVectorReinterpret(Builder, this, Val5, Val6);
17001
}
17002
case ARM::BI__builtin_arm_mve_vmullbq_int_x_s32:
17003
case ARM::BI__builtin_arm_mve_vmullbq_int_x_u32:
17004
case ARM::BI__builtin_arm_mve_vmulltq_int_x_s32:
17005
case ARM::BI__builtin_arm_mve_vmulltq_int_x_u32: {
17006
  uint32_t  Param0;
17007
  uint32_t  Param1;
17008
  switch (BuiltinID) {
17009
  case ARM::BI__builtin_arm_mve_vmullbq_int_x_s32:
17010
    Param0 = 0;
17011
    Param1 = 0;
17012
    break;
17013
  case ARM::BI__builtin_arm_mve_vmullbq_int_x_u32:
17014
    Param0 = 1;
17015
    Param1 = 0;
17016
    break;
17017
  case ARM::BI__builtin_arm_mve_vmulltq_int_x_s32:
17018
    Param0 = 0;
17019
    Param1 = 1;
17020
    break;
17021
  case ARM::BI__builtin_arm_mve_vmulltq_int_x_u32:
17022
    Param0 = 1;
17023
    Param1 = 1;
17024
    break;
17025
  }
17026
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int64Ty, 2);
17027
  Value *Val1 = UndefValue::get(Val0);
17028
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17029
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17030
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
17031
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param1);
17032
  Value *Val6 = EmitScalarExpr(E->getArg(2));
17033
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
17034
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 2)}), {Val7});
17035
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_mull_int_predicated, {llvm::FixedVectorType::get(Int64Ty, 2), llvm::FixedVectorType::get(Int32Ty, 4), llvm::FixedVectorType::get(Builder.getInt1Ty(), 2)}), {Val2, Val3, Val4, Val5, Val8, Val1});
17036
}
17037
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_s64:
17038
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_u64:
17039
case ARM::BI__builtin_arm_mve_vuninitializedq_s64:
17040
case ARM::BI__builtin_arm_mve_vuninitializedq_u64: {
17041
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int64Ty, 2);
17042
  return UndefValue::get(Val0);
17043
}
17044
case ARM::BI__builtin_arm_mve_vddupq_x_wb_u8:
17045
case ARM::BI__builtin_arm_mve_vidupq_x_wb_u8: {
17046
  Intrinsic::ID  Param0;
17047
  switch (BuiltinID) {
17048
  case ARM::BI__builtin_arm_mve_vddupq_x_wb_u8:
17049
    Param0 = Intrinsic::arm_mve_vddup_predicated;
17050
    break;
17051
  case ARM::BI__builtin_arm_mve_vidupq_x_wb_u8:
17052
    Param0 = Intrinsic::arm_mve_vidup_predicated;
17053
    break;
17054
  }
17055
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17056
  Value *Val1 = UndefValue::get(Val0);
17057
  Address Val2 = EmitPointerWithAlignment(E->getArg(0));
17058
  Value *Val3 = Builder.CreateLoad(Val2);
17059
  Value *Val4 = EmitScalarExpr(E->getArg(1));
17060
  Value *Val5 = EmitScalarExpr(E->getArg(2));
17061
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
17062
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val6});
17063
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val1, Val3, Val4, Val7});
17064
  Value *Val9 = Builder.CreateExtractValue(Val8, static_cast<unsigned>(1));
17065
  Builder.CreateStore(Val9, Val2);
17066
  return Builder.CreateExtractValue(Val8, static_cast<unsigned>(0));
17067
}
17068
case ARM::BI__builtin_arm_mve_vdwdupq_x_wb_u8:
17069
case ARM::BI__builtin_arm_mve_viwdupq_x_wb_u8: {
17070
  Intrinsic::ID  Param0;
17071
  switch (BuiltinID) {
17072
  case ARM::BI__builtin_arm_mve_vdwdupq_x_wb_u8:
17073
    Param0 = Intrinsic::arm_mve_vdwdup_predicated;
17074
    break;
17075
  case ARM::BI__builtin_arm_mve_viwdupq_x_wb_u8:
17076
    Param0 = Intrinsic::arm_mve_viwdup_predicated;
17077
    break;
17078
  }
17079
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17080
  Value *Val1 = UndefValue::get(Val0);
17081
  Address Val2 = EmitPointerWithAlignment(E->getArg(0));
17082
  Value *Val3 = Builder.CreateLoad(Val2);
17083
  Value *Val4 = EmitScalarExpr(E->getArg(1));
17084
  Value *Val5 = EmitScalarExpr(E->getArg(2));
17085
  Value *Val6 = EmitScalarExpr(E->getArg(3));
17086
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
17087
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val7});
17088
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val1, Val3, Val4, Val5, Val8});
17089
  Value *Val10 = Builder.CreateExtractValue(Val9, static_cast<unsigned>(1));
17090
  Builder.CreateStore(Val10, Val2);
17091
  return Builder.CreateExtractValue(Val9, static_cast<unsigned>(0));
17092
}
17093
case ARM::BI__builtin_arm_mve_vaddq_x_n_s8:
17094
case ARM::BI__builtin_arm_mve_vaddq_x_n_u8:
17095
case ARM::BI__builtin_arm_mve_vmulq_x_n_s8:
17096
case ARM::BI__builtin_arm_mve_vmulq_x_n_u8:
17097
case ARM::BI__builtin_arm_mve_vsubq_x_n_s8:
17098
case ARM::BI__builtin_arm_mve_vsubq_x_n_u8: {
17099
  Intrinsic::ID  Param0;
17100
  switch (BuiltinID) {
17101
  case ARM::BI__builtin_arm_mve_vaddq_x_n_s8:
17102
    Param0 = Intrinsic::arm_mve_add_predicated;
17103
    break;
17104
  case ARM::BI__builtin_arm_mve_vaddq_x_n_u8:
17105
    Param0 = Intrinsic::arm_mve_add_predicated;
17106
    break;
17107
  case ARM::BI__builtin_arm_mve_vmulq_x_n_s8:
17108
    Param0 = Intrinsic::arm_mve_mul_predicated;
17109
    break;
17110
  case ARM::BI__builtin_arm_mve_vmulq_x_n_u8:
17111
    Param0 = Intrinsic::arm_mve_mul_predicated;
17112
    break;
17113
  case ARM::BI__builtin_arm_mve_vsubq_x_n_s8:
17114
    Param0 = Intrinsic::arm_mve_sub_predicated;
17115
    break;
17116
  case ARM::BI__builtin_arm_mve_vsubq_x_n_u8:
17117
    Param0 = Intrinsic::arm_mve_sub_predicated;
17118
    break;
17119
  }
17120
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17121
  Value *Val1 = UndefValue::get(Val0);
17122
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17123
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17124
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
17125
  Value *Val5 = EmitScalarExpr(E->getArg(2));
17126
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
17127
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val6});
17128
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val4, Val7, Val1});
17129
}
17130
case ARM::BI__builtin_arm_mve_vhaddq_x_n_s8:
17131
case ARM::BI__builtin_arm_mve_vhaddq_x_n_u8:
17132
case ARM::BI__builtin_arm_mve_vhsubq_x_n_s8:
17133
case ARM::BI__builtin_arm_mve_vhsubq_x_n_u8: {
17134
  uint32_t  Param0;
17135
  Intrinsic::ID  Param1;
17136
  switch (BuiltinID) {
17137
  case ARM::BI__builtin_arm_mve_vhaddq_x_n_s8:
17138
    Param0 = 0;
17139
    Param1 = Intrinsic::arm_mve_hadd_predicated;
17140
    break;
17141
  case ARM::BI__builtin_arm_mve_vhaddq_x_n_u8:
17142
    Param0 = 1;
17143
    Param1 = Intrinsic::arm_mve_hadd_predicated;
17144
    break;
17145
  case ARM::BI__builtin_arm_mve_vhsubq_x_n_s8:
17146
    Param0 = 0;
17147
    Param1 = Intrinsic::arm_mve_hsub_predicated;
17148
    break;
17149
  case ARM::BI__builtin_arm_mve_vhsubq_x_n_u8:
17150
    Param0 = 1;
17151
    Param1 = Intrinsic::arm_mve_hsub_predicated;
17152
    break;
17153
  }
17154
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17155
  Value *Val1 = UndefValue::get(Val0);
17156
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17157
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17158
  Value *Val4 = ARMMVEVectorSplat(Builder, Val3);
17159
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param0);
17160
  Value *Val6 = EmitScalarExpr(E->getArg(2));
17161
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
17162
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val7});
17163
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val4, Val5, Val8, Val1});
17164
}
17165
case ARM::BI__builtin_arm_mve_vabsq_x_s8:
17166
case ARM::BI__builtin_arm_mve_vclsq_x_s8:
17167
case ARM::BI__builtin_arm_mve_vclzq_x_s8:
17168
case ARM::BI__builtin_arm_mve_vclzq_x_u8:
17169
case ARM::BI__builtin_arm_mve_vmvnq_x_s8:
17170
case ARM::BI__builtin_arm_mve_vmvnq_x_u8:
17171
case ARM::BI__builtin_arm_mve_vnegq_x_s8: {
17172
  Intrinsic::ID  Param0;
17173
  switch (BuiltinID) {
17174
  case ARM::BI__builtin_arm_mve_vabsq_x_s8:
17175
    Param0 = Intrinsic::arm_mve_abs_predicated;
17176
    break;
17177
  case ARM::BI__builtin_arm_mve_vclsq_x_s8:
17178
    Param0 = Intrinsic::arm_mve_cls_predicated;
17179
    break;
17180
  case ARM::BI__builtin_arm_mve_vclzq_x_s8:
17181
    Param0 = Intrinsic::arm_mve_clz_predicated;
17182
    break;
17183
  case ARM::BI__builtin_arm_mve_vclzq_x_u8:
17184
    Param0 = Intrinsic::arm_mve_clz_predicated;
17185
    break;
17186
  case ARM::BI__builtin_arm_mve_vmvnq_x_s8:
17187
    Param0 = Intrinsic::arm_mve_mvn_predicated;
17188
    break;
17189
  case ARM::BI__builtin_arm_mve_vmvnq_x_u8:
17190
    Param0 = Intrinsic::arm_mve_mvn_predicated;
17191
    break;
17192
  case ARM::BI__builtin_arm_mve_vnegq_x_s8:
17193
    Param0 = Intrinsic::arm_mve_neg_predicated;
17194
    break;
17195
  }
17196
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17197
  Value *Val1 = UndefValue::get(Val0);
17198
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17199
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17200
  Value *Val4 = Builder.CreateIntCast(Val3, Int32Ty, false);
17201
  Value *Val5 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val4});
17202
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val5, Val1});
17203
}
17204
case ARM::BI__builtin_arm_mve_vddupq_x_n_u8:
17205
case ARM::BI__builtin_arm_mve_vidupq_x_n_u8: {
17206
  Intrinsic::ID  Param0;
17207
  switch (BuiltinID) {
17208
  case ARM::BI__builtin_arm_mve_vddupq_x_n_u8:
17209
    Param0 = Intrinsic::arm_mve_vddup_predicated;
17210
    break;
17211
  case ARM::BI__builtin_arm_mve_vidupq_x_n_u8:
17212
    Param0 = Intrinsic::arm_mve_vidup_predicated;
17213
    break;
17214
  }
17215
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17216
  Value *Val1 = UndefValue::get(Val0);
17217
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17218
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17219
  Value *Val4 = EmitScalarExpr(E->getArg(2));
17220
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
17221
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val5});
17222
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val1, Val2, Val3, Val6});
17223
  return Builder.CreateExtractValue(Val7, static_cast<unsigned>(0));
17224
}
17225
case ARM::BI__builtin_arm_mve_vbrsrq_x_n_s8:
17226
case ARM::BI__builtin_arm_mve_vbrsrq_x_n_u8: {
17227
  Intrinsic::ID  Param0;
17228
  switch (BuiltinID) {
17229
  case ARM::BI__builtin_arm_mve_vbrsrq_x_n_s8:
17230
    Param0 = Intrinsic::arm_mve_vbrsr_predicated;
17231
    break;
17232
  case ARM::BI__builtin_arm_mve_vbrsrq_x_n_u8:
17233
    Param0 = Intrinsic::arm_mve_vbrsr_predicated;
17234
    break;
17235
  }
17236
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17237
  Value *Val1 = UndefValue::get(Val0);
17238
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17239
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17240
  Value *Val4 = EmitScalarExpr(E->getArg(2));
17241
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
17242
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val5});
17243
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val1, Val2, Val3, Val6});
17244
}
17245
case ARM::BI__builtin_arm_mve_vaddq_x_s8:
17246
case ARM::BI__builtin_arm_mve_vaddq_x_u8:
17247
case ARM::BI__builtin_arm_mve_vmulq_x_s8:
17248
case ARM::BI__builtin_arm_mve_vmulq_x_u8:
17249
case ARM::BI__builtin_arm_mve_vshlq_x_n_s8:
17250
case ARM::BI__builtin_arm_mve_vshlq_x_n_u8:
17251
case ARM::BI__builtin_arm_mve_vsubq_x_s8:
17252
case ARM::BI__builtin_arm_mve_vsubq_x_u8: {
17253
  Intrinsic::ID  Param0;
17254
  switch (BuiltinID) {
17255
  case ARM::BI__builtin_arm_mve_vaddq_x_s8:
17256
    Param0 = Intrinsic::arm_mve_add_predicated;
17257
    break;
17258
  case ARM::BI__builtin_arm_mve_vaddq_x_u8:
17259
    Param0 = Intrinsic::arm_mve_add_predicated;
17260
    break;
17261
  case ARM::BI__builtin_arm_mve_vmulq_x_s8:
17262
    Param0 = Intrinsic::arm_mve_mul_predicated;
17263
    break;
17264
  case ARM::BI__builtin_arm_mve_vmulq_x_u8:
17265
    Param0 = Intrinsic::arm_mve_mul_predicated;
17266
    break;
17267
  case ARM::BI__builtin_arm_mve_vshlq_x_n_s8:
17268
    Param0 = Intrinsic::arm_mve_shl_imm_predicated;
17269
    break;
17270
  case ARM::BI__builtin_arm_mve_vshlq_x_n_u8:
17271
    Param0 = Intrinsic::arm_mve_shl_imm_predicated;
17272
    break;
17273
  case ARM::BI__builtin_arm_mve_vsubq_x_s8:
17274
    Param0 = Intrinsic::arm_mve_sub_predicated;
17275
    break;
17276
  case ARM::BI__builtin_arm_mve_vsubq_x_u8:
17277
    Param0 = Intrinsic::arm_mve_sub_predicated;
17278
    break;
17279
  }
17280
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17281
  Value *Val1 = UndefValue::get(Val0);
17282
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17283
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17284
  Value *Val4 = EmitScalarExpr(E->getArg(2));
17285
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
17286
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val5});
17287
  return Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val3, Val6, Val1});
17288
}
17289
case ARM::BI__builtin_arm_mve_vdwdupq_x_n_u8:
17290
case ARM::BI__builtin_arm_mve_viwdupq_x_n_u8: {
17291
  Intrinsic::ID  Param0;
17292
  switch (BuiltinID) {
17293
  case ARM::BI__builtin_arm_mve_vdwdupq_x_n_u8:
17294
    Param0 = Intrinsic::arm_mve_vdwdup_predicated;
17295
    break;
17296
  case ARM::BI__builtin_arm_mve_viwdupq_x_n_u8:
17297
    Param0 = Intrinsic::arm_mve_viwdup_predicated;
17298
    break;
17299
  }
17300
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17301
  Value *Val1 = UndefValue::get(Val0);
17302
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17303
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17304
  Value *Val4 = EmitScalarExpr(E->getArg(2));
17305
  Value *Val5 = EmitScalarExpr(E->getArg(3));
17306
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
17307
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val6});
17308
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val1, Val2, Val3, Val4, Val7});
17309
  return Builder.CreateExtractValue(Val8, static_cast<unsigned>(0));
17310
}
17311
case ARM::BI__builtin_arm_mve_vrshlq_x_s8:
17312
case ARM::BI__builtin_arm_mve_vrshlq_x_u8:
17313
case ARM::BI__builtin_arm_mve_vshlq_x_s8:
17314
case ARM::BI__builtin_arm_mve_vshlq_x_u8: {
17315
  uint32_t  Param0;
17316
  uint32_t  Param1;
17317
  switch (BuiltinID) {
17318
  case ARM::BI__builtin_arm_mve_vrshlq_x_s8:
17319
    Param0 = 1;
17320
    Param1 = 0;
17321
    break;
17322
  case ARM::BI__builtin_arm_mve_vrshlq_x_u8:
17323
    Param0 = 1;
17324
    Param1 = 1;
17325
    break;
17326
  case ARM::BI__builtin_arm_mve_vshlq_x_s8:
17327
    Param0 = 0;
17328
    Param1 = 0;
17329
    break;
17330
  case ARM::BI__builtin_arm_mve_vshlq_x_u8:
17331
    Param0 = 0;
17332
    Param1 = 1;
17333
    break;
17334
  }
17335
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17336
  Value *Val1 = UndefValue::get(Val0);
17337
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17338
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17339
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, 0);
17340
  Value *Val5 = llvm::ConstantInt::get(Int32Ty, Param0);
17341
  Value *Val6 = llvm::ConstantInt::get(Int32Ty, Param1);
17342
  Value *Val7 = EmitScalarExpr(E->getArg(2));
17343
  Value *Val8 = Builder.CreateIntCast(Val7, Int32Ty, false);
17344
  Value *Val9 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val8});
17345
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vshl_vector_predicated, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val3, Val4, Val5, Val6, Val9, Val1});
17346
}
17347
case ARM::BI__builtin_arm_mve_vabdq_x_s8:
17348
case ARM::BI__builtin_arm_mve_vabdq_x_u8:
17349
case ARM::BI__builtin_arm_mve_vhaddq_x_s8:
17350
case ARM::BI__builtin_arm_mve_vhaddq_x_u8:
17351
case ARM::BI__builtin_arm_mve_vhsubq_x_s8:
17352
case ARM::BI__builtin_arm_mve_vhsubq_x_u8:
17353
case ARM::BI__builtin_arm_mve_vmaxq_x_s8:
17354
case ARM::BI__builtin_arm_mve_vmaxq_x_u8:
17355
case ARM::BI__builtin_arm_mve_vminq_x_s8:
17356
case ARM::BI__builtin_arm_mve_vminq_x_u8:
17357
case ARM::BI__builtin_arm_mve_vmulhq_x_s8:
17358
case ARM::BI__builtin_arm_mve_vmulhq_x_u8:
17359
case ARM::BI__builtin_arm_mve_vrhaddq_x_s8:
17360
case ARM::BI__builtin_arm_mve_vrhaddq_x_u8:
17361
case ARM::BI__builtin_arm_mve_vrmulhq_x_s8:
17362
case ARM::BI__builtin_arm_mve_vrmulhq_x_u8:
17363
case ARM::BI__builtin_arm_mve_vrshrq_x_n_s8:
17364
case ARM::BI__builtin_arm_mve_vrshrq_x_n_u8:
17365
case ARM::BI__builtin_arm_mve_vshrq_x_n_s8:
17366
case ARM::BI__builtin_arm_mve_vshrq_x_n_u8: {
17367
  uint32_t  Param0;
17368
  Intrinsic::ID  Param1;
17369
  switch (BuiltinID) {
17370
  case ARM::BI__builtin_arm_mve_vabdq_x_s8:
17371
    Param0 = 0;
17372
    Param1 = Intrinsic::arm_mve_abd_predicated;
17373
    break;
17374
  case ARM::BI__builtin_arm_mve_vabdq_x_u8:
17375
    Param0 = 1;
17376
    Param1 = Intrinsic::arm_mve_abd_predicated;
17377
    break;
17378
  case ARM::BI__builtin_arm_mve_vhaddq_x_s8:
17379
    Param0 = 0;
17380
    Param1 = Intrinsic::arm_mve_hadd_predicated;
17381
    break;
17382
  case ARM::BI__builtin_arm_mve_vhaddq_x_u8:
17383
    Param0 = 1;
17384
    Param1 = Intrinsic::arm_mve_hadd_predicated;
17385
    break;
17386
  case ARM::BI__builtin_arm_mve_vhsubq_x_s8:
17387
    Param0 = 0;
17388
    Param1 = Intrinsic::arm_mve_hsub_predicated;
17389
    break;
17390
  case ARM::BI__builtin_arm_mve_vhsubq_x_u8:
17391
    Param0 = 1;
17392
    Param1 = Intrinsic::arm_mve_hsub_predicated;
17393
    break;
17394
  case ARM::BI__builtin_arm_mve_vmaxq_x_s8:
17395
    Param0 = 0;
17396
    Param1 = Intrinsic::arm_mve_max_predicated;
17397
    break;
17398
  case ARM::BI__builtin_arm_mve_vmaxq_x_u8:
17399
    Param0 = 1;
17400
    Param1 = Intrinsic::arm_mve_max_predicated;
17401
    break;
17402
  case ARM::BI__builtin_arm_mve_vminq_x_s8:
17403
    Param0 = 0;
17404
    Param1 = Intrinsic::arm_mve_min_predicated;
17405
    break;
17406
  case ARM::BI__builtin_arm_mve_vminq_x_u8:
17407
    Param0 = 1;
17408
    Param1 = Intrinsic::arm_mve_min_predicated;
17409
    break;
17410
  case ARM::BI__builtin_arm_mve_vmulhq_x_s8:
17411
    Param0 = 0;
17412
    Param1 = Intrinsic::arm_mve_mulh_predicated;
17413
    break;
17414
  case ARM::BI__builtin_arm_mve_vmulhq_x_u8:
17415
    Param0 = 1;
17416
    Param1 = Intrinsic::arm_mve_mulh_predicated;
17417
    break;
17418
  case ARM::BI__builtin_arm_mve_vrhaddq_x_s8:
17419
    Param0 = 0;
17420
    Param1 = Intrinsic::arm_mve_rhadd_predicated;
17421
    break;
17422
  case ARM::BI__builtin_arm_mve_vrhaddq_x_u8:
17423
    Param0 = 1;
17424
    Param1 = Intrinsic::arm_mve_rhadd_predicated;
17425
    break;
17426
  case ARM::BI__builtin_arm_mve_vrmulhq_x_s8:
17427
    Param0 = 0;
17428
    Param1 = Intrinsic::arm_mve_rmulh_predicated;
17429
    break;
17430
  case ARM::BI__builtin_arm_mve_vrmulhq_x_u8:
17431
    Param0 = 1;
17432
    Param1 = Intrinsic::arm_mve_rmulh_predicated;
17433
    break;
17434
  case ARM::BI__builtin_arm_mve_vrshrq_x_n_s8:
17435
    Param0 = 0;
17436
    Param1 = Intrinsic::arm_mve_vrshr_imm_predicated;
17437
    break;
17438
  case ARM::BI__builtin_arm_mve_vrshrq_x_n_u8:
17439
    Param0 = 1;
17440
    Param1 = Intrinsic::arm_mve_vrshr_imm_predicated;
17441
    break;
17442
  case ARM::BI__builtin_arm_mve_vshrq_x_n_s8:
17443
    Param0 = 0;
17444
    Param1 = Intrinsic::arm_mve_shr_imm_predicated;
17445
    break;
17446
  case ARM::BI__builtin_arm_mve_vshrq_x_n_u8:
17447
    Param0 = 1;
17448
    Param1 = Intrinsic::arm_mve_shr_imm_predicated;
17449
    break;
17450
  }
17451
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17452
  Value *Val1 = UndefValue::get(Val0);
17453
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17454
  Value *Val3 = EmitScalarExpr(E->getArg(1));
17455
  Value *Val4 = llvm::ConstantInt::get(Int32Ty, Param0);
17456
  Value *Val5 = EmitScalarExpr(E->getArg(2));
17457
  Value *Val6 = Builder.CreateIntCast(Val5, Int32Ty, false);
17458
  Value *Val7 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val6});
17459
  return Builder.CreateCall(CGM.getIntrinsic(Param1, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val3, Val4, Val7, Val1});
17460
}
17461
case ARM::BI__builtin_arm_mve_vrev16q_x_s8:
17462
case ARM::BI__builtin_arm_mve_vrev16q_x_u8:
17463
case ARM::BI__builtin_arm_mve_vrev32q_x_s8:
17464
case ARM::BI__builtin_arm_mve_vrev32q_x_u8:
17465
case ARM::BI__builtin_arm_mve_vrev64q_x_s8:
17466
case ARM::BI__builtin_arm_mve_vrev64q_x_u8: {
17467
  uint32_t  Param0;
17468
  switch (BuiltinID) {
17469
  case ARM::BI__builtin_arm_mve_vrev16q_x_s8:
17470
    Param0 = 16;
17471
    break;
17472
  case ARM::BI__builtin_arm_mve_vrev16q_x_u8:
17473
    Param0 = 16;
17474
    break;
17475
  case ARM::BI__builtin_arm_mve_vrev32q_x_s8:
17476
    Param0 = 32;
17477
    break;
17478
  case ARM::BI__builtin_arm_mve_vrev32q_x_u8:
17479
    Param0 = 32;
17480
    break;
17481
  case ARM::BI__builtin_arm_mve_vrev64q_x_s8:
17482
    Param0 = 64;
17483
    break;
17484
  case ARM::BI__builtin_arm_mve_vrev64q_x_u8:
17485
    Param0 = 64;
17486
    break;
17487
  }
17488
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17489
  Value *Val1 = UndefValue::get(Val0);
17490
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17491
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param0);
17492
  Value *Val4 = EmitScalarExpr(E->getArg(1));
17493
  Value *Val5 = Builder.CreateIntCast(Val4, Int32Ty, false);
17494
  Value *Val6 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val5});
17495
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vrev_predicated, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val3, Val6, Val1});
17496
}
17497
case ARM::BI__builtin_arm_mve_vandq_x_s8:
17498
case ARM::BI__builtin_arm_mve_vandq_x_u8:
17499
case ARM::BI__builtin_arm_mve_vbicq_x_s8:
17500
case ARM::BI__builtin_arm_mve_vbicq_x_u8:
17501
case ARM::BI__builtin_arm_mve_veorq_x_s8:
17502
case ARM::BI__builtin_arm_mve_veorq_x_u8:
17503
case ARM::BI__builtin_arm_mve_vornq_x_s8:
17504
case ARM::BI__builtin_arm_mve_vornq_x_u8:
17505
case ARM::BI__builtin_arm_mve_vorrq_x_s8:
17506
case ARM::BI__builtin_arm_mve_vorrq_x_u8: {
17507
  Intrinsic::ID  Param0;
17508
  switch (BuiltinID) {
17509
  case ARM::BI__builtin_arm_mve_vandq_x_s8:
17510
    Param0 = Intrinsic::arm_mve_and_predicated;
17511
    break;
17512
  case ARM::BI__builtin_arm_mve_vandq_x_u8:
17513
    Param0 = Intrinsic::arm_mve_and_predicated;
17514
    break;
17515
  case ARM::BI__builtin_arm_mve_vbicq_x_s8:
17516
    Param0 = Intrinsic::arm_mve_bic_predicated;
17517
    break;
17518
  case ARM::BI__builtin_arm_mve_vbicq_x_u8:
17519
    Param0 = Intrinsic::arm_mve_bic_predicated;
17520
    break;
17521
  case ARM::BI__builtin_arm_mve_veorq_x_s8:
17522
    Param0 = Intrinsic::arm_mve_eor_predicated;
17523
    break;
17524
  case ARM::BI__builtin_arm_mve_veorq_x_u8:
17525
    Param0 = Intrinsic::arm_mve_eor_predicated;
17526
    break;
17527
  case ARM::BI__builtin_arm_mve_vornq_x_s8:
17528
    Param0 = Intrinsic::arm_mve_orn_predicated;
17529
    break;
17530
  case ARM::BI__builtin_arm_mve_vornq_x_u8:
17531
    Param0 = Intrinsic::arm_mve_orn_predicated;
17532
    break;
17533
  case ARM::BI__builtin_arm_mve_vorrq_x_s8:
17534
    Param0 = Intrinsic::arm_mve_orr_predicated;
17535
    break;
17536
  case ARM::BI__builtin_arm_mve_vorrq_x_u8:
17537
    Param0 = Intrinsic::arm_mve_orr_predicated;
17538
    break;
17539
  }
17540
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17541
  Value *Val1 = UndefValue::get(Val0);
17542
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17543
  llvm::Type *Val3 = llvm::FixedVectorType::get(Int8Ty, 16);
17544
  Value *Val4 = Builder.CreateBitCast(Val2, Val3);
17545
  Value *Val5 = EmitScalarExpr(E->getArg(1));
17546
  llvm::Type *Val6 = llvm::FixedVectorType::get(Int8Ty, 16);
17547
  Value *Val7 = Builder.CreateBitCast(Val5, Val6);
17548
  Value *Val8 = EmitScalarExpr(E->getArg(2));
17549
  Value *Val9 = Builder.CreateIntCast(Val8, Int32Ty, false);
17550
  Value *Val10 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val9});
17551
  llvm::Type *Val11 = llvm::FixedVectorType::get(Int8Ty, 16);
17552
  Value *Val12 = Builder.CreateBitCast(Val1, Val11);
17553
  Value *Val13 = Builder.CreateCall(CGM.getIntrinsic(Param0, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val4, Val7, Val10, Val12});
17554
  llvm::Type *Val14 = llvm::FixedVectorType::get(Int8Ty, 16);
17555
  return Builder.CreateBitCast(Val13, Val14);
17556
}
17557
case ARM::BI__builtin_arm_mve_vdupq_x_n_s8:
17558
case ARM::BI__builtin_arm_mve_vdupq_x_n_u8: {
17559
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17560
  Value *Val1 = UndefValue::get(Val0);
17561
  Value *Val2 = EmitScalarExpr(E->getArg(1));
17562
  Value *Val3 = Builder.CreateIntCast(Val2, Int32Ty, false);
17563
  Value *Val4 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val3});
17564
  Value *Val5 = EmitScalarExpr(E->getArg(0));
17565
  Value *Val6 = ARMMVEVectorSplat(Builder, Val5);
17566
  return Builder.CreateSelect(Val4, Val6, Val1);
17567
}
17568
case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_s8:
17569
case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_u8:
17570
case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_s8:
17571
case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_u8:
17572
case ARM::BI__builtin_arm_mve_vhcaddq_rot270_x_s8:
17573
case ARM::BI__builtin_arm_mve_vhcaddq_rot90_x_s8: {
17574
  uint32_t  Param0;
17575
  uint32_t  Param1;
17576
  switch (BuiltinID) {
17577
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_s8:
17578
    Param0 = 1;
17579
    Param1 = 1;
17580
    break;
17581
  case ARM::BI__builtin_arm_mve_vcaddq_rot270_x_u8:
17582
    Param0 = 1;
17583
    Param1 = 1;
17584
    break;
17585
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_s8:
17586
    Param0 = 1;
17587
    Param1 = 0;
17588
    break;
17589
  case ARM::BI__builtin_arm_mve_vcaddq_rot90_x_u8:
17590
    Param0 = 1;
17591
    Param1 = 0;
17592
    break;
17593
  case ARM::BI__builtin_arm_mve_vhcaddq_rot270_x_s8:
17594
    Param0 = 0;
17595
    Param1 = 1;
17596
    break;
17597
  case ARM::BI__builtin_arm_mve_vhcaddq_rot90_x_s8:
17598
    Param0 = 0;
17599
    Param1 = 0;
17600
    break;
17601
  }
17602
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17603
  Value *Val1 = UndefValue::get(Val0);
17604
  Value *Val2 = llvm::ConstantInt::get(Int32Ty, Param0);
17605
  Value *Val3 = llvm::ConstantInt::get(Int32Ty, Param1);
17606
  Value *Val4 = EmitScalarExpr(E->getArg(0));
17607
  Value *Val5 = EmitScalarExpr(E->getArg(1));
17608
  Value *Val6 = EmitScalarExpr(E->getArg(2));
17609
  Value *Val7 = Builder.CreateIntCast(Val6, Int32Ty, false);
17610
  Value *Val8 = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_pred_i2v, {llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val7});
17611
  return Builder.CreateCall(CGM.getIntrinsic(Intrinsic::arm_mve_vcaddq_predicated, {llvm::FixedVectorType::get(Int8Ty, 16), llvm::FixedVectorType::get(Builder.getInt1Ty(), 16)}), {Val2, Val3, Val1, Val4, Val5, Val8});
17612
}
17613
case ARM::BI__builtin_arm_mve_vnegq_s8: {
17614
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17615
  Value *Val1 = llvm::Constant::getNullValue(Val0);
17616
  Value *Val2 = EmitScalarExpr(E->getArg(0));
17617
  return Builder.CreateSub(Val1, Val2);
17618
}
17619
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_s8:
17620
case ARM::BI__builtin_arm_mve_vuninitializedq_polymorphic_u8:
17621
case ARM::BI__builtin_arm_mve_vuninitializedq_s8:
17622
case ARM::BI__builtin_arm_mve_vuninitializedq_u8: {
17623
  llvm::Type *Val0 = llvm::FixedVectorType::get(Int8Ty, 16);
17624
  return UndefValue::get(Val0);
17625
}