Fix problems in rshift code.

This patch fixes the following problems in the right shift code.

The >>> result is only signed if the l-arg is also signed.

The r-arg is always unsigned.

Only sign extend the l-arg when the >>> operator is used.
This relates to an optimization for certain constant shifts.

Removed some obsoleted/outdated code.
(cherry picked from commit d7f272d14c)
This commit is contained in:
Cary R
2009-03-31 07:40:28 -07:00
committed by Stephen Williams
parent 710ad582ed
commit ceea5d568c
2 changed files with 12 additions and 32 deletions
+2 -2
View File
@@ -601,8 +601,8 @@ NetNet* NetEBShift::synthesize(Design*des, NetScope*scope, NetExpr*root)
return 0;
}
const bool right_flag = op_ == 'r' || op_ == 'R';
const bool signed_flag = op_ == 'R';
const bool right_flag = op_ == 'r' || op_ == 'R';
const bool signed_flag = has_sign();
/* Detect the special case where the shift amount is
constant. Evaluate the shift amount, and simply reconnect