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 @@ -76,6 +76,35 @@ let ResourceCycles = [1, 15]; } +// Bitmanip +let Latency = 3 in { +// Rotates are in the late-B ALU. +def : WriteRes; +def : WriteRes; +def : WriteRes; +def : WriteRes; + +// clz[w]/ctz[w] are in the late-B ALU. +def : WriteRes; +def : WriteRes; +def : WriteRes; +def : WriteRes; + +// cpop[w] look exactly like multiply. +def : WriteRes; +def : WriteRes; + +// orc.b is in the late-B ALU. +def : WriteRes; + +// rev8 is in the late-A and late-B ALUs. +def : WriteRes; + +// shNadd[.uw] is on the early-B and late-B ALUs. +def : WriteRes; +def : WriteRes; +} + // Memory def : WriteRes; def : WriteRes; @@ -279,11 +308,25 @@ def : ReadAdvance; +// Bitmanip +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; + //===----------------------------------------------------------------------===// // Unsupported extensions defm : UnsupportedSchedV; -defm : UnsupportedSchedZba; -defm : UnsupportedSchedZbb; defm : UnsupportedSchedZbc; defm : UnsupportedSchedZbs; defm : UnsupportedSchedZbkb;