diff options
author | Iago Toral Quiroga <[email protected]> | 2019-07-03 09:09:11 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2019-07-12 09:16:38 +0200 |
commit | d26b35ba4478993db85a9a2d3d36b22e941de9f7 (patch) | |
tree | b9304b4027d580545f516271de62a7593a4e70be | |
parent | aff8885cf9922516f59391aab7e87170ae9cd906 (diff) |
v3d: add helpers to emit ldtlb and ldtlbu signals
The ldtlbu version will read an implicit uniform with the TLB read
specifier and should be used for the first read in a sequence
of TLB reads (unless the default configuration is valid, in which
case we can use ldtlb). The ldtlb version is used for any subsequent
TLB read in the sequence.
Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r-- | src/broadcom/compiler/v3d_compiler.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/broadcom/compiler/v3d_compiler.h b/src/broadcom/compiler/v3d_compiler.h index cb466c0c59f..5c4e3046f50 100644 --- a/src/broadcom/compiler/v3d_compiler.h +++ b/src/broadcom/compiler/v3d_compiler.h @@ -1076,6 +1076,30 @@ vir_UMUL(struct v3d_compile *c, struct qreg src0, struct qreg src1) return vir_UMUL24(c, src0, src1); } +static inline struct qreg +vir_TLBU_COLOR_READ(struct v3d_compile *c, uint32_t config) +{ + assert(c->devinfo->ver >= 41); /* XXX */ + assert((config & 0xffffff00) == 0xffffff00); + + struct qinst *ldtlb = vir_add_inst(V3D_QPU_A_NOP, c->undef, + c->undef, c->undef); + ldtlb->qpu.sig.ldtlbu = true; + ldtlb->uniform = vir_get_uniform_index(c, QUNIFORM_CONSTANT, config); + return vir_emit_def(c, ldtlb); +} + +static inline struct qreg +vir_TLB_COLOR_READ(struct v3d_compile *c) +{ + assert(c->devinfo->ver >= 41); /* XXX */ + + struct qinst *ldtlb = vir_add_inst(V3D_QPU_A_NOP, c->undef, + c->undef, c->undef); + ldtlb->qpu.sig.ldtlb = true; + return vir_emit_def(c, ldtlb); +} + /* static inline struct qreg vir_LOAD_IMM(struct v3d_compile *c, uint32_t val) |