diff --git a/kernel/celledges.cc b/kernel/celledges.cc index c6615968f..2d8177d31 100644 --- a/kernel/celledges.cc +++ b/kernel/celledges.cc @@ -227,11 +227,11 @@ void shift_op(AbstractCellEdgesDatabase *db, RTLIL::Cell *cell) db->add_edge(cell, ID::B, k, ID::Y, i, -1); } else if (cell->type.in(ID($shr), ID($sshr)) && is_signed) { bool shift_in_bulk = i < a_width - 1; - // can we jump into the ambient x-bits by toggling B[k]? - bool x_jump = (((y_width - i) & ((1 << (k + 1)) - 1)) != 0 \ + // can we jump into the zero-padding by toggling B[k]? + bool zpad_jump = (((y_width - i) & ((1 << (k + 1)) - 1)) != 0 \ && (((y_width - i) & ~(1 << k)) < (1 << b_width))); - if (shift_in_bulk || (cell->type == ID($shr) && x_jump)) + if (shift_in_bulk || (cell->type == ID($shr) && zpad_jump)) db->add_edge(cell, ID::B, k, ID::Y, i, -1); } else { if (i < a_width)