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:
parent
9037354c6b
commit
e5597d5f44
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue