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:
Martin Whitaker
2011-04-13 18:55:54 -07:00
committed by Stephen Williams
parent 2517ba9041
commit f34a3020a6
+1 -1
View File
@@ -625,7 +625,7 @@ unsigned PEBLeftWidth::test_width(Design*des, NetScope*scope, width_mode_t&mode)
long r_val = LONG_MAX;
if (r_width < sizeof(long)*8) {
r_val = (1L << r_width) - 1L;
if (right_->has_sign())
if ((op_ == 'p') && right_->has_sign())
r_val >>= 1;
}