Arithmetic operands can do unsigned work and have signed result.

It is a quirk of the $signed() system function that the argument
is converted to signed, but the operation that is performed is
not changed. So arithmetic operators on unsigned arguments inside
a $signed() expression still perform unsigned arithmetic.
This commit is contained in:
Stephen Williams 2008-05-14 11:51:53 -07:00
parent a6dd97a5a6
commit 6b908aeec3
1 changed files with 1 additions and 1 deletions

View File

@ -1246,7 +1246,7 @@ static struct vector_info draw_binary_expr_arith(ivl_expr_t exp, unsigned wid)
struct vector_info lv;
struct vector_info rv;
const char*sign_string = ivl_expr_signed(exp)? "/s" : "";
const char*sign_string = ivl_expr_signed(le) && ivl_expr_signed(re)? "/s" : "";
if ((ivl_expr_opcode(exp) == '+')
&& (ivl_expr_type(le) == IVL_EX_SIGNAL)