diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoV.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoV.td @@ -108,23 +108,49 @@ ReadVLDX, ReadVMask ]>; +class VLESchedMask : Sched<[ + !cast("WriteVLDE_" # lmul), + !cast("ReadVMergeOp_" # lmul), ReadVLDX, ReadVMask +]>; + class VSESched : Sched<[ !cast("WriteVSTE_" #lmul), !cast("ReadVSTEV_" #lmul), ReadVSTX, ReadVMask ]>; +class VSESchedMask : Sched<[ + !cast("WriteVSTE_" # lmul), + !cast("ReadVMergeOp_" # lmul), + !cast("ReadVSTEV_" # lmul), ReadVSTX, ReadVMask, +]>; + class VLSSched : Sched<[ !cast("WriteVLDS" #eew #"_" #emul), ReadVLDX, ReadVLDSX, ReadVMask ]>; +class VLSSchedMask : Sched<[ + !cast("WriteVLDS" # eew #"_" #emul), + !cast("ReadVMergeOp_" # emul # "_E" # eew), ReadVLDX, ReadVLDSX, + ReadVMask +]>; + + class VSSSched : Sched<[ !cast("WriteVSTS" #eew #"_" #emul), !cast("ReadVSTS" #eew #"V_" #emul), ReadVSTX, ReadVSTSX, ReadVMask ]>; +class VSSSchedMask : Sched<[ + !cast("WriteVSTS" #eew #"_" #emul), + !cast("ReadVMergeOp_" # emul # "_E" # eew), + !cast("ReadVSTS" #eew #"V_" #emul), ReadVSTX, ReadVSTSX, + ReadVMask +]>; + + class VLXSched : Sched<[ @@ -133,6 +159,15 @@ !cast("ReadVLD" #isOrdered #"XV_" #idxEMUL), ReadVMask ]>; +class VLXSchedMask : Sched<[ + !cast("WriteVLD" #isOrdered #"X" #dataEEW #"_" #dataEMUL), + !cast("ReadVMergeOp_" # dataEMUL # "_E" # dataEEW), ReadVLDX, + !cast("ReadVLD" #isOrdered #"XV_" #idxEMUL), ReadVMask, +]>; + + class VSXSched : Sched<[ @@ -141,45 +176,101 @@ ReadVSTX, !cast("ReadVST" #isOrdered #"XV_" #idxEMUL), ReadVMask ]>; +class VSXSchedMask : Sched<[ + !cast("WriteVST" #isOrdered #"X" #dataEEW #"_" #dataEMUL), + !cast("ReadVMergeOp_" # dataEMUL # "_E" # dataEEW), + !cast("ReadVST" #isOrdered #"X" #dataEEW #"_" #dataEMUL), + ReadVSTX, !cast("ReadVST" #isOrdered #"XV_" #idxEMUL), + ReadVMask +]>; + + class VLFSched : Sched<[ !cast("WriteVLDFF_" #lmul), ReadVLDX, ReadVMask ]>; +class VLFSchedMask : Sched<[ + !cast("WriteVLDFF_" # lmul), + !cast("ReadVMergeOp_" # lmul), ReadVLDX, ReadVMask, +]>; + // Unit-Stride Segment Loads and Stores class VLSEGSched : Sched<[ !cast("WriteVLSEG" #nf #"e" #eew #"_" #emul), ReadVLDX, ReadVMask ]>; +class VLSEGSchedMask : Sched<[ + !cast("WriteVLSEG" #nf #"e" #eew #"_" #emul), + !cast("ReadVMergeOp_" # emul # "_E" # eew), ReadVLDX, ReadVMask +]>; + class VSSEGSched : Sched<[ !cast("WriteVSSEG" #nf #"e" #eew #"_" #emul), !cast("ReadVSTEV_" #emul), ReadVSTX, ReadVMask ]>; +class VSSEGSchedMask : Sched<[ + !cast("WriteVSSEG" #nf #"e" #eew #"_" #emul), + !cast("ReadVMergeOp_" # emul # "_E" # eew), + !cast("ReadVSTEV_" #emul), ReadVSTX, ReadVMask +]>; + class VLSEGFFSched : Sched<[ !cast("WriteVLSEGFF" #nf #"e" #eew #"_" #emul), ReadVLDX, ReadVMask ]>; +class VLSEGFFSchedMask : Sched<[ + !cast("WriteVLSEGFF" #nf #"e" #eew #"_" #emul), + !cast("ReadVMergeOp_" # emul # "_E" # eew), ReadVLDX, ReadVMask +]>; + // Strided Segment Loads and Stores class VLSSEGSched : Sched<[ !cast("WriteVLSSEG" #nf #"e" #eew #"_" #emul), ReadVLDX, ReadVLDSX, ReadVMask ]>; +class VLSSEGSchedMask : Sched<[ + !cast("WriteVLSSEG" #nf #"e" #eew #"_" #emul), + !cast("ReadVMergeOp_" # emul # "_E" # eew), ReadVLDX, ReadVLDSX, + ReadVMask +]>; + class VSSSEGSched : Sched<[ !cast("WriteVSSSEG" #nf #"e" #eew #"_" #emul), !cast("ReadVSTS" #eew #"V_" #emul), ReadVSTX, ReadVSTSX, ReadVMask ]>; +class VSSSEGSchedMask : Sched<[ + !cast("WriteVSSSEG" #nf #"e" #eew #"_" #emul), + !cast("ReadVMergeOp_" # emul # "_E" # eew), + !cast("ReadVSTS" #eew #"V_" #emul), ReadVSTX, ReadVSTSX, + ReadVMask +]>; + // Indexed Segment Loads and Stores class VLXSEGSched : Sched<[ !cast("WriteVL" #isOrdered #"XSEG" #nf #"e" #eew #"_" #emul), ReadVLDX, !cast("ReadVLD" #isOrdered #"XV_" #emul), ReadVMask ]>; +class VLXSEGSchedMask : Sched<[ + !cast("WriteVL" #isOrdered #"XSEG" #nf #"e" #eew #"_" #emul), + !cast("ReadVMergeOp_" # emul # "_E" # eew), ReadVLDX, + !cast("ReadVLD" #isOrdered #"XV_" #emul), ReadVMask +]>; class VSXSEGSched : Sched<[ !cast("WriteVS" #isOrdered #"XSEG" #nf #"e" #eew #"_" #emul), !cast("ReadVST" #isOrdered #"X" #eew #"_" #emul), ReadVSTX, !cast("ReadVST" #isOrdered #"XV_" #emul), ReadVMask ]>; +class VSXSEGSchedMask : Sched<[ + !cast("WriteVS" #isOrdered #"XSEG" #nf #"e" #eew #"_" #emul), + !cast("ReadVMergeOp_" # emul), + !cast("ReadVST" #isOrdered #"X" #eew #"_" #emul), ReadVSTX, + !cast("ReadVST" #isOrdered #"XV_" #emul), ReadVMask +]>; //===----------------------------------------------------------------------===// // Instruction class templates diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td @@ -253,6 +253,11 @@ true: m.MX)); } +// Helper subroutine used to insert ToInsert at index 1 of Lst. +class InsertAtIdx1 Lst, SchedReadWrite ToInsert> { + list l = !listconcat([!head(Lst)], [ToInsert], !tail(Lst)); +} + //===----------------------------------------------------------------------===// // Vector register and vector group type information. //===----------------------------------------------------------------------===// @@ -1715,7 +1720,7 @@ def "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoUSLoadMask, RISCVMaskedPseudo, - VLESched; + VLESchedMask; } } } @@ -1733,7 +1738,7 @@ def "E" # eew # "FF_V_" # LInfo # "_MASK": VPseudoUSLoadFFMask, RISCVMaskedPseudo, - VLFSched; + VLFSchedMask; } } } @@ -1761,7 +1766,7 @@ def "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoSLoadMask, RISCVMaskedPseudo, - VLSSched; + VLSSchedMask; } } } @@ -1790,7 +1795,7 @@ def "EI" # idxEEW # "_V_" # IdxLInfo # "_" # DataLInfo # "_MASK" : VPseudoILoadMask, RISCVMaskedPseudo, - VLXSched; + VLXSchedMask; } } } @@ -1807,7 +1812,7 @@ def "E" # eew # "_V_" # LInfo : VPseudoUSStoreNoMask, VSESched; def "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoUSStoreMask, - VSESched; + VSESchedMask; } } } @@ -1833,7 +1838,7 @@ def "E" # eew # "_V_" # LInfo : VPseudoSStoreNoMask, VSSSched; def "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoSStoreMask, - VSSSched; + VSSSchedMask; } } } @@ -1860,7 +1865,7 @@ VSXSched; def "EI" # idxEEW # "_V_" # IdxLInfo # "_" # DataLInfo # "_MASK" : VPseudoIStoreMask, - VSXSched; + VSXSchedMask; } } } @@ -1873,11 +1878,15 @@ defvar mx = mti.LMul.MX; defvar WriteVMPopV_MX = !cast("WriteVMPopV_" # mx); defvar ReadVMPopV_MX = !cast("ReadVMPopV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + let VLMul = mti.LMul.value in { def "_M_" # mti.BX : VPseudoUnaryNoMaskGPROut, - Sched<[WriteVMPopV_MX, ReadVMPopV_MX, ReadVMPopV_MX]>; + Sched<[WriteVMPopV_MX, ReadVMPopV_MX, + ReadVMPopV_MX]>; def "_M_" # mti.BX # "_MASK" : VPseudoUnaryMaskGPROut, - Sched<[WriteVMPopV_MX, ReadVMPopV_MX, ReadVMPopV_MX]>; + Sched<[WriteVMPopV_MX, ReadVMergeOp_MX, + ReadVMPopV_MX, ReadVMPopV_MX]>; } } } @@ -1887,11 +1896,15 @@ defvar mx = mti.LMul.MX; defvar WriteVMFFSV_MX = !cast("WriteVMFFSV_" # mx); defvar ReadVMFFSV_MX = !cast("ReadVMFFSV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + let VLMul = mti.LMul.value in { def "_M_" # mti.BX : VPseudoUnaryNoMaskGPROut, - Sched<[WriteVMFFSV_MX, ReadVMFFSV_MX, ReadVMFFSV_MX]>; + Sched<[WriteVMFFSV_MX, ReadVMFFSV_MX, + ReadVMFFSV_MX]>; def "_M_" # mti.BX # "_MASK" : VPseudoUnaryMaskGPROut, - Sched<[WriteVMFFSV_MX, ReadVMFFSV_MX, ReadVMFFSV_MX]>; + Sched<[WriteVMFFSV_MX, ReadVMergeOp_MX, + ReadVMFFSV_MX, ReadVMFFSV_MX]>; } } } @@ -1902,11 +1915,14 @@ defvar mx = mti.LMul.MX; defvar WriteVMSFSV_MX = !cast("WriteVMSFSV_" # mx); defvar ReadVMSFSV_MX = !cast("ReadVMSFSV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + let VLMul = mti.LMul.value in { def "_M_" # mti.BX : VPseudoUnaryNoMask, Sched<[WriteVMSFSV_MX, ReadVMSFSV_MX, ReadVMask]>; def "_M_" # mti.BX # "_MASK" : VPseudoUnaryMask, - Sched<[WriteVMSFSV_MX, ReadVMSFSV_MX, ReadVMask]>; + Sched<[WriteVMSFSV_MX, ReadVMergeOp_MX, + ReadVMSFSV_MX, ReadVMask]>; } } } @@ -1916,13 +1932,15 @@ defvar mx = m.MX; defvar WriteVMIdxV_MX = !cast("WriteVMIdxV_" # mx); defvar ReadVMIdxV_MX = !cast("ReadVMIdxV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); let VLMul = m.value in { def "_V_" # m.MX : VPseudoNullaryNoMask, Sched<[WriteVMIdxV_MX, ReadVMask]>; def "_V_" # m.MX # "_MASK" : VPseudoNullaryMask, RISCVMaskedPseudo, - Sched<[WriteVMIdxV_MX, ReadVMask]>; + Sched<[WriteVMIdxV_MX, ReadVMergeOp_MX, + ReadVMask]>; } } } @@ -1946,12 +1964,15 @@ defvar mx = m.MX; defvar WriteVMIotV_MX = !cast("WriteVMIotV_" # mx); defvar ReadVMIotV_MX = !cast("ReadVMIotV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + let VLMul = m.value in { def "_" # m.MX : VPseudoUnaryNoMask, Sched<[WriteVMIotV_MX, ReadVMIotV_MX, ReadVMask]>; def "_" # m.MX # "_MASK" : VPseudoUnaryMask, RISCVMaskedPseudo, - Sched<[WriteVMIotV_MX, ReadVMIotV_MX, ReadVMask]>; + Sched<[WriteVMIotV_MX, ReadVMergeOp_MX, + ReadVMIotV_MX, ReadVMask]>; } } } @@ -1963,12 +1984,15 @@ let VLMul = m.value in foreach e = sews in { defvar suffix = "_" # m.MX # "_E" # e; - defvar WriteVCompressV_MX_E = !cast("WriteVCompressV" # suffix); - defvar ReadVCompressV_MX_E = !cast("ReadVCompressV" # suffix); + defvar WriteVCompressV_MX_E = + !cast("WriteVCompressV" # suffix); + defvar ReadVCompressV_MX_E = + !cast("ReadVCompressV" # suffix); let SEW = e in def _VM # suffix : VPseudoUnaryAnyMask, - Sched<[WriteVCompressV_MX_E, ReadVCompressV_MX_E, ReadVCompressV_MX_E]>; + Sched<[WriteVCompressV_MX_E, ReadVCompressV_MX_E, + ReadVCompressV_MX_E]>; } } } @@ -1977,15 +2001,19 @@ VReg Op1Class, DAGOperand Op2Class, LMULInfo MInfo, + list ReadWrites, + list ReadWritesMask, string Constraint = "", int sew = 0> { let VLMul = MInfo.value, SEW=sew in { defvar suffix = !if(sew, "_" # MInfo.MX # "_E" # sew, "_" # MInfo.MX); def suffix : VPseudoBinaryNoMaskTU; + Constraint>, + Sched; def suffix # "_MASK" : VPseudoBinaryMaskPolicy, - RISCVMaskedPseudo; + RISCVMaskedPseudo, + Sched; } } @@ -1993,19 +2021,23 @@ VReg Op1Class, DAGOperand Op2Class, LMULInfo MInfo, + list ReadWrites, + list ReadWritesMask, string Constraint = "", int sew = 0, int UsesVXRM = 1> { let VLMul = MInfo.value, SEW=sew in { defvar suffix = !if(sew, "_" # MInfo.MX # "_E" # sew, "_" # MInfo.MX); def suffix : VPseudoBinaryNoMaskRoundingMode; + Constraint, UsesVXRM>, + Sched; def suffix # "_MASK" : VPseudoBinaryMaskPolicyRoundingMode, - RISCVMaskedPseudo; + RISCVMaskedPseudo, + Sched; } } @@ -2014,14 +2046,18 @@ VReg Op1Class, DAGOperand Op2Class, LMULInfo MInfo, + list ReadWrites, + list ReadWritesMask, string Constraint = ""> { let VLMul = MInfo.value in { def "_" # MInfo.MX : VPseudoBinaryMOutNoMask; + Constraint>, + Sched; let ForceTailAgnostic = true in def "_" # MInfo.MX # "_MASK" : VPseudoBinaryMOutMask, - RISCVMaskedPseudo; + RISCVMaskedPseudo, + Sched; } } @@ -2030,60 +2066,83 @@ DAGOperand Op2Class, LMULInfo lmul, LMULInfo emul, + list ReadWrites, + list ReadWritesMask, string Constraint = "", int sew = 0> { let VLMul = lmul.value, SEW=sew in { defvar suffix = !if(sew, "_" # lmul.MX # "_E" # sew, "_" # lmul.MX); - def suffix # "_" # emul.MX : VPseudoBinaryNoMaskTU; - def suffix # "_" # emul.MX # "_MASK" : VPseudoBinaryMaskPolicy, - RISCVMaskedPseudo; + def suffix # "_" # emul.MX : + VPseudoBinaryNoMaskTU, + Sched; + def suffix # "_" # emul.MX # "_MASK" : + VPseudoBinaryMaskPolicy, + RISCVMaskedPseudo, + Sched; } } multiclass VPseudoTiedBinary ReadWrites, + list ReadWritesMask, string Constraint = ""> { let VLMul = MInfo.value in { def "_" # MInfo.MX # "_TIED": VPseudoTiedBinaryNoMask; + Constraint>, + Sched; def "_" # MInfo.MX # "_MASK_TIED" : VPseudoTiedBinaryMask; + Constraint>, + Sched; } } multiclass VPseudoTiedBinaryRoundingMode ReadWrites, + list ReadWritesMask, string Constraint = ""> { let VLMul = MInfo.value in { def "_" # MInfo.MX # "_TIED": - VPseudoTiedBinaryNoMaskRoundingMode; + VPseudoTiedBinaryNoMaskRoundingMode, + Sched; def "_" # MInfo.MX # "_MASK_TIED" : - VPseudoTiedBinaryMaskRoundingMode; + VPseudoTiedBinaryMaskRoundingMode, + Sched; } } -multiclass VPseudoBinaryV_VV { - defm _VV : VPseudoBinary; +multiclass VPseudoBinaryV_VV ReadWrites, + list ReadWritesMask, + string Constraint = "", int sew = 0> { + defm _VV : VPseudoBinary; } -multiclass VPseudoBinaryV_VV_RM { - defm _VV : VPseudoBinaryRoundingMode; +multiclass VPseudoBinaryV_VV_RM ReadWrites, + list ReadWritesMask, + string Constraint = ""> { + defm _VV : VPseudoBinaryRoundingMode; } // Similar to VPseudoBinaryV_VV, but uses MxListF. -multiclass VPseudoBinaryFV_VV { - defm _VV : VPseudoBinary; +multiclass VPseudoBinaryFV_VV ReadWrites, + list ReadWritesMask, + string Constraint = "", int sew = 0> { + defm _VV : VPseudoBinary; } -multiclass VPseudoBinaryFV_VV_RM { +multiclass VPseudoBinaryFV_VV_RM ReadWrites, + list ReadWritesMask, + string Constraint = "", int sew = 0> { defm _VV : VPseudoBinaryRoundingMode; + ReadWrites, ReadWritesMask, Constraint, + sew, /* UsesVXRM = */ 0>; } multiclass VPseudoVGTR_VV_EEW { @@ -2098,23 +2157,40 @@ defvar emul = !cast("V_" # emulMX); defvar sews = SchedSEWSet.val; foreach e = sews in { - defvar WriteVRGatherVV_MX_E = !cast("WriteVRGatherVV_" # mx # "_E" # e); - defvar ReadVRGatherVV_data_MX_E = !cast("ReadVRGatherVV_data_" # mx # "_E" # e); - defvar ReadVRGatherVV_index_MX_E = !cast("ReadVRGatherVV_index_" # mx # "_E" # e); - defm _VV : VPseudoBinaryEmul, - Sched<[WriteVRGatherVV_MX_E, ReadVRGatherVV_data_MX_E, ReadVRGatherVV_index_MX_E]>; + defvar WriteVRGatherVV_MX_E = + !cast("WriteVRGatherVV_" # mx # "_E" # e); + defvar ReadVRGatherVV_data_MX_E = + !cast("ReadVRGatherVV_data_" # mx # "_E" # e); + defvar ReadVRGatherVV_index_MX_E = + !cast("ReadVRGatherVV_index_" # mx # "_E" # e); + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVRGatherVV_MX_E, ReadVRGatherVV_data_MX_E, + ReadVRGatherVV_index_MX_E]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _VV : VPseudoBinaryEmul; } } } } } -multiclass VPseudoBinaryV_VX { - defm "_VX" : VPseudoBinary; +multiclass VPseudoBinaryV_VX ReadWrites, + list ReadWritesMask, + string Constraint = "", int sew = 0> { + defm "_VX" : VPseudoBinary; } -multiclass VPseudoBinaryV_VX_RM { - defm "_VX" : VPseudoBinaryRoundingMode; +multiclass VPseudoBinaryV_VX_RM ReadWrites, + list ReadWritesMask, + string Constraint = ""> { + defm "_VX" : VPseudoBinaryRoundingMode; } multiclass VPseudoVSLD1_VX { @@ -2123,23 +2199,36 @@ defvar WriteVISlide1X_MX = !cast("WriteVISlide1X_" # mx); defvar ReadVISlideV_MX = !cast("ReadVISlideV_" # mx); defvar ReadVISlideX_MX = !cast("ReadVISlideX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "_VX" : VPseudoBinary, - Sched<[WriteVISlide1X_MX, ReadVISlideV_MX, ReadVISlideX_MX, ReadVMask]>; + defvar ReadWrites = [WriteVISlide1X_MX, ReadVISlideV_MX, ReadVISlideX_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "_VX" : VPseudoBinary; } } -multiclass VPseudoBinaryV_VF { +multiclass VPseudoBinaryV_VF ReadWrites, + list ReadWritesMask, + string Constraint = "", int sew = 0> { defm "_V" # f.FX : VPseudoBinary; + f.fprclass, m, ReadWrites, ReadWritesMask, + Constraint, sew>; } -multiclass VPseudoBinaryV_VF_RM { +multiclass VPseudoBinaryV_VF_RM ReadWrites, + list ReadWritesMask, + string Constraint = "", int sew = 0> { defm "_V" # f.FX : VPseudoBinaryRoundingMode; } + multiclass VPseudoVSLD1_VF { foreach f = FPList in { foreach m = f.MxList in { @@ -2147,20 +2236,32 @@ defvar WriteVFSlide1F_MX = !cast("WriteVFSlide1F_" # mx); defvar ReadVFSlideV_MX = !cast("ReadVFSlideV_" # mx); defvar ReadVFSlideF_MX = !cast("ReadVFSlideF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + defvar ReadWrites = [WriteVFSlide1F_MX, ReadVFSlideV_MX, ReadVFSlideF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; defm "_V" # f.FX : - VPseudoBinary, - Sched<[WriteVFSlide1F_MX, ReadVFSlideV_MX, ReadVFSlideF_MX, ReadVMask]>; + VPseudoBinary; } } } -multiclass VPseudoBinaryV_VI { - defm _VI : VPseudoBinary; +multiclass VPseudoBinaryV_VI ReadWrites, + list ReadWritesMask, + string Constraint = ""> { + defm _VI : VPseudoBinary; } -multiclass VPseudoBinaryV_VI_RM { - defm _VI : VPseudoBinaryRoundingMode; +multiclass VPseudoBinaryV_VI_RM ReadWrites, + list ReadWritesMask, + string Constraint = ""> { + defm _VI : VPseudoBinaryRoundingMode; } multiclass VPseudoVALU_MM { @@ -2183,63 +2284,83 @@ // * The destination EEW is greater than the source EEW, the source EMUL is // at least 1, and the overlap is in the highest-numbered part of the // destination register group is legal. Otherwise, it is illegal. -multiclass VPseudoBinaryW_VV { - defm _VV : VPseudoBinary; +multiclass VPseudoBinaryW_VV ReadWrites, + list ReadWritesMask> { + defm _VV : VPseudoBinary; } -multiclass VPseudoBinaryW_VV_RM { +multiclass VPseudoBinaryW_VV_RM ReadWrites, + list ReadWritesMask> { defm _VV : VPseudoBinaryRoundingMode; } -multiclass VPseudoBinaryW_VX { - defm "_VX" : VPseudoBinary; +multiclass VPseudoBinaryW_VX ReadWrites, + list ReadWritesMask> { + defm "_VX" : VPseudoBinary; } -multiclass VPseudoBinaryW_VF { +multiclass VPseudoBinaryW_VF ReadWrites, + list ReadWritesMask> { defm "_V" # f.FX : VPseudoBinary; } -multiclass VPseudoBinaryW_VF_RM { +multiclass VPseudoBinaryW_VF_RM ReadWrites, + list ReadWritesMask> { defm "_V" # f.FX : VPseudoBinaryRoundingMode; } -multiclass VPseudoBinaryW_WV { - defm _WV : VPseudoBinary; - defm _WV : VPseudoTiedBinary; +multiclass VPseudoBinaryW_WV ReadWrites, + list ReadWritesMask> { + defm _WV : VPseudoBinary; + defm _WV : VPseudoTiedBinary; } -multiclass VPseudoBinaryW_WV_RM { +multiclass VPseudoBinaryW_WV_RM ReadWrites, + list ReadWritesMask> { defm _WV : VPseudoBinaryRoundingMode; - defm _WV : VPseudoTiedBinaryRoundingMode; + defm _WV : VPseudoTiedBinaryRoundingMode; } -multiclass VPseudoBinaryW_WX { - defm "_WX" : VPseudoBinary; +multiclass VPseudoBinaryW_WX ReadWrites, + list ReadWritesMask> { + defm "_WX" : VPseudoBinary; } -multiclass VPseudoBinaryW_WF { +multiclass VPseudoBinaryW_WF ReadWrites, + list ReadWritesMask> { defm "_W" # f.FX : VPseudoBinary; + f.fprclass, m, ReadWrites, ReadWritesMask>; } -multiclass VPseudoBinaryW_WF_RM { +multiclass VPseudoBinaryW_WF_RM ReadWrites, + list ReadWritesMask> { defm "_W" # f.FX : VPseudoBinaryRoundingMode; @@ -2250,35 +2371,47 @@ // exception from the spec. // "The destination EEW is smaller than the source EEW and the overlap is in the // lowest-numbered part of the source register group." -multiclass VPseudoBinaryV_WV { - defm _WV : VPseudoBinary ReadWrites, + list ReadWritesMask> { + defm _WV : VPseudoBinary; } -multiclass VPseudoBinaryV_WV_RM { +multiclass VPseudoBinaryV_WV_RM ReadWrites, + list ReadWritesMask> { defm _WV : VPseudoBinaryRoundingMode; } -multiclass VPseudoBinaryV_WX { - defm _WX : VPseudoBinary ReadWrites, + list ReadWritesMask> { + defm _WX : VPseudoBinary; } -multiclass VPseudoBinaryV_WX_RM { +multiclass VPseudoBinaryV_WX_RM ReadWrites, + list ReadWritesMask> { defm _WX : VPseudoBinaryRoundingMode; } -multiclass VPseudoBinaryV_WI { - defm _WI : VPseudoBinary ReadWrites, + list ReadWritesMask> { + defm _WI : VPseudoBinary; } -multiclass VPseudoBinaryV_WI_RM { +multiclass VPseudoBinaryV_WI_RM ReadWrites, + list ReadWritesMask> { defm _WI : VPseudoBinaryRoundingMode; } @@ -2390,13 +2523,15 @@ defvar mx = m.MX; defvar WriteVFClassV_MX = !cast("WriteVFClassV_" # mx); defvar ReadVFClassV_MX = !cast("ReadVFClassV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); let VLMul = m.value in { def "_V_" # mx : VPseudoUnaryNoMask, Sched<[WriteVFClassV_MX, ReadVFClassV_MX, ReadVMask]>; def "_V_" # mx # "_MASK" : VPseudoUnaryMask, RISCVMaskedPseudo, - Sched<[WriteVFClassV_MX, ReadVFClassV_MX, ReadVMask]>; + Sched<[WriteVFClassV_MX, ReadVFClassV_MX, + ReadVMask, ReadVMergeOp_MX]>; } } } @@ -2411,15 +2546,18 @@ defvar suffix = "_" # mx # "_E" # e; defvar WriteVFSqrtV_MX_E = !cast("WriteVFSqrtV" # suffix); defvar ReadVFSqrtV_MX_E = !cast("ReadVFSqrtV" # suffix); + defvar ReadVMergeOp_MX_E = !cast("ReadVMergeOp" # suffix); let SEW = e in { - def "_V" # suffix : VPseudoUnaryNoMaskRoundingMode, - Sched<[WriteVFSqrtV_MX_E, ReadVFSqrtV_MX_E, - ReadVMask]>; - def "_V" # suffix # "_MASK" : VPseudoUnaryMaskRoundingMode, - RISCVMaskedPseudo, - Sched<[WriteVFSqrtV_MX_E, ReadVFSqrtV_MX_E, - ReadVMask]>; + def "_V" # suffix : + VPseudoUnaryNoMaskRoundingMode, + Sched<[WriteVFSqrtV_MX_E, ReadVFSqrtV_MX_E, + ReadVMask]>; + def "_V" # suffix # "_MASK" : + VPseudoUnaryMaskRoundingMode, + RISCVMaskedPseudo, + Sched<[WriteVFSqrtV_MX_E, ReadVFSqrtV_MX_E, + ReadVMask, ReadVMergeOp_MX_E]>; } } } @@ -2430,13 +2568,15 @@ defvar mx = m.MX; defvar WriteVFRecpV_MX = !cast("WriteVFRecpV_" # mx); defvar ReadVFRecpV_MX = !cast("ReadVFRecpV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); let VLMul = m.value in { def "_V_" # mx : VPseudoUnaryNoMask, Sched<[WriteVFRecpV_MX, ReadVFRecpV_MX, ReadVMask]>; def "_V_" # mx # "_MASK" : VPseudoUnaryMask, RISCVMaskedPseudo, - Sched<[WriteVFRecpV_MX, ReadVFRecpV_MX, ReadVMask]>; + Sched<[WriteVFRecpV_MX, ReadVFRecpV_MX, + ReadVMask, ReadVMergeOp_MX]>; } } } @@ -2446,13 +2586,15 @@ defvar mx = m.MX; defvar WriteVFRecpV_MX = !cast("WriteVFRecpV_" # mx); defvar ReadVFRecpV_MX = !cast("ReadVFRecpV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); let VLMul = m.value in { def "_V_" # mx : VPseudoUnaryNoMaskRoundingMode, Sched<[WriteVFRecpV_MX, ReadVFRecpV_MX, ReadVMask]>; - def "_V_" # mx # "_MASK" : VPseudoUnaryMaskRoundingMode, - RISCVMaskedPseudo, - Sched<[WriteVFRecpV_MX, ReadVFRecpV_MX, ReadVMask]>; + def "_V_" # mx # "_MASK" : + VPseudoUnaryMaskRoundingMode, + RISCVMaskedPseudo, + Sched<[WriteVFRecpV_MX, ReadVFRecpV_MX, ReadVMask, ReadVMergeOp_MX]>; } } } @@ -2463,6 +2605,7 @@ defvar mx = m.MX; defvar WriteVExtV_MX = !cast("WriteVExtV_" # mx); defvar ReadVExtV_MX = !cast("ReadVExtV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); let VLMul = m.value in { def "_" # mx : VPseudoUnaryNoMask, @@ -2470,7 +2613,7 @@ def "_" # mx # "_MASK" : VPseudoUnaryMask, RISCVMaskedPseudo, - Sched<[WriteVExtV_MX, ReadVExtV_MX, ReadVMask]>; + Sched<[WriteVExtV_MX, ReadVExtV_MX, ReadVMask, ReadVMergeOp_MX]>; } } } @@ -2481,6 +2624,7 @@ defvar mx = m.MX; defvar WriteVExtV_MX = !cast("WriteVExtV_" # mx); defvar ReadVExtV_MX = !cast("ReadVExtV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); let VLMul = m.value in { def "_" # mx : VPseudoUnaryNoMask, @@ -2488,7 +2632,7 @@ def "_" # mx # "_MASK" : VPseudoUnaryMask, RISCVMaskedPseudo, - Sched<[WriteVExtV_MX, ReadVExtV_MX, ReadVMask]>; + Sched<[WriteVExtV_MX, ReadVExtV_MX, ReadVMask, ReadVMergeOp_MX]>; } } } @@ -2499,6 +2643,7 @@ defvar mx = m.MX; defvar WriteVExtV_MX = !cast("WriteVExtV_" # mx); defvar ReadVExtV_MX = !cast("ReadVExtV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); let VLMul = m.value in { def "_" # mx : VPseudoUnaryNoMask, @@ -2506,7 +2651,7 @@ def "_" # mx # "_MASK" : VPseudoUnaryMask, RISCVMaskedPseudo, - Sched<[WriteVExtV_MX, ReadVExtV_MX, ReadVMask]>; + Sched<[WriteVExtV_MX, ReadVExtV_MX, ReadVMask, ReadVMergeOp_MX]>; } } } @@ -2522,25 +2667,31 @@ // lowest-numbered part of the source register group". // With LMUL<=1 the source and dest occupy a single register so any overlap // is in the lowest-numbered part. -multiclass VPseudoBinaryM_VV { - defm _VV : VPseudoBinaryM ReadWrites, + list ReadWritesMask> { + defm _VV : VPseudoBinaryM; } -multiclass VPseudoBinaryM_VX { +multiclass VPseudoBinaryM_VX ReadWrites, + list ReadWritesMask> { defm "_VX" : - VPseudoBinaryM; } -multiclass VPseudoBinaryM_VF { +multiclass VPseudoBinaryM_VF ReadWrites, + list ReadWritesMask> { defm "_V" # f.FX : - VPseudoBinaryM; } -multiclass VPseudoBinaryM_VI { - defm _VI : VPseudoBinaryM ReadWrites, + list ReadWritesMask> { + defm _VI : VPseudoBinaryM; } @@ -2552,21 +2703,33 @@ defvar ReadVRGatherVX_data_MX = !cast("ReadVRGatherVX_data_" # mx); defvar ReadVRGatherVX_index_MX = !cast("ReadVRGatherVX_index_" # mx); defvar ReadVRGatherVI_data_MX = !cast("ReadVRGatherVI_data_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVX = [WriteVRGatherVX_MX, ReadVRGatherVX_data_MX, + ReadVRGatherVX_index_MX, ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVRGatherVX_MX, ReadVRGatherVX_data_MX, - ReadVRGatherVX_index_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VI, - Sched<[WriteVRGatherVI_MX, ReadVRGatherVI_data_MX, ReadVMask]>; + defvar ReadWritesVI = [WriteVRGatherVI_MX, ReadVRGatherVI_data_MX, + ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VI; defvar sews = SchedSEWSet.val; foreach e = sews in { - defvar WriteVRGatherVV_MX_E = !cast("WriteVRGatherVV_" # mx # "_E" # e); - defvar ReadVRGatherVV_data_MX_E = !cast("ReadVRGatherVV_data_" # mx # "_E" # e); - defvar ReadVRGatherVV_index_MX_E = !cast("ReadVRGatherVV_index_" # mx # "_E" # e); - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVRGatherVV_MX_E, ReadVRGatherVV_data_MX_E, - ReadVRGatherVV_index_MX_E, ReadVMask]>; + defvar WriteVRGatherVV_MX_E = + !cast("WriteVRGatherVV_" # mx # "_E" # e); + defvar ReadVRGatherVV_data_MX_E = + !cast("ReadVRGatherVV_data_" # mx # "_E" # e); + defvar ReadVRGatherVV_index_MX_E = + !cast("ReadVRGatherVV_index_" # mx # "_E" # e); + defvar ReadVMergeOp_MX_E = !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVRGatherVV_MX_E, ReadVRGatherVV_data_MX_E, + ReadVRGatherVV_index_MX_E, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; } } } @@ -2579,17 +2742,25 @@ defvar WriteVSALUI_MX = !cast("WriteVSALUI_" # mx); defvar ReadVSALUV_MX = !cast("ReadVSALUV_" # mx); defvar ReadVSALUX_MX = !cast("ReadVSALUX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVSALUV_MX, ReadVSALUV_MX, ReadVSALUV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVSALUX_MX, ReadVSALUV_MX, ReadVSALUX_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VI, - Sched<[WriteVSALUI_MX, ReadVSALUV_MX, ReadVMask]>; + defvar ReadWritesVV = [WriteVSALUV_MX, ReadVSALUV_MX, ReadVSALUV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; + + defvar ReadWritesVX = [WriteVSALUX_MX, ReadVSALUV_MX, ReadVSALUX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; + + defvar ReadWritesVI = [WriteVSALUI_MX, ReadVSALUV_MX, ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VI; } } - multiclass VPseudoVSHT_VV_VX_VI { foreach m = MxList in { defvar mx = m.MX; @@ -2598,13 +2769,22 @@ defvar WriteVShiftI_MX = !cast("WriteVShiftI_" # mx); defvar ReadVShiftV_MX = !cast("ReadVShiftV_" # mx); defvar ReadVShiftX_MX = !cast("ReadVShiftX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVShiftV_MX, ReadVShiftV_MX, ReadVShiftV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVShiftV_MX, ReadVShiftV_MX, ReadVShiftV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVShiftX_MX, ReadVShiftV_MX, ReadVShiftX_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VI, - Sched<[WriteVShiftI_MX, ReadVShiftV_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVShiftX_MX, ReadVShiftV_MX, ReadVShiftX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; + + defvar ReadWritesVI = [WriteVShiftI_MX, ReadVShiftV_MX, ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VI; } } @@ -2616,13 +2796,24 @@ defvar WriteVSShiftI_MX = !cast("WriteVSShiftI_" # mx); defvar ReadVSShiftV_MX = !cast("ReadVSShiftV_" # mx); defvar ReadVSShiftX_MX = !cast("ReadVSShiftX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVSShiftV_MX, ReadVSShiftV_MX, ReadVSShiftV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV_RM; - defm "" : VPseudoBinaryV_VV_RM, - Sched<[WriteVSShiftV_MX, ReadVSShiftV_MX, ReadVSShiftV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX_RM, - Sched<[WriteVSShiftX_MX, ReadVSShiftV_MX, ReadVSShiftX_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VI_RM, - Sched<[WriteVSShiftI_MX, ReadVSShiftV_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVSShiftX_MX, ReadVSShiftV_MX, ReadVSShiftX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX_RM; + + defvar ReadWritesVI = [WriteVSShiftI_MX, ReadVSShiftV_MX, ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VI_RM; } } @@ -2634,13 +2825,22 @@ defvar WriteVIALUI_MX = !cast("WriteVIALUI_" # mx); defvar ReadVIALUV_MX = !cast("ReadVIALUV_" # mx); defvar ReadVIALUX_MX = !cast("ReadVIALUX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVIALUV_MX, ReadVIALUV_MX, ReadVIALUV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVIALUV_MX, ReadVIALUV_MX, ReadVIALUV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVIALUX_MX, ReadVIALUV_MX, ReadVIALUX_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VI, - Sched<[WriteVIALUI_MX, ReadVIALUV_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVIALUX_MX, ReadVIALUV_MX, ReadVIALUX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; + + defvar ReadWritesVI = [WriteVIALUI_MX, ReadVIALUV_MX, ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VI; } } @@ -2651,11 +2851,17 @@ defvar WriteVSALUX_MX = !cast("WriteVSALUX_" # mx); defvar ReadVSALUV_MX = !cast("ReadVSALUV_" # mx); defvar ReadVSALUX_MX = !cast("ReadVSALUX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVSALUV_MX, ReadVSALUV_MX, ReadVSALUV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVSALUV_MX, ReadVSALUV_MX, ReadVSALUV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVSALUX_MX, ReadVSALUV_MX, ReadVSALUX_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVSALUX_MX, ReadVSALUV_MX, ReadVSALUX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; } } @@ -2666,11 +2872,17 @@ defvar WriteVSMulX_MX = !cast("WriteVSMulX_" # mx); defvar ReadVSMulV_MX = !cast("ReadVSMulV_" # mx); defvar ReadVSMulX_MX = !cast("ReadVSMulX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVSMulV_MX, ReadVSMulV_MX, ReadVSMulV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV_RM; - defm "" : VPseudoBinaryV_VV_RM, - Sched<[WriteVSMulV_MX, ReadVSMulV_MX, ReadVSMulV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX_RM, - Sched<[WriteVSMulX_MX, ReadVSMulV_MX, ReadVSMulX_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVSMulX_MX, ReadVSMulV_MX, ReadVSMulX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX_RM; } } @@ -2681,11 +2893,16 @@ defvar WriteVAALUX_MX = !cast("WriteVAALUX_" # mx); defvar ReadVAALUV_MX = !cast("ReadVAALUV_" # mx); defvar ReadVAALUX_MX = !cast("ReadVAALUX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VV_RM, - Sched<[WriteVAALUV_MX, ReadVAALUV_MX, ReadVAALUV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX_RM, - Sched<[WriteVAALUX_MX, ReadVAALUV_MX, ReadVAALUX_MX, ReadVMask]>; + defvar ReadWritesVV = [WriteVAALUV_MX, ReadVAALUV_MX, ReadVAALUV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV_RM; + + defvar ReadWritesVX = [WriteVAALUX_MX, ReadVAALUV_MX, ReadVAALUX_MX, ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX_RM; } } @@ -2696,11 +2913,17 @@ defvar WriteVIMinMaxX_MX = !cast("WriteVIMinMaxX_" # mx); defvar ReadVIMinMaxV_MX = !cast("ReadVIMinMaxV_" # mx); defvar ReadVIMinMaxX_MX = !cast("ReadVIMinMaxX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVIMinMaxV_MX, ReadVIMinMaxV_MX, + ReadVIMinMaxV_MX, ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVIMinMaxV_MX, ReadVIMinMaxV_MX, ReadVIMinMaxV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVIMinMaxX_MX, ReadVIMinMaxV_MX, ReadVIMinMaxX_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVIMinMaxX_MX, ReadVIMinMaxV_MX, + ReadVIMinMaxX_MX, ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; } } @@ -2711,11 +2934,17 @@ defvar WriteVIMulX_MX = !cast("WriteVIMulX_" # mx); defvar ReadVIMulV_MX = !cast("ReadVIMulV_" # mx); defvar ReadVIMulX_MX = !cast("ReadVIMulX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVIMulV_MX, ReadVIMulV_MX, ReadVIMulV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVIMulX_MX, ReadVIMulV_MX, ReadVIMulX_MX, ReadVMask]>; + defvar ReadWritesVV = [WriteVIMulV_MX, ReadVIMulV_MX, ReadVIMulV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; + + defvar ReadWritesVX = [WriteVIMulX_MX, ReadVIMulV_MX, ReadVIMulX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; } } @@ -2724,15 +2953,23 @@ defvar mx = m.MX; defvar sews = SchedSEWSet.val; foreach e = sews in { - defvar WriteVIDivV_MX_E = !cast("WriteVIDivV_" # mx # "_E" # e); - defvar WriteVIDivX_MX_E = !cast("WriteVIDivX_" # mx # "_E" # e); + defvar WriteVIDivV_MX_E = + !cast("WriteVIDivV_" # mx # "_E" # e); + defvar WriteVIDivX_MX_E = + !cast("WriteVIDivX_" # mx # "_E" # e); defvar ReadVIDivV_MX_E = !cast("ReadVIDivV_" # mx # "_E" # e); defvar ReadVIDivX_MX_E = !cast("ReadVIDivX_" # mx # "_E" # e); + defvar ReadVMergeOp_MX_E = !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWritesVV = [WriteVIDivV_MX_E, ReadVIDivV_MX_E, ReadVIDivV_MX_E, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVIDivV_MX_E, ReadVIDivV_MX_E, ReadVIDivV_MX_E, ReadVMask]>; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVIDivX_MX_E, ReadVIDivV_MX_E, ReadVIDivX_MX_E, ReadVMask]>; + defvar ReadWritesVX = [WriteVIDivX_MX_E, ReadVIDivV_MX_E, ReadVIDivX_MX_E, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; } } } @@ -2742,9 +2979,12 @@ defvar mx = m.MX; defvar WriteVFMulV_MX = !cast("WriteVFMulV_" # mx); defvar ReadVFMulV_MX = !cast("ReadVFMulV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryFV_VV_RM, - Sched<[WriteVFMulV_MX, ReadVFMulV_MX, ReadVFMulV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFMulV_MX, ReadVFMulV_MX, ReadVFMulV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryFV_VV_RM; } foreach f = FPList in { @@ -2753,9 +2993,12 @@ defvar WriteVFMulF_MX = !cast("WriteVFMulF_" # mx); defvar ReadVFMulV_MX = !cast("ReadVFMulV_" # mx); defvar ReadVFMulF_MX = !cast("ReadVFMulF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VF_RM, - Sched<[WriteVFMulF_MX, ReadVFMulV_MX, ReadVFMulF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFMulF_MX, ReadVFMulV_MX, ReadVFMulF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF_RM; } } } @@ -2767,21 +3010,32 @@ foreach e = sews in { defvar WriteVFDivV_MX_E = !cast("WriteVFDivV_" # mx # "_E" # e); defvar ReadVFDivV_MX_E = !cast("ReadVFDivV_" # mx # "_E" # e); + defvar ReadVMergeOp_MX_E = !cast("ReadVMergeOp_" # mx # "_E" # e); - defm "" : VPseudoBinaryFV_VV_RM, - Sched<[WriteVFDivV_MX_E, ReadVFDivV_MX_E, ReadVFDivV_MX_E, ReadVMask]>; + defvar ReadWrites = [WriteVFDivV_MX_E, ReadVFDivV_MX_E, ReadVFDivV_MX_E, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryFV_VV_RM; } } foreach f = FPList in { foreach m = f.MxList in { defvar mx = m.MX; - defvar WriteVFDivF_MX_E = !cast("WriteVFDivF_" # mx # "_E" # f.SEW); - defvar ReadVFDivV_MX_E = !cast("ReadVFDivV_" # mx # "_E" # f.SEW); - defvar ReadVFDivF_MX_E = !cast("ReadVFDivF_" # mx # "_E" # f.SEW); - - defm "" : VPseudoBinaryV_VF_RM, - Sched<[WriteVFDivF_MX_E, ReadVFDivV_MX_E, ReadVFDivF_MX_E, ReadVMask]>; + defvar WriteVFDivF_MX_E = + !cast("WriteVFDivF_" # mx # "_E" # f.SEW); + defvar ReadVFDivV_MX_E = + !cast("ReadVFDivV_" # mx # "_E" # f.SEW); + defvar ReadVFDivF_MX_E = + !cast("ReadVFDivF_" # mx # "_E" # f.SEW); + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # f.SEW); + + defvar ReadWrites = [WriteVFDivF_MX_E, ReadVFDivV_MX_E, ReadVFDivF_MX_E, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF_RM; } } } @@ -2790,12 +3044,20 @@ foreach f = FPList in { foreach m = f.MxList in { defvar mx = m.MX; - defvar WriteVFDivF_MX_E = !cast("WriteVFDivF_" # mx # "_E" # f.SEW); - defvar ReadVFDivV_MX_E = !cast("ReadVFDivV_" # mx # "_E" # f.SEW); - defvar ReadVFDivF_MX_E = !cast("ReadVFDivF_" # mx # "_E" # f.SEW); - - defm "" : VPseudoBinaryV_VF_RM, - Sched<[WriteVFDivF_MX_E, ReadVFDivV_MX_E, ReadVFDivF_MX_E, ReadVMask]>; + defvar WriteVFDivF_MX_E = + !cast("WriteVFDivF_" # mx # "_E" # f.SEW); + defvar ReadVFDivV_MX_E = + !cast("ReadVFDivV_" # mx # "_E" # f.SEW); + defvar ReadVFDivF_MX_E = + !cast("ReadVFDivF_" # mx # "_E" # f.SEW); + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # f.SEW); + + defvar ReadWrites = [WriteVFDivF_MX_E, ReadVFDivV_MX_E, ReadVFDivF_MX_E, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF_RM; } } } @@ -2807,11 +3069,17 @@ defvar WriteVIALUX_MX = !cast("WriteVIALUV_" # mx); defvar ReadVIALUV_MX = !cast("ReadVIALUV_" # mx); defvar ReadVIALUX_MX = !cast("ReadVIALUX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VV, - Sched<[WriteVIALUV_MX, ReadVIALUV_MX, ReadVIALUV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVIALUX_MX, ReadVIALUV_MX, ReadVIALUX_MX, ReadVMask]>; + defvar ReadWritesVV = [WriteVIALUV_MX, ReadVIALUV_MX, ReadVIALUV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VV; + + defvar ReadWritesVX = [WriteVIALUX_MX, ReadVIALUV_MX, ReadVIALUX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; } } @@ -2820,9 +3088,12 @@ defvar mx = m.MX; defvar WriteVFSgnjV_MX = !cast("WriteVFSgnjV_" # mx); defvar ReadVFSgnjV_MX = !cast("ReadVFSgnjV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryFV_VV, - Sched<[WriteVFSgnjV_MX, ReadVFSgnjV_MX, ReadVFSgnjV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFSgnjV_MX, ReadVFSgnjV_MX, ReadVFSgnjV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryFV_VV; } foreach f = FPList in { @@ -2831,9 +3102,12 @@ defvar WriteVFSgnjF_MX = !cast("WriteVFSgnjF_" # mx); defvar ReadVFSgnjV_MX = !cast("ReadVFSgnjV_" # mx); defvar ReadVFSgnjF_MX = !cast("ReadVFSgnjF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VF, - Sched<[WriteVFSgnjF_MX, ReadVFSgnjV_MX, ReadVFSgnjF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFSgnjF_MX, ReadVFSgnjV_MX, ReadVFSgnjF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF; } } } @@ -2843,9 +3117,12 @@ defvar mx = m.MX; defvar WriteVFMinMaxV_MX = !cast("WriteVFMinMaxV_" # mx); defvar ReadVFMinMaxV_MX = !cast("ReadVFMinMaxV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryFV_VV, - Sched<[WriteVFMinMaxV_MX, ReadVFMinMaxV_MX, ReadVFMinMaxV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFMinMaxV_MX, ReadVFMinMaxV_MX, ReadVFMinMaxV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryFV_VV; } foreach f = FPList in { @@ -2854,9 +3131,12 @@ defvar WriteVFMinMaxF_MX = !cast("WriteVFMinMaxF_" # mx); defvar ReadVFMinMaxV_MX = !cast("ReadVFMinMaxV_" # mx); defvar ReadVFMinMaxF_MX = !cast("ReadVFMinMaxF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VF, - Sched<[WriteVFMinMaxF_MX, ReadVFMinMaxV_MX, ReadVFMinMaxF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFMinMaxF_MX, ReadVFMinMaxV_MX, + ReadVFMinMaxF_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF; } } } @@ -2866,9 +3146,12 @@ defvar mx = m.MX; defvar WriteVFALUV_MX = !cast("WriteVFALUV_" # mx); defvar ReadVFALUV_MX = !cast("ReadVFALUV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryFV_VV, - Sched<[WriteVFALUV_MX, ReadVFALUV_MX, ReadVFALUV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFALUV_MX, ReadVFALUV_MX, ReadVFALUV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryFV_VV; } foreach f = FPList in { @@ -2877,8 +3160,12 @@ defvar WriteVFALUF_MX = !cast("WriteVFALUF_" # mx); defvar ReadVFALUV_MX = !cast("ReadVFALUV_" # mx); defvar ReadVFALUF_MX = !cast("ReadVFALUF_" # mx); - defm "" : VPseudoBinaryV_VF, - Sched<[WriteVFALUF_MX, ReadVFALUV_MX, ReadVFALUF_MX, ReadVMask]>; + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWrites = [WriteVFALUF_MX, ReadVFALUV_MX, ReadVFALUF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF; } } } @@ -2888,9 +3175,12 @@ defvar mx = m.MX; defvar WriteVFALUV_MX = !cast("WriteVFALUV_" # mx); defvar ReadVFALUV_MX = !cast("ReadVFALUV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryFV_VV_RM, - Sched<[WriteVFALUV_MX, ReadVFALUV_MX, ReadVFALUV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFALUV_MX, ReadVFALUV_MX, ReadVFALUV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryFV_VV_RM; } foreach f = FPList in { @@ -2899,8 +3189,12 @@ defvar WriteVFALUF_MX = !cast("WriteVFALUF_" # mx); defvar ReadVFALUV_MX = !cast("ReadVFALUV_" # mx); defvar ReadVFALUF_MX = !cast("ReadVFALUF_" # mx); - defm "" : VPseudoBinaryV_VF_RM, - Sched<[WriteVFALUF_MX, ReadVFALUV_MX, ReadVFALUF_MX, ReadVMask]>; + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWrites = [WriteVFALUF_MX, ReadVFALUV_MX, ReadVFALUF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF_RM; } } } @@ -2912,9 +3206,12 @@ defvar WriteVFALUF_MX = !cast("WriteVFALUF_" # mx); defvar ReadVFALUV_MX = !cast("ReadVFALUV_" # mx); defvar ReadVFALUF_MX = !cast("ReadVFALUF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VF, - Sched<[WriteVFALUF_MX, ReadVFALUV_MX, ReadVFALUF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFALUF_MX, ReadVFALUV_MX, ReadVFALUF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF; } } } @@ -2926,9 +3223,12 @@ defvar WriteVFALUF_MX = !cast("WriteVFALUF_" # mx); defvar ReadVFALUV_MX = !cast("ReadVFALUV_" # mx); defvar ReadVFALUF_MX = !cast("ReadVFALUF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_VF_RM, - Sched<[WriteVFALUF_MX, ReadVFALUV_MX, ReadVFALUF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFALUF_MX, ReadVFALUV_MX, ReadVFALUF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VF_RM; } } } @@ -2940,11 +3240,16 @@ defvar WriteVIALUI_MX = !cast("WriteVIALUI_" # mx); defvar ReadVIALUV_MX = !cast("ReadVIALUV_" # mx); defvar ReadVIALUX_MX = !cast("ReadVIALUX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVX = [WriteVIALUX_MX, ReadVIALUV_MX, ReadVIALUX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VX; - defm "" : VPseudoBinaryV_VX, - Sched<[WriteVIALUX_MX, ReadVIALUV_MX, ReadVIALUX_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_VI, - Sched<[WriteVIALUI_MX, ReadVIALUV_MX, ReadVMask]>; + defvar ReadWritesVI = [WriteVIALUI_MX, ReadVIALUV_MX, ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_VI; } } @@ -2955,11 +3260,17 @@ defvar WriteVIWALUX_MX = !cast("WriteVIWALUX_" # mx); defvar ReadVIWALUV_MX = !cast("ReadVIWALUV_" # mx); defvar ReadVIWALUX_MX = !cast("ReadVIWALUX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryW_VV, - Sched<[WriteVIWALUV_MX, ReadVIWALUV_MX, ReadVIWALUV_MX, ReadVMask]>; - defm "" : VPseudoBinaryW_VX, - Sched<[WriteVIWALUX_MX, ReadVIWALUV_MX, ReadVIWALUX_MX, ReadVMask]>; + defvar ReadWritesVV = [WriteVIWALUV_MX, ReadVIWALUV_MX, ReadVIWALUV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_VV; + + defvar ReadWritesVX = [WriteVIWALUX_MX, ReadVIWALUV_MX, ReadVIWALUX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_VX; } } @@ -2970,11 +3281,17 @@ defvar WriteVIWMulX_MX = !cast("WriteVIWMulX_" # mx); defvar ReadVIWMulV_MX = !cast("ReadVIWMulV_" # mx); defvar ReadVIWMulX_MX = !cast("ReadVIWMulX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVIWMulV_MX, ReadVIWMulV_MX, ReadVIWMulV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_VV; - defm "" : VPseudoBinaryW_VV, - Sched<[WriteVIWMulV_MX, ReadVIWMulV_MX, ReadVIWMulV_MX, ReadVMask]>; - defm "" : VPseudoBinaryW_VX, - Sched<[WriteVIWMulX_MX, ReadVIWMulV_MX, ReadVIWMulX_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVIWMulX_MX, ReadVIWMulV_MX, ReadVIWMulX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_VX; } } @@ -2983,9 +3300,12 @@ defvar mx = m.MX; defvar WriteVFWMulV_MX = !cast("WriteVFWMulV_" # mx); defvar ReadVFWMulV_MX = !cast("ReadVFWMulV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryW_VV_RM, - Sched<[WriteVFWMulV_MX, ReadVFWMulV_MX, ReadVFWMulV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWMulV_MX, ReadVFWMulV_MX, ReadVFWMulV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_VV_RM; } foreach f = FPListW in { @@ -2994,9 +3314,12 @@ defvar WriteVFWMulF_MX = !cast("WriteVFWMulF_" # mx); defvar ReadVFWMulV_MX = !cast("ReadVFWMulV_" # mx); defvar ReadVFWMulF_MX = !cast("ReadVFWMulF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryW_VF_RM, - Sched<[WriteVFWMulF_MX, ReadVFWMulV_MX, ReadVFWMulF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWMulF_MX, ReadVFWMulV_MX, ReadVFWMulF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_VF_RM; } } } @@ -3008,11 +3331,17 @@ defvar WriteVIWALUX_MX = !cast("WriteVIWALUX_" # mx); defvar ReadVIWALUV_MX = !cast("ReadVIWALUV_" # mx); defvar ReadVIWALUX_MX = !cast("ReadVIWALUX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryW_WV, - Sched<[WriteVIWALUV_MX, ReadVIWALUV_MX, ReadVIWALUV_MX, ReadVMask]>; - defm "" : VPseudoBinaryW_WX, - Sched<[WriteVIWALUX_MX, ReadVIWALUV_MX, ReadVIWALUX_MX, ReadVMask]>; + defvar ReadWritesWV = [WriteVIWALUV_MX, ReadVIWALUV_MX, ReadVIWALUV_MX, + ReadVMask]; + defvar ReadWritesWVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_WV; + + defvar ReadWritesWX = [WriteVIWALUX_MX, ReadVIWALUV_MX, ReadVIWALUX_MX, + ReadVMask]; + defvar ReadWritesWXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_WX; } } @@ -3021,9 +3350,12 @@ defvar mx = m.MX; defvar WriteVFWALUV_MX = !cast("WriteVFWALUV_" # mx); defvar ReadVFWALUV_MX = !cast("ReadVFWALUV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryW_VV_RM, - Sched<[WriteVFWALUV_MX, ReadVFWALUV_MX, ReadVFWALUV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWALUV_MX, ReadVFWALUV_MX, ReadVFWALUV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_VV_RM; } foreach f = FPListW in { @@ -3032,9 +3364,12 @@ defvar WriteVFWALUF_MX = !cast("WriteVFWALUF_" # mx); defvar ReadVFWALUV_MX = !cast("ReadVFWALUV_" # mx); defvar ReadVFWALUF_MX = !cast("ReadVFWALUF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryW_VF_RM, - Sched<[WriteVFWALUF_MX, ReadVFWALUV_MX, ReadVFWALUF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWALUF_MX, ReadVFWALUV_MX, ReadVFWALUF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_VF_RM; } } } @@ -3044,9 +3379,12 @@ defvar mx = m.MX; defvar WriteVFWALUV_MX = !cast("WriteVFWALUV_" # mx); defvar ReadVFWALUV_MX = !cast("ReadVFWALUV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryW_WV_RM, - Sched<[WriteVFWALUV_MX, ReadVFWALUV_MX, ReadVFWALUV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWALUV_MX, ReadVFWALUV_MX, ReadVFWALUV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_WV_RM; } foreach f = FPListW in { foreach m = f.MxListFW in { @@ -3054,9 +3392,12 @@ defvar WriteVFWALUF_MX = !cast("WriteVFWALUF_" # mx); defvar ReadVFWALUV_MX = !cast("ReadVFWALUV_" # mx); defvar ReadVFWALUF_MX = !cast("ReadVFWALUF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryW_WF_RM, - Sched<[WriteVFWALUF_MX, ReadVFWALUV_MX, ReadVFWALUF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWALUF_MX, ReadVFWALUV_MX, ReadVFWALUF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryW_WF_RM; } } } @@ -3192,13 +3533,22 @@ defvar WriteVNClipI_MX = !cast("WriteVNClipI_" # mx); defvar ReadVNClipV_MX = !cast("ReadVNClipV_" # mx); defvar ReadVNClipX_MX = !cast("ReadVNClipX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesWV = [WriteVNClipV_MX, ReadVNClipV_MX, ReadVNClipV_MX, + ReadVMask]; + defvar ReadWritesWVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_WV_RM; + + defvar ReadWritesWX = [WriteVNClipX_MX, ReadVNClipV_MX, ReadVNClipX_MX, + ReadVMask]; + defvar ReadWritesWXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_WX_RM; - defm "" : VPseudoBinaryV_WV_RM, - Sched<[WriteVNClipV_MX, ReadVNClipV_MX, ReadVNClipV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_WX_RM, - Sched<[WriteVNClipX_MX, ReadVNClipV_MX, ReadVNClipX_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_WI_RM, - Sched<[WriteVNClipI_MX, ReadVNClipV_MX, ReadVMask]>; + defvar ReadWritesWI = [WriteVNClipI_MX, ReadVNClipV_MX, + ReadVMask]; + defvar ReadWritesWIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_WI_RM; } } @@ -3210,13 +3560,22 @@ defvar WriteVNShiftI_MX = !cast("WriteVNShiftI_" # mx); defvar ReadVNShiftV_MX = !cast("ReadVNShiftV_" # mx); defvar ReadVNShiftX_MX = !cast("ReadVNShiftX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryV_WV, - Sched<[WriteVNShiftV_MX, ReadVNShiftV_MX, ReadVNShiftV_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_WX, - Sched<[WriteVNShiftX_MX, ReadVNShiftV_MX, ReadVNShiftX_MX, ReadVMask]>; - defm "" : VPseudoBinaryV_WI, - Sched<[WriteVNShiftI_MX, ReadVNShiftV_MX, ReadVMask]>; + defvar ReadWritesWV = [WriteVNShiftV_MX, ReadVNShiftV_MX, ReadVNShiftV_MX, + ReadVMask]; + defvar ReadWritesWVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_WV; + + defvar ReadWritesWX = [WriteVNShiftX_MX, ReadVNShiftV_MX, ReadVNShiftX_MX, + ReadVMask]; + defvar ReadWritesWXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_WX; + + defvar ReadWritesWI = [WriteVNShiftI_MX, ReadVNShiftV_MX, + ReadVMask]; + defvar ReadWritesWIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryV_WI; } } @@ -3225,13 +3584,20 @@ DAGOperand Op2Class, LMULInfo MInfo, int sew, + list ReadWrites, + list ReadWritesMask, string Constraint = "", bit Commutable = 0> { let VLMul = MInfo.value in { defvar mx = MInfo.MX; let isCommutable = Commutable in - def "_" # mx # "_E" # sew : VPseudoTernaryNoMaskWithPolicy; - def "_" # mx # "_E" # sew # "_MASK" : VPseudoTernaryMaskPolicy; + def "_" # mx # "_E" # sew + : VPseudoTernaryNoMaskWithPolicy, + Sched; + def "_" # mx # "_E" # sew # "_MASK" + : VPseudoTernaryMaskPolicy, + Sched; } } @@ -3240,6 +3606,8 @@ DAGOperand Op2Class, LMULInfo MInfo, int sew, + list ReadWrites, + list ReadWritesMask, string Constraint = "", bit Commutable = 0> { let VLMul = MInfo.value in { @@ -3247,10 +3615,12 @@ let isCommutable = Commutable in def "_" # mx # "_E" # sew : VPseudoTernaryNoMaskWithPolicyRoundingMode; + Op2Class, Constraint>, + Sched; def "_" # mx # "_E" # sew # "_MASK" : VPseudoTernaryMaskPolicyRoundingMode; + Op2Class, Constraint>, + Sched; } } @@ -3258,110 +3628,161 @@ RegisterClass Op1Class, DAGOperand Op2Class, LMULInfo MInfo, + list ReadWrites, + list ReadWritesMask, string Constraint = "", bit Commutable = 0> { let VLMul = MInfo.value in { let isCommutable = Commutable in - def "_" # MInfo.MX : VPseudoTernaryNoMaskWithPolicy; - def "_" # MInfo.MX # "_MASK" : VPseudoBinaryMaskPolicy, - RISCVMaskedPseudo; + def "_" # MInfo.MX + : VPseudoTernaryNoMaskWithPolicy, + Sched; + def "_" # MInfo.MX # "_MASK" + : VPseudoBinaryMaskPolicy, + RISCVMaskedPseudo, + Sched; } } -multiclass VPseudoTernaryWithPolicyRoundingMode { +multiclass VPseudoTernaryWithPolicyRoundingMode< + VReg RetClass, RegisterClass Op1Class, DAGOperand Op2Class, LMULInfo MInfo, + list ReadWrites, list ReadWritesMask, + string Constraint = "", bit Commutable = 0> { let VLMul = MInfo.value in { let isCommutable = Commutable in def "_" # MInfo.MX : VPseudoTernaryNoMaskWithPolicyRoundingMode; + Op2Class, Constraint>, + Sched; def "_" # MInfo.MX # "_MASK" : VPseudoBinaryMaskPolicyRoundingMode, - RISCVMaskedPseudo; + RISCVMaskedPseudo, + Sched; } } -multiclass VPseudoTernaryV_VV_AAXA { +multiclass VPseudoTernaryV_VV_AAXA ReadWrites, + list ReadWritesMask, + string Constraint = ""> { defm _VV : VPseudoTernaryWithPolicy; } -multiclass VPseudoTernaryV_VV_AAXA_RM { - defm _VV : VPseudoTernaryWithPolicyRoundingMode; +multiclass VPseudoTernaryV_VV_AAXA_RM< + LMULInfo m, list ReadWrites, + list ReadWritesMask, string Constraint = ""> { + defm _VV : VPseudoTernaryWithPolicyRoundingMode; } -multiclass VPseudoTernaryV_VX_AAXA { +multiclass VPseudoTernaryV_VX_AAXA ReadWrites, + list ReadWritesMask, + string Constraint = ""> { defm "_VX" : VPseudoTernaryWithPolicy; + ReadWrites, ReadWritesMask, Constraint, + /*Commutable*/1>; } -multiclass VPseudoTernaryV_VF_AAXA { +multiclass VPseudoTernaryV_VF_AAXA< + LMULInfo m, FPR_Info f, list ReadWrites, + list ReadWritesMask, string Constraint = ""> { defm "_V" # f.FX : VPseudoTernaryWithPolicy; } -multiclass VPseudoTernaryV_VF_AAXA_RM { +multiclass VPseudoTernaryV_VF_AAXA_RM< + LMULInfo m, FPR_Info f, list ReadWrites, + list ReadWritesMask, string Constraint = ""> { defm "_V" # f.FX : VPseudoTernaryWithPolicyRoundingMode; } -multiclass VPseudoTernaryW_VV { +multiclass VPseudoTernaryW_VV ReadWrites, + list ReadWritesMask> { defvar constraint = "@earlyclobber $rd"; defm _VV : VPseudoTernaryWithPolicy; + ReadWrites, ReadWritesMask, constraint>; } -multiclass VPseudoTernaryW_VV_RM { +multiclass VPseudoTernaryW_VV_RM ReadWrites, + list ReadWritesMask> { defvar constraint = "@earlyclobber $rd"; - defm _VV : VPseudoTernaryWithPolicyRoundingMode; } -multiclass VPseudoTernaryW_VX { +multiclass VPseudoTernaryW_VX ReadWrites, + list ReadWritesMask> { defvar constraint = "@earlyclobber $rd"; defm "_VX" : VPseudoTernaryWithPolicy; + ReadWrites, ReadWritesMask, constraint>; } -multiclass VPseudoTernaryW_VF { +multiclass VPseudoTernaryW_VF ReadWrites, + list ReadWritesMask> { defvar constraint = "@earlyclobber $rd"; defm "_V" # f.FX : VPseudoTernaryWithPolicy; + m.vrclass, m, ReadWrites, + ReadWritesMask, constraint>; } -multiclass VPseudoTernaryW_VF_RM { +multiclass VPseudoTernaryW_VF_RM ReadWrites, + list ReadWritesMask> { defvar constraint = "@earlyclobber $rd"; - defm "_V" # f.FX : VPseudoTernaryWithPolicyRoundingMode; + defm "_V" # f.FX + : VPseudoTernaryWithPolicyRoundingMode; } multiclass VPseudoVSLDVWithPolicy ReadWrites, + list ReadWritesMask, string Constraint = ""> { let VLMul = MInfo.value in { - def "_" # MInfo.MX : VPseudoTernaryNoMaskWithPolicy; - def "_" # MInfo.MX # "_MASK" : VPseudoBinaryMaskPolicy, - RISCVMaskedPseudo; + def "_" # MInfo.MX + : VPseudoTernaryNoMaskWithPolicy, + Sched; + def "_" # MInfo.MX # "_MASK" + : VPseudoBinaryMaskPolicy, + RISCVMaskedPseudo, + Sched; } } -multiclass VPseudoVSLDV_VX { - defm _VX : VPseudoVSLDVWithPolicy; +multiclass VPseudoVSLDV_VX ReadWrites, + list ReadWritesMask, + string Constraint = ""> { + defm _VX : VPseudoVSLDVWithPolicy; } -multiclass VPseudoVSLDV_VI { - defm _VI : VPseudoVSLDVWithPolicy; +multiclass VPseudoVSLDV_VI ReadWrites, + list ReadWritesMask, + string Constraint = ""> { + defm _VI : VPseudoVSLDVWithPolicy; } multiclass VPseudoVMAC_VV_VX_AAXA { @@ -3371,13 +3792,19 @@ defvar WriteVIMulAddX_MX = !cast("WriteVIMulAddX_" # mx); defvar ReadVIMulAddV_MX = !cast("ReadVIMulAddV_" # mx); defvar ReadVIMulAddX_MX = !cast("ReadVIMulAddX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryV_VV_AAXA, - Sched<[WriteVIMulAddV_MX, ReadVIMulAddV_MX, ReadVIMulAddV_MX, - ReadVIMulAddV_MX, ReadVMask]>; - defm "" : VPseudoTernaryV_VX_AAXA, - Sched<[WriteVIMulAddX_MX, ReadVIMulAddV_MX, ReadVIMulAddV_MX, - ReadVIMulAddX_MX, ReadVMask]>; + defvar ReadWritesVV = [WriteVIMulAddV_MX, ReadVIMulAddV_MX, + ReadVIMulAddV_MX, ReadVIMulAddV_MX, ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryV_VV_AAXA; + + defvar ReadWritesVX = [WriteVIMulAddX_MX, ReadVIMulAddV_MX, + ReadVIMulAddV_MX, ReadVIMulAddX_MX, ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryV_VX_AAXA; } } @@ -3386,9 +3813,13 @@ defvar mx = m.MX; defvar WriteVFMulAddV_MX = !cast("WriteVFMulAddV_" # mx); defvar ReadVFMulAddV_MX = !cast("ReadVFMulAddV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryV_VV_AAXA, - Sched<[WriteVFMulAddV_MX, ReadVFMulAddV_MX, ReadVFMulAddV_MX, ReadVFMulAddV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFMulAddV_MX, ReadVFMulAddV_MX, ReadVFMulAddV_MX, + ReadVFMulAddV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryV_VV_AAXA; } foreach f = FPList in { @@ -3397,9 +3828,13 @@ defvar WriteVFMulAddF_MX = !cast("WriteVFMulAddF_" # mx); defvar ReadVFMulAddV_MX = !cast("ReadVFMulAddV_" # mx); defvar ReadVFMulAddF_MX = !cast("ReadVFMulAddF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryV_VF_AAXA, - Sched<[WriteVFMulAddF_MX, ReadVFMulAddV_MX, ReadVFMulAddV_MX, ReadVFMulAddF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFMulAddF_MX, ReadVFMulAddV_MX, + ReadVFMulAddV_MX, ReadVFMulAddF_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryV_VF_AAXA; } } } @@ -3409,9 +3844,13 @@ defvar mx = m.MX; defvar WriteVFMulAddV_MX = !cast("WriteVFMulAddV_" # mx); defvar ReadVFMulAddV_MX = !cast("ReadVFMulAddV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryV_VV_AAXA_RM, - Sched<[WriteVFMulAddV_MX, ReadVFMulAddV_MX, ReadVFMulAddV_MX, ReadVFMulAddV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFMulAddV_MX, ReadVFMulAddV_MX, ReadVFMulAddV_MX, + ReadVFMulAddV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryV_VV_AAXA_RM; } foreach f = FPList in { @@ -3420,9 +3859,13 @@ defvar WriteVFMulAddF_MX = !cast("WriteVFMulAddF_" # mx); defvar ReadVFMulAddV_MX = !cast("ReadVFMulAddV_" # mx); defvar ReadVFMulAddF_MX = !cast("ReadVFMulAddF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryV_VF_AAXA_RM, - Sched<[WriteVFMulAddF_MX, ReadVFMulAddV_MX, ReadVFMulAddV_MX, ReadVFMulAddF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFMulAddF_MX, ReadVFMulAddV_MX, + ReadVFMulAddV_MX, ReadVFMulAddF_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryV_VF_AAXA_RM; } } } @@ -3434,12 +3877,18 @@ defvar WriteVISlideI_MX = !cast("WriteVISlideI_" # mx); defvar ReadVISlideV_MX = !cast("ReadVISlideV_" # mx); defvar ReadVISlideX_MX = !cast("ReadVISlideX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVX = [WriteVISlideX_MX, ReadVISlideV_MX, ReadVISlideV_MX, + ReadVISlideX_MX, ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoVSLDV_VX; - defm "" : VPseudoVSLDV_VX, - Sched<[WriteVISlideX_MX, ReadVISlideV_MX, ReadVISlideV_MX, - ReadVISlideX_MX, ReadVMask]>; - defm "" : VPseudoVSLDV_VI, - Sched<[WriteVISlideI_MX, ReadVISlideV_MX, ReadVISlideV_MX, ReadVMask]>; + defvar ReadWritesVI = [WriteVISlideI_MX, ReadVISlideV_MX, ReadVISlideV_MX, + ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoVSLDV_VI; } } @@ -3450,13 +3899,17 @@ defvar WriteVIWMulAddX_MX = !cast("WriteVIWMulAddX_" # mx); defvar ReadVIWMulAddV_MX = !cast("ReadVIWMulAddV_" # mx); defvar ReadVIWMulAddX_MX = !cast("ReadVIWMulAddX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryW_VV, - Sched<[WriteVIWMulAddV_MX, ReadVIWMulAddV_MX, ReadVIWMulAddV_MX, - ReadVIWMulAddV_MX, ReadVMask]>; - defm "" : VPseudoTernaryW_VX, - Sched<[WriteVIWMulAddX_MX, ReadVIWMulAddV_MX, ReadVIWMulAddV_MX, - ReadVIWMulAddX_MX, ReadVMask]>; + defvar ReadWritesVV = [WriteVIWMulAddV_MX, ReadVIWMulAddV_MX, + ReadVIWMulAddV_MX, ReadVIWMulAddV_MX, ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryW_VV; + + defvar ReadWritesVX = [WriteVIWMulAddX_MX, ReadVIWMulAddV_MX, + ReadVIWMulAddV_MX, ReadVIWMulAddX_MX, ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryW_VX; } } @@ -3466,10 +3919,12 @@ defvar WriteVIWMulAddX_MX = !cast("WriteVIWMulAddX_" # mx); defvar ReadVIWMulAddV_MX= !cast("ReadVIWMulAddV_" # mx); defvar ReadVIWMulAddX_MX = !cast("ReadVIWMulAddX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryW_VX, - Sched<[WriteVIWMulAddX_MX, ReadVIWMulAddV_MX, ReadVIWMulAddV_MX, - ReadVIWMulAddX_MX, ReadVMask]>; + defvar ReadWrites = [WriteVIWMulAddX_MX, ReadVIWMulAddV_MX, + ReadVIWMulAddV_MX, ReadVIWMulAddX_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryW_VX; } } @@ -3478,10 +3933,12 @@ defvar mx = m.MX; defvar WriteVFWMulAddV_MX = !cast("WriteVFWMulAddV_" # mx); defvar ReadVFWMulAddV_MX = !cast("ReadVFWMulAddV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryW_VV_RM, - Sched<[WriteVFWMulAddV_MX, ReadVFWMulAddV_MX, - ReadVFWMulAddV_MX, ReadVFWMulAddV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWMulAddV_MX, ReadVFWMulAddV_MX, + ReadVFWMulAddV_MX, ReadVFWMulAddV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryW_VV_RM; } foreach f = FPListW in { @@ -3490,10 +3947,12 @@ defvar WriteVFWMulAddF_MX = !cast("WriteVFWMulAddF_" # mx); defvar ReadVFWMulAddV_MX = !cast("ReadVFWMulAddV_" # mx); defvar ReadVFWMulAddF_MX = !cast("ReadVFWMulAddF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoTernaryW_VF_RM, - Sched<[WriteVFWMulAddF_MX, ReadVFWMulAddV_MX, - ReadVFWMulAddV_MX, ReadVFWMulAddF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWMulAddF_MX, ReadVFWMulAddV_MX, + ReadVFWMulAddV_MX, ReadVFWMulAddF_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoTernaryW_VF_RM; } } } @@ -3506,13 +3965,21 @@ defvar WriteVICmpI_MX = !cast("WriteVICmpI_" # mx); defvar ReadVICmpV_MX = !cast("ReadVICmpV_" # mx); defvar ReadVICmpX_MX = !cast("ReadVICmpX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVICmpV_MX, ReadVICmpV_MX, ReadVICmpV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VV; - defm "" : VPseudoBinaryM_VV, - Sched<[WriteVICmpV_MX, ReadVICmpV_MX, ReadVICmpV_MX, ReadVMask]>; - defm "" : VPseudoBinaryM_VX, - Sched<[WriteVICmpX_MX, ReadVICmpV_MX, ReadVICmpX_MX, ReadVMask]>; - defm "" : VPseudoBinaryM_VI, - Sched<[WriteVICmpI_MX, ReadVICmpV_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVICmpX_MX, ReadVICmpV_MX, ReadVICmpX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VX; + + defvar ReadWritesVI = [WriteVICmpI_MX, ReadVICmpV_MX, ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VI; } } @@ -3523,11 +3990,17 @@ defvar WriteVICmpX_MX = !cast("WriteVICmpX_" # mx); defvar ReadVICmpV_MX = !cast("ReadVICmpV_" # mx); defvar ReadVICmpX_MX = !cast("ReadVICmpX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); + + defvar ReadWritesVV = [WriteVICmpV_MX, ReadVICmpV_MX, ReadVICmpV_MX, + ReadVMask]; + defvar ReadWritesVVMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VV; - defm "" : VPseudoBinaryM_VV, - Sched<[WriteVICmpV_MX, ReadVICmpV_MX, ReadVICmpV_MX, ReadVMask]>; - defm "" : VPseudoBinaryM_VX, - Sched<[WriteVICmpX_MX, ReadVICmpV_MX, ReadVICmpX_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVICmpX_MX, ReadVICmpV_MX, ReadVICmpX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VX; } } @@ -3536,9 +4009,12 @@ defvar mx = m.MX; defvar WriteVFCmpV_MX = !cast("WriteVFCmpV_" # mx); defvar ReadVFCmpV_MX = !cast("ReadVFCmpV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryM_VV, - Sched<[WriteVFCmpV_MX, ReadVFCmpV_MX, ReadVFCmpV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFCmpV_MX, ReadVFCmpV_MX, ReadVFCmpV_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VV; } foreach f = FPList in { @@ -3547,9 +4023,12 @@ defvar WriteVFCmpF_MX = !cast("WriteVFCmpF_" # mx); defvar ReadVFCmpV_MX = !cast("ReadVFCmpV_" # mx); defvar ReadVFCmpF_MX = !cast("ReadVFCmpF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryM_VF, - Sched<[WriteVFCmpF_MX, ReadVFCmpV_MX, ReadVFCmpF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFCmpF_MX, ReadVFCmpV_MX, ReadVFCmpF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VF; } } } @@ -3561,9 +4040,12 @@ defvar WriteVFCmpF_MX = !cast("WriteVFCmpF_" # mx); defvar ReadVFCmpV_MX = !cast("ReadVFCmpV_" # mx); defvar ReadVFCmpF_MX = !cast("ReadVFCmpF_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryM_VF, - Sched<[WriteVFCmpF_MX, ReadVFCmpV_MX, ReadVFCmpF_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFCmpF_MX, ReadVFCmpV_MX, ReadVFCmpF_MX, + ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VF; } } } @@ -3575,11 +4057,16 @@ defvar WriteVICmpI_MX = !cast("WriteVICmpI_" # mx); defvar ReadVICmpV_MX = !cast("ReadVICmpV_" # mx); defvar ReadVICmpX_MX = !cast("ReadVICmpX_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm "" : VPseudoBinaryM_VX, - Sched<[WriteVICmpX_MX, ReadVICmpV_MX, ReadVICmpX_MX, ReadVMask]>; - defm "" : VPseudoBinaryM_VI, - Sched<[WriteVICmpI_MX, ReadVICmpV_MX, ReadVMask]>; + defvar ReadWritesVX = [WriteVICmpX_MX, ReadVICmpV_MX, ReadVICmpX_MX, + ReadVMask]; + defvar ReadWritesVXMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VX; + + defvar ReadWritesVI = [WriteVICmpI_MX, ReadVICmpV_MX, ReadVMask]; + defvar ReadWritesVIMask = InsertAtIdx1.l; + defm "" : VPseudoBinaryM_VI; } } @@ -3587,10 +4074,18 @@ foreach m = MxList in { defvar mx = m.MX; foreach e = SchedSEWSet.val in { - defvar WriteVIRedV_From_MX_E = !cast("WriteVIRedV_From_" # mx # "_E" # e); - defm _VS : VPseudoTernaryWithTailPolicy, - Sched<[WriteVIRedV_From_MX_E, ReadVIRedV, ReadVIRedV, ReadVIRedV, - ReadVMask]>; + defvar WriteVIRedV_From_MX_E = + !cast("WriteVIRedV_From_" # mx # "_E" # e); + // TODO: ReadVMergeOp should be MX of destination + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVIRedV_From_MX_E, ReadVIRedV, ReadVIRedV, + ReadVIRedV, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _VS : VPseudoTernaryWithTailPolicy; } } } @@ -3599,10 +4094,18 @@ foreach m = MxList in { defvar mx = m.MX; foreach e = SchedSEWSet.val in { - defvar WriteVIRedMinMaxV_From_MX_E = !cast("WriteVIRedMinMaxV_From_" # mx # "_E" # e); - defm _VS : VPseudoTernaryWithTailPolicy, - Sched<[WriteVIRedMinMaxV_From_MX_E, ReadVIRedV, ReadVIRedV, - ReadVIRedV, ReadVMask]>; + defvar WriteVIRedMinMaxV_From_MX_E = + !cast("WriteVIRedMinMaxV_From_" # mx # "_E" # e); + // TODO: ReadVMergeOp should be MX of destination + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVIRedMinMaxV_From_MX_E, ReadVIRedV, ReadVIRedV, + ReadVIRedV, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _VS : VPseudoTernaryWithTailPolicy; } } } @@ -3611,10 +4114,18 @@ foreach m = MxListWRed in { defvar mx = m.MX; foreach e = SchedSEWSet.val in { - defvar WriteVIWRedV_From_MX_E = !cast("WriteVIWRedV_From_" # mx # "_E" # e); - defm _VS : VPseudoTernaryWithTailPolicy, - Sched<[WriteVIWRedV_From_MX_E, ReadVIWRedV, ReadVIWRedV, - ReadVIWRedV, ReadVMask]>; + defvar WriteVIWRedV_From_MX_E = + !cast("WriteVIWRedV_From_" # mx # "_E" # e); + // TODO: ReadVMergeOp should be MX of destination + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVIWRedV_From_MX_E, ReadVIWRedV, ReadVIWRedV, + ReadVIWRedV, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _VS : VPseudoTernaryWithTailPolicy; } } } @@ -3623,12 +4134,20 @@ foreach m = MxListF in { defvar mx = m.MX; foreach e = SchedSEWSet.val in { - defvar WriteVFRedV_From_MX_E = !cast("WriteVFRedV_From_" # mx # "_E" # e); + defvar WriteVFRedV_From_MX_E = + !cast("WriteVFRedV_From_" # mx # "_E" # e); + // TODO: ReadVMergeOp should be MX of destination + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVFRedV_From_MX_E, ReadVFRedV, ReadVFRedV, + ReadVFRedV, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; defm _VS : VPseudoTernaryWithTailPolicyRoundingMode, - Sched<[WriteVFRedV_From_MX_E, ReadVFRedV, ReadVFRedV, ReadVFRedV, - ReadVMask]>; + V_M1.vrclass, m, e, + ReadWrites, + ReadWritesMask>; } } } @@ -3637,10 +4156,18 @@ foreach m = MxListF in { defvar mx = m.MX; foreach e = SchedSEWSet.val in { - defvar WriteVFRedMinMaxV_From_MX_E = !cast("WriteVFRedMinMaxV_From_" # mx # "_E" # e); - defm _VS : VPseudoTernaryWithTailPolicy, - Sched<[WriteVFRedMinMaxV_From_MX_E, ReadVFRedV, ReadVFRedV, ReadVFRedV, - ReadVMask]>; + defvar WriteVFRedMinMaxV_From_MX_E = + !cast("WriteVFRedMinMaxV_From_" # mx # "_E" # e); + // TODO: ReadVMergeOp should be MX of destination + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVFRedMinMaxV_From_MX_E, ReadVFRedV, ReadVFRedV, + ReadVFRedV, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _VS : VPseudoTernaryWithTailPolicy; } } } @@ -3649,11 +4176,19 @@ foreach m = MxListF in { defvar mx = m.MX; foreach e = SchedSEWSet.val in { - defvar WriteVFRedOV_From_MX_E = !cast("WriteVFRedOV_From_" # mx # "_E" # e); - defm _VS : VPseudoTernaryWithTailPolicyRoundingMode, - Sched<[WriteVFRedOV_From_MX_E, ReadVFRedOV, ReadVFRedOV, - ReadVFRedOV, ReadVMask]>; + defvar WriteVFRedOV_From_MX_E = + !cast("WriteVFRedOV_From_" # mx # "_E" # e); + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVFRedOV_From_MX_E, ReadVFRedOV, ReadVFRedOV, + ReadVFRedOV, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _VS : VPseudoTernaryWithTailPolicyRoundingMode; } } } @@ -3662,12 +4197,19 @@ foreach m = MxListFWRed in { defvar mx = m.MX; foreach e = SchedSEWSet.val in { - defvar WriteVFWRedV_From_MX_E = !cast("WriteVFWRedV_From_" # mx # "_E" # e); + defvar WriteVFWRedV_From_MX_E = + !cast("WriteVFWRedV_From_" # mx # "_E" # e); + defvar ReadVMergeOp_MX_E = + !cast("ReadVMergeOp_" # mx # "_E" # e); + + defvar ReadWrites = [WriteVFWRedV_From_MX_E, ReadVFWRedV, ReadVFWRedV, + ReadVFWRedV, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; defm _VS : VPseudoTernaryWithTailPolicyRoundingMode, - Sched<[WriteVFWRedV_From_MX_E, ReadVFWRedV, ReadVFWRedV, - ReadVFWRedV, ReadVMask]>; + V_M1.vrclass, m, e, + ReadWrites, + ReadWritesMask>; } } } @@ -3675,24 +4217,33 @@ multiclass VPseudoConversion ReadWrites, + list ReadWritesMask, string Constraint = ""> { let VLMul = MInfo.value in { - def "_" # MInfo.MX : VPseudoUnaryNoMask; + def "_" # MInfo.MX : VPseudoUnaryNoMask, + Sched; def "_" # MInfo.MX # "_MASK" : VPseudoUnaryMask, - RISCVMaskedPseudo; + RISCVMaskedPseudo, + Sched; } } multiclass VPseudoConversionRoundingMode ReadWrites, + list ReadWritesMask, string Constraint = ""> { let VLMul = MInfo.value in { - def "_" # MInfo.MX : VPseudoUnaryNoMaskRoundingMode; + def "_" # MInfo.MX + : VPseudoUnaryNoMaskRoundingMode, + Sched; def "_" # MInfo.MX # "_MASK" : VPseudoUnaryMaskRoundingMode, - RISCVMaskedPseudo; + RISCVMaskedPseudo, + Sched; } } @@ -3700,22 +4251,30 @@ multiclass VPseudoConversionRM ReadWrites, + list ReadWritesMask, string Constraint = ""> { let VLMul = MInfo.value in { def "_" # MInfo.MX : VPseudoUnaryNoMask_FRM; + Constraint>, + Sched; + def "_" # MInfo.MX # "_MASK" : VPseudoUnaryMask_FRM, - RISCVMaskedPseudo; + RISCVMaskedPseudo, + Sched; } } multiclass VPseudoConversionNoExcept ReadWritesMask, string Constraint = ""> { let VLMul = MInfo.value in { - def "_" # MInfo.MX # "_MASK" : VPseudoUnaryMask_NoExcept; + def "_" # MInfo.MX # "_MASK" + : VPseudoUnaryMask_NoExcept, + Sched; } } @@ -3724,9 +4283,12 @@ defvar mx = m.MX; defvar WriteVFCvtFToIV_MX = !cast("WriteVFCvtFToIV_" # mx); defvar ReadVFCvtFToIV_MX = !cast("ReadVFCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversion, - Sched<[WriteVFCvtFToIV_MX, ReadVFCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFCvtFToIV_MX, ReadVFCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversion; } } @@ -3735,9 +4297,12 @@ defvar mx = m.MX; defvar WriteVFCvtFToIV_MX = !cast("WriteVFCvtFToIV_" # mx); defvar ReadVFCvtFToIV_MX = !cast("ReadVFCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversionRoundingMode, - Sched<[WriteVFCvtFToIV_MX, ReadVFCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFCvtFToIV_MX, ReadVFCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversionRoundingMode; } } @@ -3746,9 +4311,12 @@ defvar mx = m.MX; defvar WriteVFCvtFToIV_MX = !cast("WriteVFCvtFToIV_" # mx); defvar ReadVFCvtFToIV_MX = !cast("ReadVFCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversionRM, - Sched<[WriteVFCvtFToIV_MX, ReadVFCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFCvtFToIV_MX, ReadVFCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversionRM; } } @@ -3757,9 +4325,12 @@ defvar mx = m.MX; defvar WriteVFCvtFToIV_MX = !cast("WriteVFCvtFToIV_" # mx); defvar ReadVFCvtFToIV_MX = !cast("ReadVFCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversionNoExcept, - Sched<[WriteVFCvtFToIV_MX, ReadVFCvtFToIV_MX, ReadVMask]>; + defvar ReadWritesMask = [WriteVFCvtFToIV_MX, ReadVFCvtFToIV_MX, ReadVMask, + ReadVMergeOp_MX]; + defm _V : VPseudoConversionNoExcept; } } @@ -3768,9 +4339,12 @@ defvar mx = m.MX; defvar WriteVFCvtIToFV_MX = !cast("WriteVFCvtIToFV_" # mx); defvar ReadVFCvtIToFV_MX = !cast("ReadVFCvtIToFV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversionRoundingMode, - Sched<[WriteVFCvtIToFV_MX, ReadVFCvtIToFV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFCvtIToFV_MX, ReadVFCvtIToFV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversionRoundingMode; } } @@ -3779,9 +4353,12 @@ defvar mx = m.MX; defvar WriteVFCvtIToFV_MX = !cast("WriteVFCvtIToFV_" # mx); defvar ReadVFCvtIToFV_MX = !cast("ReadVFCvtIToFV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversionRM, - Sched<[WriteVFCvtIToFV_MX, ReadVFCvtIToFV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFCvtIToFV_MX, ReadVFCvtIToFV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversionRM; } } @@ -3791,9 +4368,12 @@ defvar mx = m.MX; defvar WriteVFWCvtFToIV_MX = !cast("WriteVFWCvtFToIV_" # mx); defvar ReadVFWCvtFToIV_MX = !cast("ReadVFWCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversion, - Sched<[WriteVFWCvtFToIV_MX, ReadVFWCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWCvtFToIV_MX, ReadVFWCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversion; } } @@ -3803,9 +4383,13 @@ defvar mx = m.MX; defvar WriteVFWCvtFToIV_MX = !cast("WriteVFWCvtFToIV_" # mx); defvar ReadVFWCvtFToIV_MX = !cast("ReadVFWCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversionRoundingMode, - Sched<[WriteVFWCvtFToIV_MX, ReadVFWCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWCvtFToIV_MX, ReadVFWCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversionRoundingMode; } } @@ -3815,9 +4399,12 @@ defvar mx = m.MX; defvar WriteVFWCvtFToIV_MX = !cast("WriteVFWCvtFToIV_" # mx); defvar ReadVFWCvtFToIV_MX = !cast("ReadVFWCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversionRM, - Sched<[WriteVFWCvtFToIV_MX, ReadVFWCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWCvtFToIV_MX, ReadVFWCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversionRM; } } @@ -3827,9 +4414,12 @@ defvar mx = m.MX; defvar WriteVFWCvtIToFV_MX = !cast("WriteVFWCvtIToFV_" # mx); defvar ReadVFWCvtIToFV_MX = !cast("ReadVFWCvtIToFV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversion, - Sched<[WriteVFWCvtIToFV_MX, ReadVFWCvtIToFV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWCvtIToFV_MX, ReadVFWCvtIToFV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversion; } } @@ -3839,9 +4429,12 @@ defvar mx = m.MX; defvar WriteVFWCvtFToFV_MX = !cast("WriteVFWCvtFToFV_" # mx); defvar ReadVFWCvtFToFV_MX = !cast("ReadVFWCvtFToFV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _V : VPseudoConversion, - Sched<[WriteVFWCvtFToFV_MX, ReadVFWCvtFToFV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFWCvtFToFV_MX, ReadVFWCvtFToFV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _V : VPseudoConversion; } } @@ -3851,9 +4444,12 @@ defvar mx = m.MX; defvar WriteVFNCvtFToIV_MX = !cast("WriteVFNCvtFToIV_" # mx); defvar ReadVFNCvtFToIV_MX = !cast("ReadVFNCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _W : VPseudoConversion, - Sched<[WriteVFNCvtFToIV_MX, ReadVFNCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFNCvtFToIV_MX, ReadVFNCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _W : VPseudoConversion; } } @@ -3863,9 +4459,13 @@ defvar mx = m.MX; defvar WriteVFNCvtFToIV_MX = !cast("WriteVFNCvtFToIV_" # mx); defvar ReadVFNCvtFToIV_MX = !cast("ReadVFNCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _W : VPseudoConversionRoundingMode, - Sched<[WriteVFNCvtFToIV_MX, ReadVFNCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFNCvtFToIV_MX, ReadVFNCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _W : VPseudoConversionRoundingMode; } } @@ -3875,9 +4475,12 @@ defvar mx = m.MX; defvar WriteVFNCvtFToIV_MX = !cast("WriteVFNCvtFToIV_" # mx); defvar ReadVFNCvtFToIV_MX = !cast("ReadVFNCvtFToIV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _W : VPseudoConversionRM, - Sched<[WriteVFNCvtFToIV_MX, ReadVFNCvtFToIV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFNCvtFToIV_MX, ReadVFNCvtFToIV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _W : VPseudoConversionRM; } } @@ -3887,9 +4490,13 @@ defvar mx = m.MX; defvar WriteVFNCvtIToFV_MX = !cast("WriteVFNCvtIToFV_" # mx); defvar ReadVFNCvtIToFV_MX = !cast("ReadVFNCvtIToFV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _W : VPseudoConversionRoundingMode, - Sched<[WriteVFNCvtIToFV_MX, ReadVFNCvtIToFV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFNCvtIToFV_MX, ReadVFNCvtIToFV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _W : VPseudoConversionRoundingMode; } } @@ -3899,9 +4506,12 @@ defvar mx = m.MX; defvar WriteVFNCvtIToFV_MX = !cast("WriteVFNCvtIToFV_" # mx); defvar ReadVFNCvtIToFV_MX = !cast("ReadVFNCvtIToFV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _W : VPseudoConversionRM, - Sched<[WriteVFNCvtIToFV_MX, ReadVFNCvtIToFV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFNCvtIToFV_MX, ReadVFNCvtIToFV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _W : VPseudoConversionRM; } } @@ -3911,9 +4521,12 @@ defvar mx = m.MX; defvar WriteVFNCvtFToFV_MX = !cast("WriteVFNCvtFToFV_" # mx); defvar ReadVFNCvtFToFV_MX = !cast("ReadVFNCvtFToFV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _W : VPseudoConversion, - Sched<[WriteVFNCvtFToFV_MX, ReadVFNCvtFToFV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFNCvtFToFV_MX, ReadVFNCvtFToFV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _W : VPseudoConversion; } } @@ -3923,9 +4536,13 @@ defvar mx = m.MX; defvar WriteVFNCvtFToFV_MX = !cast("WriteVFNCvtFToFV_" # mx); defvar ReadVFNCvtFToFV_MX = !cast("ReadVFNCvtFToFV_" # mx); + defvar ReadVMergeOp_MX = !cast("ReadVMergeOp_" # mx); - defm _W : VPseudoConversionRoundingMode, - Sched<[WriteVFNCvtFToFV_MX, ReadVFNCvtFToFV_MX, ReadVMask]>; + defvar ReadWrites = [WriteVFNCvtFToFV_MX, ReadVFNCvtFToFV_MX, ReadVMask]; + defvar ReadWritesMask = InsertAtIdx1.l; + defm _W : VPseudoConversionRoundingMode; } } @@ -3939,7 +4556,7 @@ def nf # "E" # eew # "_V_" # LInfo : VPseudoUSSegLoadNoMask, VLSEGSched; def nf # "E" # eew # "_V_" # LInfo # "_MASK" : - VPseudoUSSegLoadMask, VLSEGSched; + VPseudoUSSegLoadMask, VLSEGSchedMask; } } } @@ -3954,9 +4571,11 @@ foreach nf = NFSet.L in { defvar vreg = SegRegClass.RC; def nf # "E" # eew # "FF_V_" # LInfo : - VPseudoUSSegLoadFFNoMask, VLSEGFFSched; + VPseudoUSSegLoadFFNoMask, + VLSEGFFSched; def nf # "E" # eew # "FF_V_" # LInfo # "_MASK" : - VPseudoUSSegLoadFFMask, VLSEGFFSched; + VPseudoUSSegLoadFFMask, + VLSEGFFSchedMask; } } } @@ -3970,10 +4589,12 @@ let VLMul = lmul.value, SEW=eew in { foreach nf = NFSet.L in { defvar vreg = SegRegClass.RC; - def nf # "E" # eew # "_V_" # LInfo : VPseudoSSegLoadNoMask, - VLSSEGSched; - def nf # "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoSSegLoadMask, - VLSSEGSched; + def nf # "E" # eew # "_V_" # LInfo + : VPseudoSSegLoadNoMask, + VLSSEGSched; + def nf # "E" # eew # "_V_" # LInfo # "_MASK" + : VPseudoSSegLoadMask, + VLSSEGSchedMask; } } } @@ -4004,7 +4625,7 @@ def nf # "EI" # idxEEW # "_V_" # IdxLInfo # "_" # DataLInfo # "_MASK" : VPseudoISegLoadMask, - VLXSEGSched; + VLXSEGSchedMask; } } } @@ -4020,10 +4641,12 @@ let VLMul = lmul.value, SEW=eew in { foreach nf = NFSet.L in { defvar vreg = SegRegClass.RC; - def nf # "E" # eew # "_V_" # LInfo : VPseudoUSSegStoreNoMask, - VSSEGSched; - def nf # "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoUSSegStoreMask, - VSSEGSched; + def nf # "E" # eew # "_V_" # LInfo + : VPseudoUSSegStoreNoMask, + VSSEGSched; + def nf # "E" # eew # "_V_" # LInfo # "_MASK" + : VPseudoUSSegStoreMask, + VSSEGSchedMask; } } } @@ -4037,10 +4660,12 @@ let VLMul = lmul.value, SEW=eew in { foreach nf = NFSet.L in { defvar vreg = SegRegClass.RC; - def nf # "E" # eew # "_V_" # LInfo : VPseudoSSegStoreNoMask, - VSSSEGSched; - def nf # "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoSSegStoreMask, - VSSSEGSched; + def nf # "E" # eew # "_V_" # LInfo + : VPseudoSSegStoreNoMask, + VSSSEGSched; + def nf # "E" # eew # "_V_" # LInfo # "_MASK" + : VPseudoSSegStoreMask, + VSSSEGSchedMask; } } } @@ -4071,7 +4696,7 @@ def nf # "EI" # idxEEW # "_V_" # IdxLInfo # "_" # DataLInfo # "_MASK" : VPseudoISegStoreMask, - VSXSEGSched; + VSXSEGSchedMask; } } } diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td b/llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoXTHead.td @@ -474,14 +474,16 @@ //===----------------------------------------------------------------------===// multiclass VPseudoVMAQA_VV_VX { foreach m = MxListTHVdot in { - defm "" : VPseudoTernaryW_VV; - defm "" : VPseudoTernaryW_VX; + // TODO: Add SchedReadWrites + defm "" : VPseudoTernaryW_VV; + defm "" : VPseudoTernaryW_VX; } } multiclass VPseudoVMAQA_VX { foreach m = MxListTHVdot in { - defm "" : VPseudoTernaryW_VX; + // TODO: Add SchedReadWrites + defm "" : VPseudoTernaryW_VX; } } diff --git a/llvm/lib/Target/RISCV/RISCVSchedSiFive7.td b/llvm/lib/Target/RISCV/RISCVSchedSiFive7.td --- a/llvm/lib/Target/RISCV/RISCVSchedSiFive7.td +++ b/llvm/lib/Target/RISCV/RISCVSchedSiFive7.td @@ -1154,6 +1154,11 @@ // Others def : ReadAdvance; +foreach mx = SchedMxList in { + def : ReadAdvance("ReadVMergeOp_" # mx), 0>; + foreach sew = SchedSEWSet.val in + def : ReadAdvance("ReadVMergeOp_" # mx # "_E" # sew), 0>; +} //===----------------------------------------------------------------------===// // Unsupported extensions diff --git a/llvm/lib/Target/RISCV/RISCVScheduleV.td b/llvm/lib/Target/RISCV/RISCVScheduleV.td --- a/llvm/lib/Target/RISCV/RISCVScheduleV.td +++ b/llvm/lib/Target/RISCV/RISCVScheduleV.td @@ -687,6 +687,11 @@ // Others def ReadVMask : SchedRead; +foreach mx = SchedMxList in { + def ReadVMergeOp_ # mx : SchedRead; + foreach sew = SchedSEWSet.val in + def ReadVMergeOp_ # mx # "_E" # sew : SchedRead; +} //===----------------------------------------------------------------------===// /// Define default scheduler resources for V. @@ -1050,6 +1055,11 @@ // Others def : ReadAdvance; +foreach mx = SchedMxList in { + def : ReadAdvance("ReadVMergeOp_" # mx), 0>; + foreach sew = SchedSEWSet.val in + def : ReadAdvance("ReadVMergeOp_" # mx # "_E" # sew), 0>; +} } // Unsupported } // UnsupportedSchedV