broadcom/vc5: Add support for loading varyings in V3D 4.1.

The LDVARY signal now writes an arbitrary register, so I took out the
magic src register file and replaced it with an instruction with LDVARY
set so we have somewhere to hang a QFILE_TEMP destination for register
allocation.
This commit is contained in:
Eric Anholt
2018-01-11 11:53:13 -08:00
parent af9753e246
commit 368bab43fd
6 changed files with 13 additions and 17 deletions

View File

@@ -395,9 +395,20 @@ static struct qreg
emit_fragment_varying(struct v3d_compile *c, nir_variable *var,
uint8_t swizzle)
{
struct qreg vary = vir_reg(QFILE_VARY, ~0);
struct qreg r3 = vir_reg(QFILE_MAGIC, V3D_QPU_WADDR_R3);
struct qreg r5 = vir_reg(QFILE_MAGIC, V3D_QPU_WADDR_R5);
struct qreg vary;
if (c->devinfo->ver >= 41) {
struct qinst *ldvary = vir_add_inst(V3D_QPU_A_NOP, c->undef,
c->undef, c->undef);
ldvary->qpu.sig.ldvary = true;
vary = vir_emit_def(c, ldvary);
} else {
vir_NOP(c)->qpu.sig.ldvary = true;
vary = r3;
}
/* For gl_PointCoord input or distance along a line, we'll be called
* with no nir_variable, and we don't count toward VPM size so we
* don't track an input slot.

View File

@@ -73,7 +73,6 @@ enum qfile {
* or physical registers later.
*/
QFILE_TEMP,
QFILE_VARY,
QFILE_UNIF,
QFILE_TLB,
QFILE_TLBU,

View File

@@ -110,6 +110,7 @@ vir_has_side_effects(struct v3d_compile *c, struct qinst *inst)
}
if (inst->qpu.sig.ldtmu ||
inst->qpu.sig.ldvary ||
inst->qpu.sig.wrtmuc ||
inst->qpu.sig.thrsw) {
return true;
@@ -210,7 +211,6 @@ vir_writes_r3(const struct v3d_device_info *devinfo, struct qinst *inst)
{
for (int i = 0; i < vir_get_nsrc(inst); i++) {
switch (inst->src[i].file) {
case QFILE_VARY:
case QFILE_VPM:
return true;
default:

View File

@@ -29,7 +29,6 @@ vir_print_reg(struct v3d_compile *c, struct qreg reg)
{
static const char *files[] = {
[QFILE_TEMP] = "t",
[QFILE_VARY] = "v",
[QFILE_UNIF] = "u",
[QFILE_TLB] = "tlb",
[QFILE_TLBU] = "tlbu",

View File

@@ -78,12 +78,6 @@ has_nonremovable_reads(struct v3d_compile *c, struct qinst *inst)
if (total_size == 1)
return true;
}
/* Dead code removal of varyings is tricky, so just assert
* that it all happened at the NIR level.
*/
if (inst->src[i].file == QFILE_VARY)
return true;
}
return false;

View File

@@ -189,12 +189,6 @@ v3d_generate_code_block(struct v3d_compile *c,
src[i] = qpu_acc(5);
break;
case QFILE_VARY:
temp = new_qpu_nop_before(qinst);
temp->qpu.sig.ldvary = true;
src[i] = qpu_acc(3);
break;
case QFILE_SMALL_IMM:
abort(); /* XXX */
#if 0
@@ -255,7 +249,6 @@ v3d_generate_code_block(struct v3d_compile *c,
dst = qpu_magic(V3D_QPU_WADDR_TLBU);
break;
case QFILE_VARY:
case QFILE_UNIF:
case QFILE_SMALL_IMM:
case QFILE_LOAD_IMM: