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 @@ -98,54 +98,91 @@ // Scheduling definitions. //===----------------------------------------------------------------------===// -class VMVRSched: Sched <[!cast("WriteVMov" # n # "V"), - !cast("ReadVMov" # n # "V")]>; - -class VLESched : Sched <[WriteVLDE, ReadVLDX, ReadVMask]>; - -class VSESched : Sched <[WriteVSTE, ReadVSTEV, ReadVSTX, ReadVMask]>; - -class VLSSched : Sched <[!cast("WriteVLDS" # n), - ReadVLDX, ReadVLDSX, ReadVMask]>; - -class VSSSched : Sched <[!cast("WriteVSTS" # n), - !cast("ReadVSTS" # n # "V"), - ReadVSTX, ReadVSTSX, ReadVMask]>; - -class VLXSched : - Sched <[!cast("WriteVLD" # o # "X" # n), - ReadVLDX, !cast("ReadVLD" # o # "XV"), ReadVMask]>; - -class VSXSched : - Sched <[!cast("WriteVST" # o # "X" # n), - !cast("ReadVST" # o # "X" # n), - ReadVSTX, !cast("ReadVST" # o # "XV"), ReadVMask]>; - -class VLFSched : Sched <[WriteVLDFF, ReadVLDX, ReadVMask]>; +class VMVRSched : Sched<[ + !cast("WriteVMov" #n #"V"), + !cast("ReadVMov" #n #"V") +]>; + +class VLESched : Sched<[ + !cast("WriteVLDE_" #mx), + !cast("ReadVLDX_" #mx), ReadVMask +]>; + +class VSESched : Sched<[ + !cast("WriteVSTE_" #mx), + !cast("ReadVSTEV_" #mx), + !cast("ReadVSTX_" #mx), ReadVMask +]>; + +class VLSSched : Sched<[ + !cast("WriteVLDS" #n #"_" #mx), + !cast("ReadVLDX_" #mx), + !cast("ReadVLDSX_" #mx), ReadVMask +]>; + +class VSSSched : Sched<[ + !cast("WriteVSTS" #n #"_" #mx), + !cast("ReadVSTS" #n #"V_" #mx), + !cast("ReadVSTX_" #mx), + !cast("ReadVSTSX_" #mx), ReadVMask +]>; + +class VLXSched : Sched<[ + !cast("WriteVLD" #o #"X" #n #"_" #mx), + !cast("ReadVLDX_" #mx), + !cast("ReadVLD" #o #"XV_" #mx), ReadVMask +]>; + +class VSXSched : Sched<[ + !cast("WriteVST" #o #"X" #n #"_" #mx), + !cast("ReadVST" #o #"X" #n #"_" #mx), + !cast("ReadVSTX_" #mx), + !cast("ReadVST" #o #"XV_" #mx), ReadVMask +]>; + +class VLFSched : Sched<[ + !cast("WriteVLDFF_" #mx), + !cast("ReadVLDX_" #mx), ReadVMask +]>; // Unit-Stride Segment Loads and Stores -class VLSEGSched : Sched<[ - !cast("WriteVLSEG" #nf #"e" #eew), ReadVLDX, ReadVMask]>; -class VSSEGSched : Sched<[ - !cast("WriteVSSEG" #nf #"e" #eew), ReadVSTEV, ReadVSTX, - ReadVMask]>; -class VLSEGFFSched : Sched<[ - !cast("WriteVLSEGFF" #nf #"e" #eew), ReadVLDX, ReadVMask]>; +class VLSEGSched : Sched<[ + !cast("WriteVLSEG" #nf #"e" #eew #"_" #mx), + !cast("ReadVLDX_" #mx), ReadVMask +]>; +class VSSEGSched : Sched<[ + !cast("WriteVSSEG" #nf #"e" #eew #"_" #mx), + !cast("ReadVSTEV_" #mx), + !cast("ReadVSTX_" #mx), ReadVMask +]>; +class VLSEGFFSched : Sched<[ + !cast("WriteVLSEGFF" #nf #"e" #eew #"_" #mx), + !cast("ReadVLDX_" #mx), ReadVMask +]>; // Strided Segment Loads and Stores -class VLSSEGSched : Sched<[ - !cast("WriteVLSSEG" #nf #"e" #eew), ReadVLDX, ReadVLDSX, - ReadVMask]>; -class VSSSEGSched : Sched<[ - !cast("WriteVSSSEG" #nf #"e" #eew), - !cast("ReadVSTS" #eew #"V"), ReadVSTX, ReadVSTSX, ReadVMask]>; +class VLSSEGSched : Sched<[ + !cast("WriteVLSSEG" #nf #"e" #eew #"_" #mx), + !cast("ReadVLDX_" #mx), + !cast("ReadVLDSX_" #mx), ReadVMask +]>; +class VSSSEGSched : Sched<[ + !cast("WriteVSSSEG" #nf #"e" #eew #"_" #mx), + !cast("ReadVSTS" #eew #"V" #"_" #mx), + !cast("ReadVSTX_" #mx), + !cast("ReadVSTSX_" #mx), ReadVMask +]>; // Indexed Segment Loads and Stores -class VLXSEGSched : Sched<[ - !cast("WriteVL" #o # "XSEG" #nf #"e" #eew), ReadVLDX, - !cast("ReadVLD" # o # "XV"), ReadVMask]>; -class VSXSEGSched : Sched<[ - !cast("WriteVS" #o # "XSEG" #nf #"e" #eew), - !cast("ReadVST" #o # "X" #eew), ReadVSTX, - !cast("ReadVST" #o # "XV"), ReadVMask]>; +class VLXSEGSched : Sched<[ + !cast("WriteVL" #o #"XSEG" #nf #"e" #eew #"_" #mx), + !cast("ReadVLDX_" #mx), + !cast("ReadVLD" #o #"XV" #"_" #mx), ReadVMask +]>; +class VSXSEGSched : Sched<[ + !cast("WriteVS" #o #"XSEG" #nf #"e" #eew #"_" #mx), + !cast("ReadVST" #o #"X" #eew # "_" # mx), + !cast("ReadVSTX_" #mx), + !cast("ReadVST" #o #"XV" # "_" # mx), ReadVMask +]>; //===----------------------------------------------------------------------===// // Instruction class templates @@ -386,17 +423,17 @@ def VLUXEI # n # _V : VIndexedLoad, - VLXSched; + VLXSched; def VLOXEI # n # _V : VIndexedLoad, - VLXSched; + VLXSched; def VSUXEI # n # _V : VIndexedStore, - VSXSched; + VSXSched; def VSOXEI # n # _V : VIndexedStore, - VSXSched; + VSXSched; } } @@ -921,12 +958,12 @@ defvar s = !cast("WriteVLD" # !add(nf, 1) # "R"); def E # l # _V : VWholeLoad, - Sched<[s, ReadVLDX]>; + Sched<[s, ReadVLDX_UpperBound]>; } } multiclass VWholeLoadEEW64 nf, string opcodestr, RegisterClass VRC, SchedReadWrite schedrw> { def E64_V : VWholeLoad, - Sched<[schedrw, ReadVLDX]>; + Sched<[schedrw, ReadVLDX_UpperBound]>; } //===----------------------------------------------------------------------===// @@ -950,15 +987,15 @@ defvar w = !cast("LSWidth" # eew); // Vector Unit-Stride Instructions - def VLE#eew#_V : VUnitStrideLoad, VLESched; - def VSE#eew#_V : VUnitStrideStore, VSESched; + def VLE#eew#_V : VUnitStrideLoad, VLESched; + def VSE#eew#_V : VUnitStrideStore, VSESched; // Vector Unit-Stride Fault-only-First Loads - def VLE#eew#FF_V : VUnitStrideLoadFF, VLFSched; + def VLE#eew#FF_V : VUnitStrideLoadFF, VLFSched; // Vector Strided Instructions - def VLSE#eew#_V : VStridedLoad, VLSSched; - def VSSE#eew#_V : VStridedStore, VSSSched; + def VLSE#eew#_V : VStridedLoad, VLSSched; + def VSSE#eew#_V : VStridedStore, VSSSched; } defm "" : VIndexLoadStore<[8, 16, 32]>; @@ -966,9 +1003,9 @@ let Predicates = [HasVInstructions] in { def VLM_V : VUnitStrideLoadMask<"vlm.v">, - Sched<[WriteVLDM, ReadVLDX]>; + Sched<[WriteVLDM_UpperBound, ReadVLDX_UpperBound]>; def VSM_V : VUnitStrideStoreMask<"vsm.v">, - Sched<[WriteVSTM, ReadVSTM, ReadVSTX]>; + Sched<[WriteVSTM_UpperBound, ReadVSTM_UpperBound, ReadVSTX_UpperBound]>; def : InstAlias<"vle1.v $vd, (${rs1})", (VLM_V VR:$vd, GPR:$rs1), 0>; def : InstAlias<"vse1.v $vs3, (${rs1})", @@ -980,13 +1017,13 @@ defm VL8R : VWholeLoadN<7, "vl8r", VRM8>; def VS1R_V : VWholeStore<0, "vs1r.v", VR>, - Sched<[WriteVST1R, ReadVST1R, ReadVSTX]>; + Sched<[WriteVST1R, ReadVST1R, ReadVSTX_UpperBound]>; def VS2R_V : VWholeStore<1, "vs2r.v", VRM2>, - Sched<[WriteVST2R, ReadVST2R, ReadVSTX]>; + Sched<[WriteVST2R, ReadVST2R, ReadVSTX_UpperBound]>; def VS4R_V : VWholeStore<3, "vs4r.v", VRM4>, - Sched<[WriteVST4R, ReadVST4R, ReadVSTX]>; + Sched<[WriteVST4R, ReadVST4R, ReadVSTX_UpperBound]>; def VS8R_V : VWholeStore<7, "vs8r.v", VRM8>, - Sched<[WriteVST8R, ReadVST8R, ReadVSTX]>; + Sched<[WriteVST8R, ReadVST8R, ReadVSTX_UpperBound]>; def : InstAlias<"vl1r.v $vd, (${rs1})", (VL1RE8_V VR:$vd, GPR:$rs1)>; def : InstAlias<"vl2r.v $vd, (${rs1})", (VL2RE8_V VRM2:$vd, GPR:$rs1)>; @@ -997,19 +1034,19 @@ let Predicates = [HasVInstructionsI64] in { // Vector Unit-Stride Instructions def VLE64_V : VUnitStrideLoad, - VLESched; + VLESched; def VLE64FF_V : VUnitStrideLoadFF, - VLFSched; + VLFSched; def VSE64_V : VUnitStrideStore, - VSESched; + VSESched; // Vector Strided Instructions def VLSE64_V : VStridedLoad, - VLSSched<32>; + VLSSched<32, UpperBoundLMUL>; def VSSE64_V : VStridedStore, - VSSSched<64>; + VSSSched<64, UpperBoundLMUL>; defm VL1R: VWholeLoadEEW64<0, "vl1r", VR, WriteVLD1R>; defm VL2R: VWholeLoadEEW64<1, "vl2r", VRM2, WriteVLD2R>; @@ -1650,38 +1687,38 @@ def VLSEG#nf#E#eew#_V : VUnitStrideSegmentLoad, - VLSEGSched; + VLSEGSched; def VLSEG#nf#E#eew#FF_V : VUnitStrideSegmentLoadFF, - VLSEGFFSched; + VLSEGFFSched; def VSSEG#nf#E#eew#_V : VUnitStrideSegmentStore, - VSSEGSched; + VSSEGSched; // Vector Strided Instructions def VLSSEG#nf#E#eew#_V : VStridedSegmentLoad, - VLSSEGSched; + VLSSEGSched; def VSSSEG#nf#E#eew#_V : VStridedSegmentStore, - VSSSEGSched; + VSSSEGSched; // Vector Indexed Instructions def VLUXSEG#nf#EI#eew#_V : VIndexedSegmentLoad, - VLXSEGSched; + VLXSEGSched; def VLOXSEG#nf#EI#eew#_V : VIndexedSegmentLoad, - VLXSEGSched; + VLXSEGSched; def VSUXSEG#nf#EI#eew#_V : VIndexedSegmentStore, - VSXSEGSched; + VSXSEGSched; def VSOXSEG#nf#EI#eew#_V : VIndexedSegmentStore, - VSXSEGSched; + VSXSEGSched; } } } // Predicates = [HasVInstructions] @@ -1691,38 +1728,42 @@ // Vector Unit-strided Segment Instructions def VLSEG#nf#E64_V : VUnitStrideSegmentLoad, - VLSEGSched; + VLSEGSched; def VLSEG#nf#E64FF_V : VUnitStrideSegmentLoadFF, - VLSEGFFSched; + VLSEGFFSched; def VSSEG#nf#E64_V : VUnitStrideSegmentStore, - VSSEGSched; + VSSEGSched; // Vector Strided Segment Instructions def VLSSEG#nf#E64_V : VStridedSegmentLoad, - VLSSEGSched; + VLSSEGSched; def VSSSEG#nf#E64_V : VStridedSegmentStore, - VSSSEGSched; + VSSSEGSched; } } // Predicates = [HasVInstructionsI64] let Predicates = [HasVInstructionsI64, IsRV64] in { - foreach nf=2-8 in { + foreach nf = 2 - 8 in { // Vector Indexed Segment Instructions - def VLUXSEG#nf#EI64_V : - VIndexedSegmentLoad, VLXSEGSched; - def VLOXSEG#nf#EI64_V : - VIndexedSegmentLoad, VLXSEGSched; - def VSUXSEG#nf#EI64_V : - VIndexedSegmentStore, VSXSEGSched; - def VSOXSEG#nf#EI64_V : - VIndexedSegmentStore, VSXSEGSched; + def VLUXSEG #nf #EI64_V + : VIndexedSegmentLoad, + VLXSEGSched; + def VLOXSEG #nf #EI64_V + : VIndexedSegmentLoad, + VLXSEGSched; + def VSUXSEG #nf #EI64_V + : VIndexedSegmentStore, + VSXSEGSched; + def VSOXSEG #nf #EI64_V + : VIndexedSegmentStore, + VSXSEGSched; } } // Predicates = [HasVInstructionsI64, IsRV64] 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 @@ -1632,14 +1632,14 @@ let VLMul = lmul.value in { def "E" # eew # "_V_" # LInfo : VPseudoUSLoadNoMask, - VLESched; + VLESched; def "E" # eew # "_V_" # LInfo # "_TU": VPseudoUSLoadNoMaskTU, - VLESched; + VLESched; def "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoUSLoadMask, RISCVMaskedPseudo, - VLESched; + VLESched; } } } @@ -1653,14 +1653,14 @@ let VLMul = lmul.value in { def "E" # eew # "FF_V_" # LInfo: VPseudoUSLoadFFNoMask, - VLFSched; + VLFSched; def "E" # eew # "FF_V_" # LInfo # "_TU": VPseudoUSLoadFFNoMaskTU, - VLFSched; + VLFSched; def "E" # eew # "FF_V_" # LInfo # "_MASK": VPseudoUSLoadFFMask, RISCVMaskedPseudo, - VLFSched; + VLFSched; } } } @@ -1668,8 +1668,12 @@ multiclass VPseudoLoadMask { foreach mti = AllMasks in { + defvar mx = mti.LMul.MX; + defvar WriteVLDM_MX = !cast("WriteVLDM_" # mx); + defvar ReadVLDX_MX = !cast("ReadVLDX_" # mx); let VLMul = mti.LMul.value in { - def "_V_" # mti.BX : VPseudoUSLoadNoMask; + def "_V_" # mti.BX : VPseudoUSLoadNoMask, + Sched<[WriteVLDM_MX, ReadVLDX_MX]>; } } } @@ -1681,13 +1685,13 @@ defvar vreg = lmul.vrclass; let VLMul = lmul.value in { def "E" # eew # "_V_" # LInfo : VPseudoSLoadNoMask, - VLSSched; + VLSSched; def "E" # eew # "_V_" # LInfo # "_TU": VPseudoSLoadNoMaskTU, - VLSSched; + VLSSched; def "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoSLoadMask, RISCVMaskedPseudo, - VLSSched; + VLSSched; } } } @@ -1711,14 +1715,14 @@ let VLMul = lmul.value in { def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo : VPseudoILoadNoMask, - VLXSched; + VLXSched; def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo # "_TU": VPseudoILoadNoMaskTU, - VLXSched; + VLXSched; def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo # "_MASK" : VPseudoILoadMask, RISCVMaskedPseudo, - VLXSched; + VLXSched; } } } @@ -1733,9 +1737,9 @@ defvar vreg = lmul.vrclass; let VLMul = lmul.value in { def "E" # eew # "_V_" # LInfo : VPseudoUSStoreNoMask, - VSESched; + VSESched; def "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoUSStoreMask, - VSESched; + VSESched; } } } @@ -1743,8 +1747,12 @@ multiclass VPseudoStoreMask { foreach mti = AllMasks in { + defvar mx = mti.LMul.MX; + defvar WriteVSTM_MX = !cast("WriteVSTM_" # mx); + defvar ReadVSTX_MX = !cast("ReadVSTX_" # mx); let VLMul = mti.LMul.value in { - def "_V_" # mti.BX : VPseudoUSStoreNoMask; + def "_V_" # mti.BX : VPseudoUSStoreNoMask, + Sched<[WriteVSTM_MX, ReadVSTX_MX]>; } } } @@ -1756,9 +1764,9 @@ defvar vreg = lmul.vrclass; let VLMul = lmul.value in { def "E" # eew # "_V_" # LInfo : VPseudoSStoreNoMask, - VSSSched; + VSSSched; def "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoSStoreMask, - VSSSched; + VSSSched; } } } @@ -1781,10 +1789,10 @@ let VLMul = lmul.value in { def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo : VPseudoIStoreNoMask, - VSXSched; + VSXSched; def "EI" # eew # "_V_" # IdxLInfo # "_" # LInfo # "_MASK" : VPseudoIStoreMask, - VSXSched; + VSXSched; } } } @@ -3553,11 +3561,11 @@ foreach nf = NFSet.L in { defvar vreg = SegRegClass.RC; def nf # "E" # eew # "_V_" # LInfo : - VPseudoUSSegLoadNoMask, VLSEGSched; + VPseudoUSSegLoadNoMask, VLSEGSched; def nf # "E" # eew # "_V_" # LInfo # "_TU" : - VPseudoUSSegLoadNoMaskTU, VLSEGSched; + VPseudoUSSegLoadNoMaskTU, VLSEGSched; def nf # "E" # eew # "_V_" # LInfo # "_MASK" : - VPseudoUSSegLoadMask, VLSEGSched; + VPseudoUSSegLoadMask, VLSEGSched; } } } @@ -3572,11 +3580,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 # "_TU" : - VPseudoUSSegLoadFFNoMaskTU, VLSEGFFSched; + VPseudoUSSegLoadFFNoMaskTU, VLSEGFFSched; def nf # "E" # eew # "FF_V_" # LInfo # "_MASK" : - VPseudoUSSegLoadFFMask, VLSEGFFSched; + VPseudoUSSegLoadFFMask, VLSEGFFSched; } } } @@ -3591,11 +3599,11 @@ foreach nf = NFSet.L in { defvar vreg = SegRegClass.RC; def nf # "E" # eew # "_V_" # LInfo : VPseudoSSegLoadNoMask, - VLSSEGSched; + VLSSEGSched; def nf # "E" # eew # "_V_" # LInfo # "_TU" : VPseudoSSegLoadNoMaskTU, - VLSSEGSched; + VLSSEGSched; def nf # "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoSSegLoadMask, - VLSSEGSched; + VLSSEGSched; } } } @@ -3622,15 +3630,15 @@ def nf # "EI" # idx_eew # "_V_" # IdxLInfo # "_" # ValLInfo : VPseudoISegLoadNoMask, - VLXSEGSched; + VLXSEGSched; def nf # "EI" # idx_eew # "_V_" # IdxLInfo # "_" # ValLInfo # "_TU" : VPseudoISegLoadNoMaskTU, - VLXSEGSched; + VLXSEGSched; def nf # "EI" # idx_eew # "_V_" # IdxLInfo # "_" # ValLInfo # "_MASK" : VPseudoISegLoadMask, - VLXSEGSched; + VLXSEGSched; } } } @@ -3647,9 +3655,9 @@ foreach nf = NFSet.L in { defvar vreg = SegRegClass.RC; def nf # "E" # eew # "_V_" # LInfo : VPseudoUSSegStoreNoMask, - VSSEGSched; + VSSEGSched; def nf # "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoUSSegStoreMask, - VSSEGSched; + VSSEGSched; } } } @@ -3664,9 +3672,9 @@ foreach nf = NFSet.L in { defvar vreg = SegRegClass.RC; def nf # "E" # eew # "_V_" # LInfo : VPseudoSSegStoreNoMask, - VSSSEGSched; + VSSSEGSched; def nf # "E" # eew # "_V_" # LInfo # "_MASK" : VPseudoSSegStoreMask, - VSSSEGSched; + VSSSEGSched; } } } @@ -3693,11 +3701,11 @@ def nf # "EI" # idx_eew # "_V_" # IdxLInfo # "_" # ValLInfo : VPseudoISegStoreNoMask, - VSXSEGSched; + VSXSEGSched; def nf # "EI" # idx_eew # "_V_" # IdxLInfo # "_" # ValLInfo # "_MASK" : VPseudoISegStoreMask, - VSXSEGSched; + VSXSEGSched; } } } @@ -5149,10 +5157,8 @@ defm PseudoVL : VPseudoUSLoad; defm PseudoVS : VPseudoUSStore; -defm PseudoVLM : VPseudoLoadMask, - Sched<[WriteVLDM, ReadVLDX]>; -defm PseudoVSM : VPseudoStoreMask, - Sched<[WriteVSTM, ReadVSTX]>; +defm PseudoVLM : VPseudoLoadMask; +defm PseudoVSM : VPseudoStoreMask; //===----------------------------------------------------------------------===// // 7.5 Vector Strided Instructions 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 @@ -9,6 +9,7 @@ //===----------------------------------------------------------------------===// /// Define scheduler resources associated with def operands. +defvar UpperBoundLMUL = "UpperBound"; defvar SchedMxList = ["UpperBound", "M1", "M2", "M4", "M8", "MF2", "MF4", "MF8"]; // Used for widening and narrowing instructions as it doesn't contain M8. defvar SchedMxListW = ["UpperBound", "MF8", "MF4", "MF2", "M1", "M2", "M4"]; @@ -114,51 +115,51 @@ // 7. Vector Loads and Stores // 7.4. Vector Unit-Stride Instructions -def WriteVLDE : SchedWrite; -def WriteVSTE : SchedWrite; +defm "" : LMULSchedWrites<"WriteVLDE">; +defm "" : LMULSchedWrites<"WriteVSTE">; // 7.4.1. Vector Unit-Strided Mask -def WriteVLDM : SchedWrite; -def WriteVSTM : SchedWrite; +defm "" : LMULSchedWrites<"WriteVLDM">; +defm "" : LMULSchedWrites<"WriteVSTM">; // 7.5. Vector Strided Instructions -def WriteVLDS8 : SchedWrite; -def WriteVLDS16 : SchedWrite; -def WriteVLDS32 : SchedWrite; -def WriteVLDS64 : SchedWrite; -def WriteVSTS8 : SchedWrite; -def WriteVSTS16 : SchedWrite; -def WriteVSTS32 : SchedWrite; -def WriteVSTS64 : SchedWrite; +defm "" : LMULSchedWrites<"WriteVLDS8">; +defm "" : LMULSchedWrites<"WriteVLDS16">; +defm "" : LMULSchedWrites<"WriteVLDS32">; +defm "" : LMULSchedWrites<"WriteVLDS64">; +defm "" : LMULSchedWrites<"WriteVSTS8">; +defm "" : LMULSchedWrites<"WriteVSTS16">; +defm "" : LMULSchedWrites<"WriteVSTS32">; +defm "" : LMULSchedWrites<"WriteVSTS64">; // 7.6. Vector Indexed Instructions -def WriteVLDUX8 : SchedWrite; -def WriteVLDUX16 : SchedWrite; -def WriteVLDUX32 : SchedWrite; -def WriteVLDUX64 : SchedWrite; -def WriteVLDOX8 : SchedWrite; -def WriteVLDOX16 : SchedWrite; -def WriteVLDOX32 : SchedWrite; -def WriteVLDOX64 : SchedWrite; -def WriteVSTUX8 : SchedWrite; -def WriteVSTUX16 : SchedWrite; -def WriteVSTUX32 : SchedWrite; -def WriteVSTUX64 : SchedWrite; -def WriteVSTOX8 : SchedWrite; -def WriteVSTOX16 : SchedWrite; -def WriteVSTOX32 : SchedWrite; -def WriteVSTOX64 : SchedWrite; +defm "" : LMULSchedWrites<"WriteVLDUX8">; +defm "" : LMULSchedWrites<"WriteVLDUX16">; +defm "" : LMULSchedWrites<"WriteVLDUX32">; +defm "" : LMULSchedWrites<"WriteVLDUX64">; +defm "" : LMULSchedWrites<"WriteVLDOX8">; +defm "" : LMULSchedWrites<"WriteVLDOX16">; +defm "" : LMULSchedWrites<"WriteVLDOX32">; +defm "" : LMULSchedWrites<"WriteVLDOX64">; +defm "" : LMULSchedWrites<"WriteVSTUX8">; +defm "" : LMULSchedWrites<"WriteVSTUX16">; +defm "" : LMULSchedWrites<"WriteVSTUX32">; +defm "" : LMULSchedWrites<"WriteVSTUX64">; +defm "" : LMULSchedWrites<"WriteVSTOX8">; +defm "" : LMULSchedWrites<"WriteVSTOX16">; +defm "" : LMULSchedWrites<"WriteVSTOX32">; +defm "" : LMULSchedWrites<"WriteVSTOX64">; // 7.7. Vector Unit-stride Fault-Only-First Loads -def WriteVLDFF : SchedWrite; +defm "" : LMULSchedWrites<"WriteVLDFF">; // 7.8. Vector Segment Instructions foreach nf=2-8 in { foreach eew = [8, 16, 32, 64] in { - def WriteVLSEG # nf # e # eew : SchedWrite; - def WriteVSSEG # nf # e # eew : SchedWrite; - def WriteVLSEGFF # nf # e # eew : SchedWrite; - def WriteVLSSEG # nf # e # eew : SchedWrite; - def WriteVSSSEG # nf # e # eew : SchedWrite; - def WriteVLUXSEG # nf # e # eew : SchedWrite; - def WriteVLOXSEG # nf # e # eew : SchedWrite; - def WriteVSUXSEG # nf # e # eew : SchedWrite; - def WriteVSOXSEG # nf # e # eew : SchedWrite; + defm "" : LMULSchedWrites<"WriteVLSEG" # nf # e # eew>; + defm "" : LMULSchedWrites<"WriteVSSEG" # nf # e # eew>; + defm "" : LMULSchedWrites<"WriteVLSEGFF" # nf # e # eew>; + defm "" : LMULSchedWrites<"WriteVLSSEG" # nf # e # eew>; + defm "" : LMULSchedWrites<"WriteVSSSEG" # nf # e # eew>; + defm "" : LMULSchedWrites<"WriteVLUXSEG" # nf # e # eew>; + defm "" : LMULSchedWrites<"WriteVLOXSEG" # nf # e # eew>; + defm "" : LMULSchedWrites<"WriteVSUXSEG" # nf # e # eew>; + defm "" : LMULSchedWrites<"WriteVSOXSEG" # nf # e # eew>; } } // 7.9. Vector Whole Register Instructions @@ -356,41 +357,42 @@ def ReadVSETVL : SchedRead; // 7. Vector Loads and Stores -def ReadVLDX : SchedRead; -def ReadVSTX : SchedRead; +defm "" : LMULSchedReads<"ReadVLDX">; +defm "" : LMULSchedReads<"ReadVSTX">; // 7.4. Vector Unit-Stride Instructions -def ReadVSTEV : SchedRead; +defm "" : LMULSchedReads<"ReadVSTEV">; // 7.4.1. Vector Unit-Strided Mask -def ReadVSTM : SchedRead; +defm "" : LMULSchedReads<"ReadVSTM">; // 7.5. Vector Strided Instructions -def ReadVLDSX : SchedRead; -def ReadVSTSX : SchedRead; -def ReadVSTS8V : SchedRead; -def ReadVSTS16V : SchedRead; -def ReadVSTS32V : SchedRead; -def ReadVSTS64V : SchedRead; +defm "" : LMULSchedReads<"ReadVLDSX">; +defm "" : LMULSchedReads<"ReadVSTSX">; +defm "" : LMULSchedReads<"ReadVSTS8V">; +defm "" : LMULSchedReads<"ReadVSTS16V">; +defm "" : LMULSchedReads<"ReadVSTS32V">; +defm "" : LMULSchedReads<"ReadVSTS64V">; // 7.6. Vector Indexed Instructions -def ReadVLDUXV : SchedRead; -def ReadVLDOXV : SchedRead; -def ReadVSTUX8 : SchedRead; -def ReadVSTUX16 : SchedRead; -def ReadVSTUX32 : SchedRead; -def ReadVSTUX64 : SchedRead; -def ReadVSTUXV : SchedRead; -def ReadVSTUX8V : SchedRead; -def ReadVSTUX16V : SchedRead; -def ReadVSTUX32V : SchedRead; -def ReadVSTUX64V : SchedRead; -def ReadVSTOX8 : SchedRead; -def ReadVSTOX16 : SchedRead; -def ReadVSTOX32 : SchedRead; -def ReadVSTOX64 : SchedRead; -def ReadVSTOXV : SchedRead; -def ReadVSTOX8V : SchedRead; -def ReadVSTOX16V : SchedRead; -def ReadVSTOX32V : SchedRead; -def ReadVSTOX64V : SchedRead; +defm "" : LMULSchedReads<"ReadVLDUXV">; +defm "" : LMULSchedReads<"ReadVLDOXV">; +defm "" : LMULSchedReads<"ReadVSTUX8">; +defm "" : LMULSchedReads<"ReadVSTUX16">; +defm "" : LMULSchedReads<"ReadVSTUX32">; +defm "" : LMULSchedReads<"ReadVSTUX64">; +defm "" : LMULSchedReads<"ReadVSTUXV">; +defm "" : LMULSchedReads<"ReadVSTUX8V">; +defm "" : LMULSchedReads<"ReadVSTUX16V">; +defm "" : LMULSchedReads<"ReadVSTUX32V">; +defm "" : LMULSchedReads<"ReadVSTUX64V">; +defm "" : LMULSchedReads<"ReadVSTOX8">; +defm "" : LMULSchedReads<"ReadVSTOX16">; +defm "" : LMULSchedReads<"ReadVSTOX32">; +defm "" : LMULSchedReads<"ReadVSTOX64">; +defm "" : LMULSchedReads<"ReadVSTOXV">; +defm "" : LMULSchedReads<"ReadVSTOX8V">; +defm "" : LMULSchedReads<"ReadVSTOX16V">; +defm "" : LMULSchedReads<"ReadVSTOX32V">; +defm "" : LMULSchedReads<"ReadVSTOX64V">; // 7.9. Vector Whole Register Instructions +// These are already LMUL aware def ReadVST1R : SchedRead; def ReadVST2R : SchedRead; def ReadVST4R : SchedRead; @@ -586,35 +588,36 @@ def : WriteRes; // 7. Vector Loads and Stores -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; -def : WriteRes; +defm "" : LMULWriteRes<"WriteVLDE", []>; +defm "" : LMULWriteRes<"WriteVSTE", []>; +defm "" : LMULWriteRes<"WriteVLDM", []>; +defm "" : LMULWriteRes<"WriteVSTM", []>; +defm "" : LMULWriteRes<"WriteVLDS8", []>; +defm "" : LMULWriteRes<"WriteVLDS16", []>; +defm "" : LMULWriteRes<"WriteVLDS32", []>; +defm "" : LMULWriteRes<"WriteVLDS64", []>; +defm "" : LMULWriteRes<"WriteVSTS8", []>; +defm "" : LMULWriteRes<"WriteVSTS16", []>; +defm "" : LMULWriteRes<"WriteVSTS32", []>; +defm "" : LMULWriteRes<"WriteVSTS64", []>; +defm "" : LMULWriteRes<"WriteVLDUX8", []>; +defm "" : LMULWriteRes<"WriteVLDUX16", []>; +defm "" : LMULWriteRes<"WriteVLDUX32", []>; +defm "" : LMULWriteRes<"WriteVLDUX64", []>; +defm "" : LMULWriteRes<"WriteVLDOX8", []>; +defm "" : LMULWriteRes<"WriteVLDOX16", []>; +defm "" : LMULWriteRes<"WriteVLDOX32", []>; +defm "" : LMULWriteRes<"WriteVLDOX64", []>; +defm "" : LMULWriteRes<"WriteVSTUX8", []>; +defm "" : LMULWriteRes<"WriteVSTUX16", []>; +defm "" : LMULWriteRes<"WriteVSTUX32", []>; +defm "" : LMULWriteRes<"WriteVSTUX64", []>; +defm "" : LMULWriteRes<"WriteVSTOX8", []>; +defm "" : LMULWriteRes<"WriteVSTOX16", []>; +defm "" : LMULWriteRes<"WriteVSTOX32", []>; +defm "" : LMULWriteRes<"WriteVSTOX64", []>; +defm "" : LMULWriteRes<"WriteVLDFF", []>; +// These are already LMUL aware def : WriteRes; def : WriteRes; def : WriteRes; @@ -626,15 +629,15 @@ // Vector Segment Loads and Stores foreach nf=2-8 in { foreach eew = [8, 16, 32, 64] in { - def : WriteRes ("WriteVLSEG" # nf # "e" # eew), []>; - def : WriteRes ("WriteVLSEGFF" # nf # "e" # eew), []>; - def : WriteRes ("WriteVSSEG" # nf # "e" # eew), []>; - def : WriteRes ("WriteVLSSEG" # nf # "e" # eew), []>; - def : WriteRes ("WriteVSSSEG" # nf # "e" # eew), []>; - def : WriteRes ("WriteVLUXSEG" # nf # "e" # eew), []>; - def : WriteRes ("WriteVLOXSEG" # nf # "e" # eew), []>; - def : WriteRes ("WriteVSUXSEG" # nf # "e" # eew), []>; - def : WriteRes ("WriteVSOXSEG" # nf # "e" # eew), []>; + defm "" : LMULWriteRes <"WriteVLSEG" # nf # "e" # eew, []>; + defm "" : LMULWriteRes <"WriteVLSEGFF" # nf # "e" # eew, []>; + defm "" : LMULWriteRes <"WriteVSSEG" # nf # "e" # eew, []>; + defm "" : LMULWriteRes <"WriteVLSSEG" # nf # "e" # eew, []>; + defm "" : LMULWriteRes <"WriteVSSSEG" # nf # "e" # eew, []>; + defm "" : LMULWriteRes <"WriteVLUXSEG" # nf # "e" # eew, []>; + defm "" : LMULWriteRes <"WriteVLOXSEG" # nf # "e" # eew, []>; + defm "" : LMULWriteRes <"WriteVSUXSEG" # nf # "e" # eew, []>; + defm "" : LMULWriteRes <"WriteVSOXSEG" # nf # "e" # eew, []>; } } @@ -763,36 +766,37 @@ def : ReadAdvance; // 7. Vector Loads and Stores -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; -def : ReadAdvance; +defm "" : LMULReadAdvance<"ReadVLDX", 0>; +defm "" : LMULReadAdvance<"ReadVSTX", 0>; +defm "" : LMULReadAdvance<"ReadVSTEV", 0>; +defm "" : LMULReadAdvance<"ReadVSTM", 0>; +defm "" : LMULReadAdvance<"ReadVLDSX", 0>; +defm "" : LMULReadAdvance<"ReadVSTSX", 0>; +defm "" : LMULReadAdvance<"ReadVSTS8V", 0>; +defm "" : LMULReadAdvance<"ReadVSTS16V", 0>; +defm "" : LMULReadAdvance<"ReadVSTS32V", 0>; +defm "" : LMULReadAdvance<"ReadVSTS64V", 0>; +defm "" : LMULReadAdvance<"ReadVLDUXV", 0>; +defm "" : LMULReadAdvance<"ReadVLDOXV", 0>; +defm "" : LMULReadAdvance<"ReadVSTUXV", 0>; +defm "" : LMULReadAdvance<"ReadVSTUX8", 0>; +defm "" : LMULReadAdvance<"ReadVSTUX16", 0>; +defm "" : LMULReadAdvance<"ReadVSTUX32", 0>; +defm "" : LMULReadAdvance<"ReadVSTUX64", 0>; +defm "" : LMULReadAdvance<"ReadVSTUX8V", 0>; +defm "" : LMULReadAdvance<"ReadVSTUX16V", 0>; +defm "" : LMULReadAdvance<"ReadVSTUX32V", 0>; +defm "" : LMULReadAdvance<"ReadVSTUX64V", 0>; +defm "" : LMULReadAdvance<"ReadVSTOX8", 0>; +defm "" : LMULReadAdvance<"ReadVSTOX16", 0>; +defm "" : LMULReadAdvance<"ReadVSTOX32", 0>; +defm "" : LMULReadAdvance<"ReadVSTOX64", 0>; +defm "" : LMULReadAdvance<"ReadVSTOXV", 0>; +defm "" : LMULReadAdvance<"ReadVSTOX8V", 0>; +defm "" : LMULReadAdvance<"ReadVSTOX16V", 0>; +defm "" : LMULReadAdvance<"ReadVSTOX32V", 0>; +defm "" : LMULReadAdvance<"ReadVSTOX64V", 0>; +// These are already LMUL aware def : ReadAdvance; def : ReadAdvance; def : ReadAdvance;