3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-09-28 04:09:02 +00:00

peepopt: Add left-shift 'shiftmul' variant

Add a separate shiftmul pattern to match on left shifts which implement
demuxing. This mirrors the right shift pattern matcher but is probably
best kept separate instead of merging the two into a single matcher.
In any case the diff of the two matchers should be easily readable.
This commit is contained in:
Martin Povišer 2023-08-02 18:04:54 +02:00
parent 038a5e1ed4
commit aa9b86aeec
4 changed files with 167 additions and 5 deletions

View file

@ -59,7 +59,7 @@ struct PeepoptPass : public Pass {
if (!genmode.empty())
{
if (genmode == "shiftmul")
GENERATE_PATTERN(peepopt_pm, shiftmul);
GENERATE_PATTERN(peepopt_pm, shiftmul_right);
else if (genmode == "muldiv")
GENERATE_PATTERN(peepopt_pm, muldiv);
else
@ -79,7 +79,8 @@ struct PeepoptPass : public Pass {
pm.setup(module->selected_cells());
pm.run_shiftmul();
pm.run_shiftmul_right();
pm.run_shiftmul_left();
pm.run_muldiv();
}
}