@@ -2283,6 +2283,21 @@ multiclass XVPatCompare_VI<string intrinsic, string inst,
2283
2283
}
2284
2284
}
2285
2285
2286
+ multiclass XVPseudoVMINMAX_VV_VX {
2287
+ foreach m = MxListXTHeadV in {
2288
+ defvar mx = m.MX;
2289
+ defvar WriteVIMinMaxV_MX = !cast<SchedWrite>("WriteVIMinMaxV_" # mx);
2290
+ defvar WriteVIMinMaxX_MX = !cast<SchedWrite>("WriteVIMinMaxX_" # mx);
2291
+ defvar ReadVIMinMaxV_MX = !cast<SchedRead>("ReadVIMinMaxV_" # mx);
2292
+ defvar ReadVIMinMaxX_MX = !cast<SchedRead>("ReadVIMinMaxX_" # mx);
2293
+
2294
+ defm "" : XVPseudoBinaryV_VV<m>,
2295
+ Sched<[WriteVIMinMaxV_MX, ReadVIMinMaxV_MX, ReadVIMinMaxV_MX, ReadVMask]>;
2296
+ defm "" : XVPseudoBinaryV_VX<m>,
2297
+ Sched<[WriteVIMinMaxX_MX, ReadVIMinMaxV_MX, ReadVIMinMaxX_MX, ReadVMask]>;
2298
+ }
2299
+ }
2300
+
2286
2301
multiclass XVPatBinaryV_VV_VX_VI<string intrinsic, string instruction,
2287
2302
list<VTypeInfo> vtilist, Operand ImmType = simm5>
2288
2303
: XVPatBinaryV_VV<intrinsic, instruction, vtilist>,
@@ -2577,6 +2592,23 @@ let Predicates = [HasVendorXTHeadV] in {
2577
2592
defm : XVPatCompare_VI<"int_riscv_th_vmsltu", "PseudoTH_VMSLEU", simm5_plus1_nonzero>;
2578
2593
} // Predicates = [HasVendorXTHeadV]
2579
2594
2595
+ //===----------------------------------------------------------------------===//
2596
+ // 12.8. Vector Integer Min/Max Instructions
2597
+ //===----------------------------------------------------------------------===//
2598
+ let Predicates = [HasVendorXTHeadV] in {
2599
+ defm PseudoTH_VMINU : XVPseudoVMINMAX_VV_VX;
2600
+ defm PseudoTH_VMIN : XVPseudoVMINMAX_VV_VX;
2601
+ defm PseudoTH_VMAXU : XVPseudoVMINMAX_VV_VX;
2602
+ defm PseudoTH_VMAX : XVPseudoVMINMAX_VV_VX;
2603
+ } // Predicates = [HasVendorXTHeadV]
2604
+
2605
+ let Predicates = [HasVendorXTHeadV] in {
2606
+ defm : XVPatBinaryV_VV_VX<"int_riscv_th_vminu", "PseudoTH_VMINU", AllIntegerXVectors>;
2607
+ defm : XVPatBinaryV_VV_VX<"int_riscv_th_vmin", "PseudoTH_VMIN", AllIntegerXVectors>;
2608
+ defm : XVPatBinaryV_VV_VX<"int_riscv_th_vmaxu", "PseudoTH_VMAXU", AllIntegerXVectors>;
2609
+ defm : XVPatBinaryV_VV_VX<"int_riscv_th_vmax", "PseudoTH_VMAX", AllIntegerXVectors>;
2610
+ }
2611
+
2580
2612
//===----------------------------------------------------------------------===//
2581
2613
// 12.14. Vector Integer Merge and Move Instructions
2582
2614
//===----------------------------------------------------------------------===//
0 commit comments