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 @@ -524,15 +524,19 @@ let Predicates = [HasStdExtZbe] in { // NOTE: These mnemonics are from the 0.94 spec. There is a name conflict with // bext in the 0.93 spec. -def BDECOMPRESS : ALU_rr<0b0100100, 0b110, "bdecompress">, Sched<[]>; -def BCOMPRESS : ALU_rr<0b0000100, 0b110, "bcompress">, Sched<[]>; +def BDECOMPRESS : ALU_rr<0b0100100, 0b110, "bdecompress">, + Sched<[WriteDecompress, ReadDecompress, ReadDecompress]>; +def BCOMPRESS : ALU_rr<0b0000100, 0b110, "bcompress">, + Sched<[WriteCompress, ReadCompress, ReadCompress]>; } // Predicates = [HasStdExtZbe] let Predicates = [HasStdExtZbe, IsRV64] in { // NOTE: These mnemonics are from the 0.94 spec. There is a name conflict with // bextw in the 0.93 spec. -def BDECOMPRESSW : ALUW_rr<0b0100100, 0b110, "bdecompressw">, Sched<[]>; -def BCOMPRESSW : ALUW_rr<0b0000100, 0b110, "bcompressw">, Sched<[]>; +def BDECOMPRESSW : ALUW_rr<0b0100100, 0b110, "bdecompressw">, + Sched<[WriteDecompress32, ReadDecompress32, ReadDecompress32]>; +def BCOMPRESSW : ALUW_rr<0b0000100, 0b110, "bcompressw">, + Sched<[WriteCompress32, ReadCompress32, ReadCompress32]>; } // Predicates = [HasStdExtZbe, IsRV64] let Predicates = [HasStdExtZbpOrZbkb] in { @@ -551,10 +555,12 @@ let Predicates = [HasStdExtZbm, IsRV64] in { def BMATFLIP : RVBUnary<0b0110000, 0b00011, 0b001, OPC_OP_IMM, "bmatflip">, - Sched<[]>; + Sched<[WriteBMatrix, ReadBMatrix]>; -def BMATOR : ALU_rr<0b0000100, 0b011, "bmator">, Sched<[]>; -def BMATXOR : ALU_rr<0b0100100, 0b011, "bmatxor">, Sched<[]>; +def BMATOR : ALU_rr<0b0000100, 0b011, "bmator">, + Sched<[WriteBMatrix, ReadBMatrix, ReadBMatrix]>; +def BMATXOR : ALU_rr<0b0100100, 0b011, "bmatxor">, + Sched<[WriteBMatrix, ReadBMatrix, ReadBMatrix]>; } // Predicates = [HasStdExtZbm, IsRV64] let Predicates = [HasStdExtZbf] 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 @@ -242,6 +242,8 @@ defm : UnsupportedSchedZbb; defm : UnsupportedSchedZbc; defm : UnsupportedSchedZbs; +defm : UnsupportedSchedZbe; defm : UnsupportedSchedZbf; +defm : UnsupportedSchedZbm; 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 @@ -229,6 +229,8 @@ defm : UnsupportedSchedZbb; defm : UnsupportedSchedZbc; defm : UnsupportedSchedZbs; +defm : UnsupportedSchedZbe; defm : UnsupportedSchedZbf; +defm : UnsupportedSchedZbm; 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 @@ -33,10 +33,19 @@ def WriteSingleBit : SchedWrite; // BCLR/BSET/BINV/BEXT def WriteSingleBitImm: SchedWrite; // BCLRI/BSETI/BINVI/BEXTI +// Zbe extension +def WriteDecompress : SchedWrite; // bdecompress +def WriteCompress : SchedWrite; // bcompress +def WriteDecompress32: SchedWrite; // bdecompressw +def WriteCompress32 : SchedWrite; // bcompressw + // Zbf extension def WriteBFP : SchedWrite; // BFP def WriteBFP32 : SchedWrite; // BFPW +// Zbm extension +def WriteBMatrix : SchedWrite; // bmator/bmatxor/bmatflip + /// Define scheduler resources associated with use operands. // Zba extension @@ -64,10 +73,19 @@ def ReadSingleBit : SchedRead; // BCLR/BSET/BINV/BEXT def ReadSingleBitImm: SchedRead; // BCLRI/BSETI/BINVI/BEXTI +// Zbe extension +def ReadDecompress : SchedRead; // bdecompress +def ReadCompress : SchedRead; // bcompress +def ReadDecompress32: SchedRead; // bdecompressw +def ReadCompress32 : SchedRead; // bcompressw + // Zbf extension def ReadBFP : SchedRead; // BFP def ReadBFP32 : SchedRead; // BFPW +// Zbm extension +def ReadBMatrix : SchedRead; // bmator/bmatxor/bmatflip + /// Define default scheduler resources for B. multiclass UnsupportedSchedZba { @@ -128,6 +146,20 @@ } } +multiclass UnsupportedSchedZbe { +let Unsupported = true in { +def : WriteRes; +def : WriteRes; +def : WriteRes; +def : WriteRes; + +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +def : ReadAdvance; +} +} + multiclass UnsupportedSchedZbf { let Unsupported = true in { def : WriteRes; @@ -137,3 +169,11 @@ def : ReadAdvance; } } + +multiclass UnsupportedSchedZbm { +let Unsupported = true in { +def : WriteRes; + +def : ReadAdvance; +} +}