This may have made a tiny bit of sense when we had one 4-arg inst per
shader, but if we only ever put 2 things in, having a pointer to 2 things
almost every instruction is pointless indirection.
inst->op = op;
inst->dst = dst;
- inst->src = calloc(2, sizeof(inst->src[0]));
inst->src[0] = src0;
inst->src[1] = src1;
inst->cond = QPU_COND_ALWAYS;
c->defs[qinst->dst.index] = NULL;
list_del(&qinst->link);
- free(qinst->src);
free(qinst);
}
enum qop op;
struct qreg dst;
- struct qreg *src;
+ struct qreg src[2];
bool sf;
bool cond_is_exec_mask;
uint8_t cond;
};
uint64_t unpack = 0;
- struct qpu_reg src[4];
+ struct qpu_reg src[ARRAY_SIZE(qinst->src)];
for (int i = 0; i < qir_get_op_nsrc(qinst->op); i++) {
int index = qinst->src[i].index;
switch (qinst->src[i].file) {