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.
This commit is contained in:
parent
319b886118
commit
c0a4b7c670
|
|
@ -1775,7 +1775,7 @@ NetExpr* evaluate_abs(NetExpr*arg)
|
|||
NetEConst*tmpi = dynamic_cast<NetEConst *>(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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue