From c56f21a20c7dfd62d199a7fae1dfae6c564b8706 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 31 Mar 2009 12:36:05 -0700 Subject: [PATCH] A right shift is only signed for an ARS. The signed_flag should only be set when the expression is signed and an ARS is used a normal RS should never be signed. (cherry picked from commit caab6cab9d3622f88c69a1d392f3c83c37fe23c2) --- expr_synth.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expr_synth.cc b/expr_synth.cc index 6cbdd64bf..3affe9086 100644 --- a/expr_synth.cc +++ b/expr_synth.cc @@ -602,7 +602,7 @@ NetNet* NetEBShift::synthesize(Design*des, NetScope*scope, NetExpr*root) } const bool right_flag = op_ == 'r' || op_ == 'R'; - const bool signed_flag = has_sign(); + const bool signed_flag = has_sign() && op_ == 'R'; /* Detect the special case where the shift amount is constant. Evaluate the shift amount, and simply reconnect