while (int(arg.bits.size()) < width)
arg.bits.push_back(padding);
+
+ arg.bits.resize(width);
}
static void extend_u0(RTLIL::Const &arg, int width, bool is_signed)
while (int(arg.bits.size()) < width)
arg.bits.push_back(padding);
+
+ arg.bits.resize(width);
}
static BigInteger const2big(const RTLIL::Const &val, bool as_signed, int &undef_bit_pos)
RTLIL::Const RTLIL::const_shr(const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool, int result_len)
{
RTLIL::Const arg1_ext = arg1;
- extend_u0(arg1_ext, result_len, signed1);
+ extend_u0(arg1_ext, std::max(result_len, SIZE(arg1)), signed1);
return const_shift_worker(arg1_ext, arg2, false, +1, result_len);
}