Skip to content

Commit 5eb7191

Browse files
committed
[RISCV] Add VP patterns for vandn.[vv,vx]
This builds upon D155433 Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D155434
1 parent 26ff4c6 commit 5eb7191

File tree

2 files changed

+1471
-0
lines changed

2 files changed

+1471
-0
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,45 @@ multiclass VPatUnaryVL_V<SDPatternOperator op, string instruction_name> {
274274
}
275275
}
276276

277+
foreach vti = AllIntegerVectors in {
278+
let Predicates = !listconcat([HasStdExtZvbb],
279+
GetVTypePredicates<vti>.Predicates) in {
280+
def : Pat<(vti.Vector (riscv_and_vl (riscv_xor_vl
281+
(vti.Vector vti.RegClass:$rs1),
282+
(riscv_splat_vector -1),
283+
(vti.Vector vti.RegClass:$merge),
284+
(vti.Mask V0),
285+
VLOpFrag),
286+
(vti.Vector vti.RegClass:$rs2),
287+
(vti.Vector vti.RegClass:$merge),
288+
(vti.Mask V0),
289+
VLOpFrag)),
290+
(!cast<Instruction>("PseudoVANDN_VV_"#vti.LMul.MX#"_MASK")
291+
vti.RegClass:$merge,
292+
vti.RegClass:$rs2,
293+
vti.RegClass:$rs1,
294+
(vti.Mask V0),
295+
GPR:$vl,
296+
vti.Log2SEW,
297+
TAIL_AGNOSTIC)>;
298+
299+
def : Pat<(vti.Vector (riscv_and_vl (riscv_splat_vector
300+
(not vti.ScalarRegClass:$rs1)),
301+
(vti.Vector vti.RegClass:$rs2),
302+
(vti.Vector vti.RegClass:$merge),
303+
(vti.Mask V0),
304+
VLOpFrag)),
305+
(!cast<Instruction>("PseudoVANDN_VX_"#vti.LMul.MX#"_MASK")
306+
vti.RegClass:$merge,
307+
vti.RegClass:$rs2,
308+
vti.ScalarRegClass:$rs1,
309+
(vti.Mask V0),
310+
GPR:$vl,
311+
vti.Log2SEW,
312+
TAIL_AGNOSTIC)>;
313+
}
314+
}
315+
277316
defm : VPatUnaryVL_V<riscv_bitreverse_vl, "PseudoVBREV">;
278317
defm : VPatUnaryVL_V<riscv_bswap_vl, "PseudoVREV8">;
279318
defm : VPatUnaryVL_V<riscv_ctlz_vl, "PseudoVCLZ">;

0 commit comments

Comments
 (0)