Skip to content

Commit cdffaac

Browse files
[RISCV] Add Zbs instructions to SiFive7 SchedModel
BEXT[I] is available on A and B pipes, and has single-cycle latency. The other instructions are only available on B-pipe, but otherwise have single-cycle latency.
1 parent e83b8a5 commit cdffaac

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

llvm/lib/Target/RISCV/RISCVSchedSiFive7.td

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,16 @@ def : WriteRes<WriteSHXADD, [SiFive7PipeB]>;
292292
def : WriteRes<WriteSHXADD32, [SiFive7PipeB]>;
293293
}
294294

295+
// Single-bit instructions
296+
// BEXT[I] instruction is available on all ALUs and the other instructions
297+
// are only available on the SiFive7B pipe.
298+
let Latency = 3 in {
299+
def : WriteRes<WriteSingleBit, [SiFive7PipeB]>;
300+
def : WriteRes<WriteSingleBitImm, [SiFive7PipeB]>;
301+
def : WriteRes<WriteBEXT, [SiFive7PipeAB]>;
302+
def : WriteRes<WriteBEXTI, [SiFive7PipeAB]>;
303+
}
304+
295305
// Memory
296306
def : WriteRes<WriteSTB, [SiFive7PipeA]>;
297307
def : WriteRes<WriteSTH, [SiFive7PipeA]>;
@@ -987,6 +997,9 @@ def : SiFive7AnyToGPRBypass<ReadORCB>;
987997
def : SiFive7AnyToGPRBypass<ReadREV8>;
988998
def : SiFive7AnyToGPRBypass<ReadSHXADD>;
989999
def : SiFive7AnyToGPRBypass<ReadSHXADD32>;
1000+
// Single-bit instructions
1001+
def : SiFive7AnyToGPRBypass<ReadSingleBit>;
1002+
def : SiFive7AnyToGPRBypass<ReadSingleBitImm>;
9901003

9911004
// 6. Configuration-Setting Instructions
9921005
def : ReadAdvance<ReadVSETVLI, 2>;
@@ -1158,7 +1171,6 @@ def : ReadAdvance<ReadVMask, 0>;
11581171
//===----------------------------------------------------------------------===//
11591172
// Unsupported extensions
11601173
defm : UnsupportedSchedZbc;
1161-
defm : UnsupportedSchedZbs;
11621174
defm : UnsupportedSchedZbkb;
11631175
defm : UnsupportedSchedZbkx;
11641176
defm : UnsupportedSchedZfa;

0 commit comments

Comments
 (0)