broadcom/compiler: remove qpu_acc helper

It is really small, and used just twice, so we just call qpu_magic.

We also update how it is used:

  * QFILE_NULL is an undef so we can just load anything. Previously we
    were using accumulator 0, but there isn't any real reason to use
    an accumulator for this. Using reg 0.

  * QFILE_LOAD_IMM: it seems that we don't use at all right now, so
    let's add an assert

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13008>
This commit is contained in:
Alejandro Piñeiro 2021-09-14 01:15:58 +02:00 committed by Marge Bot
parent 193898c8b0
commit 9e41c42ed4
1 changed files with 7 additions and 8 deletions

View File

@ -45,12 +45,6 @@ qpu_magic(enum v3d_qpu_waddr waddr)
return reg;
}
static inline struct qpu_reg
qpu_acc(int acc)
{
return qpu_magic(V3D_QPU_WADDR_R0 + acc);
}
struct v3d_qpu_instr
v3d_qpu_nop(void)
{
@ -219,8 +213,13 @@ v3d_generate_code_block(struct v3d_compile *c,
src[i] = qpu_magic(qinst->src[i].index);
break;
case QFILE_NULL:
/* QFILE_NULL is an undef, so we can load
* anything. Using reg 0
*/
src[i] = qpu_reg(0);
break;
case QFILE_LOAD_IMM:
src[i] = qpu_acc(0);
assert(!"not reached");
break;
case QFILE_TEMP:
src[i] = temp_registers[index];
@ -238,7 +237,7 @@ v3d_generate_code_block(struct v3d_compile *c,
temp = new_qpu_nop_before(qinst);
temp->qpu.sig.ldvpm = true;
src[i] = qpu_acc(3);
src[i] = qpu_magic(V3D_QPU_WADDR_R3);
break;
}
}