Fix for lossless width estimation in shift operations.
If the right hand operand of a shift is a signed vector value, it is coerced to an unsigned value. This needs to be allowed for when estimating the width expansion caused by a shift in a lossless expression.
This commit is contained in:
parent
2517ba9041
commit
f34a3020a6
|
|
@ -625,7 +625,7 @@ unsigned PEBLeftWidth::test_width(Design*des, NetScope*scope, width_mode_t&mode)
|
||||||
long r_val = LONG_MAX;
|
long r_val = LONG_MAX;
|
||||||
if (r_width < sizeof(long)*8) {
|
if (r_width < sizeof(long)*8) {
|
||||||
r_val = (1L << r_width) - 1L;
|
r_val = (1L << r_width) - 1L;
|
||||||
if (right_->has_sign())
|
if ((op_ == 'p') && right_->has_sign())
|
||||||
r_val >>= 1;
|
r_val >>= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue