From 4dcebe4024f8e64376536ac1e9f3e53d85a313fb Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 6 Jul 2010 14:30:26 -0700 Subject: [PATCH] Only set the multiply width if it is greater than zero and vectorable We only need to set the width of a multiple if the width is greater than zero and if the expression is vectorable. This matches what is done for addition. --- elab_expr.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elab_expr.cc b/elab_expr.cc index ce7e64901..11c21a976 100644 --- a/elab_expr.cc +++ b/elab_expr.cc @@ -794,7 +794,7 @@ NetExpr* PEBinary::elaborate_expr_base_mult_(Design*des, NetEBMult*tmp = new NetEBMult(op_, lp, rp); tmp->set_line(*this); - if (expr_wid > 0) + if (expr_wid > 0 && type_is_vectorable(tmp->expr_type())) tmp->set_width(expr_wid, false); return tmp; @@ -816,7 +816,7 @@ NetExpr* PEBinary::elaborate_expr_base_add_(Design*des, use_lossless_flag = false; // If the expression is unsigned, then force the operands to - // unsigned so taht the set_width below doesn't cause them to + // unsigned so that the set_width below doesn't cause them to // be sign-extended. if (! is_pexpr) suppress_binary_operand_sign_if_needed(lp, rp);