Fix some subtle code generator bugs with wide literals and large r-values.
This commit is contained in:
parent
ec6009dd8f
commit
6a93b6a7e4
|
|
@ -579,7 +579,7 @@ static void draw_string_vec4(ivl_expr_t expr, int stuff_ok_flag)
|
||||||
fprintf(vvp_out, " %%pushi/vec4 %lu, 0, 32;\n", tmp);
|
fprintf(vvp_out, " %%pushi/vec4 %lu, 0, 32;\n", tmp);
|
||||||
tmp = 0;
|
tmp = 0;
|
||||||
tmp_wid = 0;
|
tmp_wid = 0;
|
||||||
if (push_flag != 0)
|
if (push_flag == 0)
|
||||||
push_flag += 1;
|
push_flag += 1;
|
||||||
else
|
else
|
||||||
fprintf(vvp_out, " %%concat/vec4;\n");
|
fprintf(vvp_out, " %%concat/vec4;\n");
|
||||||
|
|
@ -589,7 +589,7 @@ static void draw_string_vec4(ivl_expr_t expr, int stuff_ok_flag)
|
||||||
if (tmp_wid > 0) {
|
if (tmp_wid > 0) {
|
||||||
fprintf(vvp_out, " %%pushi/vec4 %lu, 0, %u;\n", tmp, tmp_wid);
|
fprintf(vvp_out, " %%pushi/vec4 %lu, 0, %u;\n", tmp, tmp_wid);
|
||||||
if (push_flag != 0)
|
if (push_flag != 0)
|
||||||
fprintf(vvp_out, " %%oncat/vec4;\n");
|
fprintf(vvp_out, " %%concat/vec4;\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
free(fp);
|
free(fp);
|
||||||
|
|
|
||||||
|
|
@ -640,7 +640,15 @@ static int show_stmt_assign_vector(ivl_statement_t net)
|
||||||
fprintf(vvp_out, " %%cvt/vr %u;\n", wid);
|
fprintf(vvp_out, " %%cvt/vr %u;\n", wid);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
unsigned wid = ivl_stmt_lwidth(net);
|
||||||
draw_eval_vec4(rval, 0);
|
draw_eval_vec4(rval, 0);
|
||||||
|
if (ivl_expr_width(rval)==wid) {
|
||||||
|
; /* Normally, the rval expression size is correct. */
|
||||||
|
} else if (ivl_expr_signed(rval)) {
|
||||||
|
fprintf(vvp_out, " %%pad/s %u;\n", wid);
|
||||||
|
} else {
|
||||||
|
fprintf(vvp_out, " %%pad/u %u;\n", wid);
|
||||||
|
}
|
||||||
//res.base = 0; // XXXX This is just to suppress the clr_vector below.
|
//res.base = 0; // XXXX This is just to suppress the clr_vector below.
|
||||||
//res.wid = 0;
|
//res.wid = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue