{
struct nv50_program_exec *e = CALLOC_STRUCT(nv50_program_exec);
+ e->param.index = -1;
return e;
}
}
static void
-set_cseg(struct nv50_pc *pc, struct nv50_reg *src, struct nv50_program_exec *e)
+set_data(struct nv50_pc *pc, struct nv50_reg *src, unsigned m, unsigned s,
+ struct nv50_program_exec *e)
{
set_long(pc, e);
if (src->type == P_IMMD) {
else
e->inst[1] |= (NV50_CB_PFP << 22);
}
+
+ e->param.index = src->hw;
+ e->param.shift = s;
+ e->param.mask = m << (s % 32);
}
static void
} else
if (src->type == P_IMMD || src->type == P_CONST) {
set_long(pc, e);
- set_cseg(pc, src, e);
- e->inst[0] |= (src->hw << 9);
+ set_data(pc, src, 0x7f, 9, e);
e->inst[1] |= 0x20000000; /* src0 const? */
} else {
if (src->type == P_ATTR) {
emit_mov(pc, temp, src);
src = temp;
} else {
- set_cseg(pc, src, e);
+ set_data(pc, src, 0x7f, 16, e);
e->inst[0] |= 0x00800000;
}
}
emit_mov(pc, temp, src);
src = temp;
} else {
- set_cseg(pc, src, e);
+ set_data(pc, src, 0x7f, 32+14, e);
e->inst[0] |= 0x01000000;
}
}
map = ws->buffer_map(ws, p->buffer, PIPE_BUFFER_USAGE_CPU_WRITE);
for (e = p->exec_head; e; e = e->next) {
+ if (e->param.index >= 0) {
+ e->inst[e->param.shift / 32] &= ~e->param.mask;
+ e->inst[e->param.shift / 32] |= (e->param.index <<
+ e->param.shift);
+ }
+
*(map++) = e->inst[0];
if (is_long(e))
*(map++) = e->inst[1];