From c0a4b7c6700447750dc77c614053e8b6f5adbbb5 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sat, 30 Aug 2008 17:35:57 -0700 Subject: [PATCH] Fix a bug in vector evaluation of abs(). The calculation of the abs of a signed value was inverting the value if it was signed, and not if it was negative. --- eval_tree.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eval_tree.cc b/eval_tree.cc index 50fdaf02b..3b82d99f6 100644 --- a/eval_tree.cc +++ b/eval_tree.cc @@ -1775,7 +1775,7 @@ NetExpr* evaluate_abs(NetExpr*arg) NetEConst*tmpi = dynamic_cast(arg); if (tmpi) { verinum arg = tmpi->value(); - if (arg.has_sign()) { + if (arg.is_negative()) { arg = v_not(arg) + verinum(1); } return new NetEConst(arg);