[QOP_TEX_B] = { "tex_b", 0, 2 },
[QOP_TEX_DIRECT] = { "tex_direct", 0, 2 },
[QOP_TEX_RESULT] = { "tex_result", 1, 0, true },
+
+ [QOP_LOAD_IMM] = { "load_imm", 0, 1 },
};
static const char *
fprintf(stderr, "null");
break;
+ case QFILE_LOAD_IMM:
+ fprintf(stderr, "0x%08x (%f)", reg.index, uif(reg.index));
+ break;
+
case QFILE_SMALL_IMM:
if ((int)reg.index >= -16 && (int)reg.index <= 15)
fprintf(stderr, "%d", reg.index);
QFILE_FRAG_Y,
QFILE_FRAG_REV_FLAG,
+ /**
+ * Stores an immediate value in the index field that will be used
+ * directly by qpu_load_imm().
+ */
+ QFILE_LOAD_IMM,
+
/**
* Stores an immediate value in the index field that can be turned
* into a small immediate field by qpu_encode_small_immediate().
* the destination
*/
QOP_TEX_RESULT,
+
+ QOP_LOAD_IMM,
};
struct queued_qpu_inst {
qir_MOV_dest(c, qir_reg(QFILE_VPM, 0), val);
}
+static inline struct qreg
+qir_LOAD_IMM(struct vc4_compile *c, uint32_t val)
+{
+ struct qreg t = qir_get_temp(c);
+ qir_emit(c, qir_inst(QOP_LOAD_IMM, t,
+ qir_reg(QFILE_LOAD_IMM, val), c->undef));
+ return t;
+}
+
#endif /* VC4_QIR_H */
case QFILE_FRAG_Y:
case QFILE_FRAG_REV_FLAG:
case QFILE_SMALL_IMM:
+ case QFILE_LOAD_IMM:
fail_instr(inst, "Bad dest file");
break;
}
case QFILE_VARY:
case QFILE_UNIF:
case QFILE_VPM:
+ case QFILE_LOAD_IMM:
break;
case QFILE_SMALL_IMM:
int index = qinst->src[i].index;
switch (qinst->src[i].file) {
case QFILE_NULL:
+ case QFILE_LOAD_IMM:
src[i] = qpu_rn(0);
break;
case QFILE_TEMP:
case QFILE_VARY:
case QFILE_UNIF:
case QFILE_SMALL_IMM:
+ case QFILE_LOAD_IMM:
case QFILE_FRAG_X:
case QFILE_FRAG_Y:
case QFILE_FRAG_REV_FLAG:
break;
+ case QOP_LOAD_IMM:
+ assert(qinst->src[0].file == QFILE_LOAD_IMM);
+ queue(c, qpu_load_imm_ui(dst, qinst->src[0].index));
+ break;
+
case QOP_MS_MASK:
src[1] = qpu_ra(QPU_R_MS_REV_FLAGS);
fixup_raddr_conflict(c, dst, &src[0], &src[1],