Port %pushv/str to vec4-stack style.

This commit is contained in:
Stephen Williams 2014-10-24 10:16:35 -07:00
parent 97bde47c31
commit 09d3a5de59
4 changed files with 14 additions and 16 deletions

View File

@ -23,11 +23,8 @@
static void fallback_eval(ivl_expr_t expr)
{
struct vector_info res = draw_eval_expr(expr, 0);
fprintf(vvp_out, " %%pushv/str %u, %u; Cast BOOL/LOGIC to string\n",
res.base, res.wid);
if (res.base > 0)
clr_vector(res);
draw_eval_vec4(expr);
fprintf(vvp_out, " %%pushv/str; Cast BOOL/LOGIC to string\n");
}
static void string_ex_concat(ivl_expr_t expr)

View File

@ -241,7 +241,7 @@ static const struct opcode_table_s opcode_table[] = {
{ "%pushi/real",of_PUSHI_REAL,2,{OA_BIT1, OA_BIT2, OA_NONE} },
{ "%pushi/str", of_PUSHI_STR, 1,{OA_STRING, OA_NONE, OA_NONE} },
{ "%pushi/vec4",of_PUSHI_VEC4,3,{OA_BIT1, OA_BIT2, OA_NUMBER} },
{ "%pushv/str", of_PUSHV_STR, 2, {OA_BIT1,OA_BIT2, OA_NONE} },
{ "%pushv/str", of_PUSHV_STR, 0,{OA_NONE, OA_NONE, OA_NONE} },
{ "%putc/str/vec4",of_PUTC_STR_VEC4,2,{OA_FUNC_PTR,OA_BIT1,OA_NONE} },
{ "%qpop/b/str",of_QPOP_B_STR,1,{OA_FUNC_PTR,OA_NONE, OA_NONE} },
{ "%qpop/b/v", of_QPOP_B_V, 1,{OA_FUNC_PTR,OA_NONE, OA_BIT2} },

View File

@ -1091,9 +1091,11 @@ possible logic values are:
This opcode is limited to 32bit numbers.
* %pushv/str <src>, <wid>
* %pushv/str
Convert a vector to a string and push the string to the string stack.
Convert a vector to a string and push the string to the string
stack. The single argument is popped from the vec4 stack and the
result pushed to the string stack.
* %putc/str/v <functor-label>, <muxr>

View File

@ -5385,13 +5385,14 @@ bool of_PUSHI_VEC4(vthread_t thr, vvp_code_t cp)
return true;
}
bool of_PUSHV_STR(vthread_t thr, vvp_code_t cp)
/*
* %pushv/str
* Pops a vec4 value, and pushes a string.
*/
bool of_PUSHV_STR(vthread_t thr, vvp_code_t)
{
#if 0
unsigned src = cp->bit_idx[0];
unsigned wid = cp->bit_idx[1];
vvp_vector4_t vec = thr->pop_vec4();
vvp_vector4_t vec = vthread_bits_to_vector(thr, src, wid);
size_t slen = (vec.size() + 7)/8;
vector<char>buf;
buf.reserve(slen);
@ -5418,9 +5419,7 @@ bool of_PUSHV_STR(vthread_t thr, vvp_code_t cp)
}
thr->push_str(val);
#else
fprintf(stderr, "XXXX NOT IMPLEMENTED: %%push/str ...\n");
#endif
return true;
}