@@ -229,6 +229,14 @@ multiclass Binary_rv_vv<
229
229
defm : Binary_vv<OpNode, DataVT, MaskVT, OpBaseName>;
230
230
}
231
231
232
+ multiclass Binary_rv_vr_vv<
233
+ SDPatternOperator OpNode,
234
+ ValueType ScalarVT, ValueType DataVT, ValueType MaskVT,
235
+ string OpBaseName> {
236
+ defm : Binary_rv<OpNode, ScalarVT, DataVT, MaskVT, OpBaseName>;
237
+ defm : Binary_vr_vv<OpNode, ScalarVT, DataVT, MaskVT, OpBaseName>;
238
+ }
239
+
232
240
// Expand both 64bit and 32 bit variant (256 elements)
233
241
multiclass Binary_rv_vv_ShortLong<
234
242
SDPatternOperator OpNode,
@@ -254,23 +262,6 @@ multiclass Binary_vr_vv_ShortLong<
254
262
ShortOpBaseName>;
255
263
}
256
264
257
- // Binary operators that support broadcasts on LHS and RHS.
258
- multiclass Binary_all<
259
- SDPatternOperator OpNode,
260
- ValueType ScalarVT, ValueType DataVT,
261
- ValueType MaskVT, string OpBaseName> {
262
- defm : Binary_rv<OpNode, ScalarVT, DataVT, MaskVT, OpBaseName>;
263
- defm : Binary_vr_vv<OpNode, ScalarVT, DataVT, MaskVT, OpBaseName>;
264
- }
265
-
266
- multiclass Binary_ShortLong<
267
- SDPatternOperator OpNode,
268
- ValueType LongScalarVT, ValueType LongDataVT, string LongOpBaseName,
269
- ValueType ShortScalarVT, ValueType ShortDataVT, string ShortOpBaseName> {
270
- defm : Binary_all<OpNode, LongScalarVT, LongDataVT, v256i1, LongOpBaseName>;
271
- defm : Binary_all<OpNode, ShortScalarVT, ShortDataVT, v256i1, ShortOpBaseName>;
272
- }
273
-
274
265
multiclass Ternary<
275
266
SDPatternOperator OpNode,
276
267
ValueType ScalarVT, ValueType DataVT,
@@ -332,6 +323,18 @@ multiclass Ternary_ShortLong<
332
323
// Integer arithmetic (256 elements)
333
324
defm : Unary_ShortLong<vvp_ctpop, i64, v256i64, "VPCNT", i32, v256i32, "PVPCNTLO">;
334
325
326
+ multiclass Binary_rv_vr_vv_ShortLong<
327
+ SDPatternOperator OpNode,
328
+ ValueType LongScalarVT, ValueType LongDataVT, string LongOpBaseName,
329
+ ValueType ShortScalarVT, ValueType ShortDataVT, string ShortOpBaseName> {
330
+ defm : Binary_rv_vr_vv<OpNode,
331
+ LongScalarVT, LongDataVT, v256i1,
332
+ LongOpBaseName>;
333
+ defm : Binary_rv_vr_vv<OpNode,
334
+ ShortScalarVT, ShortDataVT, v256i1,
335
+ ShortOpBaseName>;
336
+ }
337
+
335
338
defm : Binary_rv_vv_ShortLong<c_vvp_add,
336
339
i64, v256i64, "VADDSL",
337
340
i32, v256i32, "VADDSWSX">;
@@ -341,6 +344,12 @@ defm : Binary_rv_vv_ShortLong<vvp_sub,
341
344
defm : Binary_rv_vv_ShortLong<c_vvp_mul,
342
345
i64, v256i64, "VMULSL",
343
346
i32, v256i32, "VMULSWSX">;
347
+ defm : Binary_rv_vr_vv_ShortLong<vvp_sdiv,
348
+ i64, v256i64, "VDIVSL",
349
+ i32, v256i32, "VDIVSWSX">;
350
+ defm : Binary_rv_vr_vv_ShortLong<vvp_udiv,
351
+ i64, v256i64, "VDIVUL",
352
+ i32, v256i32, "VDIVUW">;
344
353
defm : Binary_rv_vv_ShortLong<c_vvp_and,
345
354
i64, v256i64, "VAND",
346
355
i32, v256i32, "PVANDLO">;
@@ -351,9 +360,6 @@ defm : Binary_rv_vv_ShortLong<c_vvp_xor,
351
360
i64, v256i64, "VXOR",
352
361
i32, v256i32, "PVXORLO">;
353
362
354
- defm : Binary_ShortLong<vvp_sdiv, i64, v256i64, "VDIVSL", i32, v256i32, "VDIVSWSX">;
355
- defm : Binary_ShortLong<vvp_udiv, i64, v256i64, "VDIVUL", i32, v256i32, "VDIVUW">;
356
-
357
363
defm : Binary_vr_vv_ShortLong<vvp_shl,
358
364
i64, v256i64, "VSLL",
359
365
i32, v256i32, "PVSLLLO">;
@@ -370,7 +376,7 @@ defm : Unary_ShortLong<vvp_fsqrt, f64, v256f64, "VFSQRTD", f32, v256f32, "VFSQRT
370
376
defm : Binary_rv_vv_ShortLong<c_vvp_fadd, f64, v256f64, "VFADDD", f32, v256f32, "PVFADDUP">;
371
377
defm : Binary_rv_vv_ShortLong<vvp_fsub, f64, v256f64, "VFSUBD", f32, v256f32, "PVFSUBUP">;
372
378
defm : Binary_rv_vv_ShortLong<c_vvp_fmul, f64, v256f64, "VFMULD", f32, v256f32, "PVFMULUP">;
373
- defm : Binary_ShortLong <vvp_fdiv, f64, v256f64, "VFDIVD", f32, v256f32, "VFDIVS">;
379
+ defm : Binary_rv_vr_vv_ShortLong <vvp_fdiv, f64, v256f64, "VFDIVD", f32, v256f32, "VFDIVS">;
374
380
375
381
defm : Binary_rv_vv_ShortLong<c_vvp_fminnum, f64, v256f64, "VFMIND", f32, v256f32, "VFMINS">;
376
382
defm : Binary_rv_vv_ShortLong<c_vvp_fmaxnum, f64, v256f64, "VFMAXD", f32, v256f32, "VFMAXS">;
0 commit comments