Handle signed IVL_VT_BOOL load into integer.

The %ix/get should be %is/get/s if the source expression is
signed. This gets proper sign extension.
This commit is contained in:
Stephen Williams 2010-10-21 17:04:56 -07:00
parent 9037354c6b
commit e5597d5f44
1 changed files with 5 additions and 1 deletions

View File

@ -47,10 +47,14 @@ static int eval_bool64_logic(ivl_expr_t expr)
{
int res;
struct vector_info tmp;
const char*s_flag = "";
tmp = draw_eval_expr(expr, STUFF_OK_XZ);
res = allocate_word();
fprintf(vvp_out, " %%ix/get %d, %u, %u;\n", res, tmp.base, tmp.wid);
if (ivl_expr_signed(expr))
s_flag = "/s";
fprintf(vvp_out, " %%ix/get%s %d, %u, %u;\n", s_flag, res, tmp.base, tmp.wid);
clr_vector(tmp);
return res;