diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td --- a/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td +++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZb.td @@ -429,24 +429,28 @@ let Predicates = [HasStdExtZbt] in { def CMIX : RVBTernaryR<0b11, 0b001, OPC_OP, "cmix", "$rd, $rs2, $rs1, $rs3">, - Sched<[]>; + Sched<[WriteCMix, ReadCMix, ReadCMix, ReadCMix]>; def CMOV : RVBTernaryR<0b11, 0b101, OPC_OP, "cmov", "$rd, $rs2, $rs1, $rs3">, - Sched<[]>; + Sched<[WriteCMov, ReadCMov, ReadCMov, ReadCMov]>; def FSL : RVBTernaryR<0b10, 0b001, OPC_OP, "fsl", "$rd, $rs1, $rs3, $rs2">, - Sched<[]>; + Sched<[WriteFSReg, ReadFSReg, ReadFSReg, ReadFSReg]>; def FSR : RVBTernaryR<0b10, 0b101, OPC_OP, "fsr", "$rd, $rs1, $rs3, $rs2">, - Sched<[]>; + Sched<[WriteFSReg, ReadFSReg, ReadFSReg, ReadFSReg]>; def FSRI : RVBTernaryImm6<0b101, OPC_OP_IMM, "fsri", - "$rd, $rs1, $rs3, $shamt">, Sched<[]>; + "$rd, $rs1, $rs3, $shamt">, + Sched<[WriteFSRImm, ReadFSRImm, ReadFSRImm]>; } // Predicates = [HasStdExtZbt] let Predicates = [HasStdExtZbt, IsRV64] in { def FSLW : RVBTernaryR<0b10, 0b001, OPC_OP_32, - "fslw", "$rd, $rs1, $rs3, $rs2">, Sched<[]>; + "fslw", "$rd, $rs1, $rs3, $rs2">, + Sched<[WriteFSReg32, ReadFSReg32, ReadFSReg32, ReadFSReg32]>; def FSRW : RVBTernaryR<0b10, 0b101, OPC_OP_32, "fsrw", - "$rd, $rs1, $rs3, $rs2">, Sched<[]>; + "$rd, $rs1, $rs3, $rs2">, + Sched<[WriteFSReg32, ReadFSReg32, ReadFSReg32, ReadFSReg32]>; def FSRIW : RVBTernaryImm5<0b10, 0b101, OPC_OP_IMM_32, - "fsriw", "$rd, $rs1, $rs3, $shamt">, Sched<[]>; + "fsriw", "$rd, $rs1, $rs3, $shamt">, + Sched<[WriteFSRImm32, ReadFSRImm32, ReadFSRImm32]>; } // Predicates = [HasStdExtZbt, IsRV64] let Predicates = [HasStdExtZbb] in { diff --git a/llvm/lib/Target/RISCV/RISCVSchedRocket.td b/llvm/lib/Target/RISCV/RISCVSchedRocket.td --- a/llvm/lib/Target/RISCV/RISCVSchedRocket.td +++ b/llvm/lib/Target/RISCV/RISCVSchedRocket.td @@ -245,5 +245,6 @@ defm : UnsupportedSchedZbe; defm : UnsupportedSchedZbf; defm : UnsupportedSchedZbm; +defm : UnsupportedSchedZbt; defm : UnsupportedSchedZfh; } 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 @@ -232,5 +232,6 @@ defm : UnsupportedSchedZbe; defm : UnsupportedSchedZbf; defm : UnsupportedSchedZbm; +defm : UnsupportedSchedZbt; defm : UnsupportedSchedZfh; } diff --git a/llvm/lib/Target/RISCV/RISCVScheduleB.td b/llvm/lib/Target/RISCV/RISCVScheduleB.td --- a/llvm/lib/Target/RISCV/RISCVScheduleB.td +++ b/llvm/lib/Target/RISCV/RISCVScheduleB.td @@ -46,6 +46,14 @@ // Zbm extension def WriteBMatrix : SchedWrite; // bmator/bmatxor/bmatflip +// Zbt extension +def WriteCMix : SchedWrite; // cmix +def WriteCMov : SchedWrite; // cmov +def WriteFSReg : SchedWrite; // fsl/fsr +def WriteFSRImm : SchedWrite; // fsri +def WriteFSReg32 : SchedWrite; // fslw/fsrw +def WriteFSRImm32 : SchedWrite; // fsriw + /// Define scheduler resources associated with use operands. // Zba extension @@ -86,6 +94,14 @@ // Zbm extension def ReadBMatrix : SchedRead; // bmator/bmatxor/bmatflip +// Zbt extension +def ReadCMix : SchedRead; // cmix +def ReadCMov : SchedRead; // cmov +def ReadFSReg : SchedRead; // fsl/fsr +def ReadFSRImm : SchedRead; // fsri +def ReadFSReg32 : SchedRead; // fslw/fsrw +def ReadFSRImm32 : SchedRead; // fsriw + /// Define default scheduler resources for B. multiclass UnsupportedSchedZba { @@ -177,3 +193,21 @@ def : ReadAdvance; } } + +multiclass UnsupportedSchedZbt { +let Unsupported = true in { +def : WriteRes; +def : WriteRes; +def : WriteRes; +def : WriteRes; +def : WriteRes; +def : WriteRes; + +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +} +}