Module: Mesa Branch: main Commit: 9e41c42ed4928f7bdd219ef7743cc38fb670427e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e41c42ed4928f7bdd219ef7743cc38fb670427e
Author: Alejandro PiƱeiro <[email protected]> Date: Tue Sep 14 01:15:58 2021 +0200 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13008> --- src/broadcom/compiler/vir_to_qpu.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/broadcom/compiler/vir_to_qpu.c b/src/broadcom/compiler/vir_to_qpu.c index aa33545420e..634b8961ba1 100644 --- a/src/broadcom/compiler/vir_to_qpu.c +++ b/src/broadcom/compiler/vir_to_qpu.c @@ -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; } }
