instr = (struct ir3_instruction *)ptr;
ptr += sizeof(*instr);
instr->regs = (struct ir3_register **)ptr;
+ instr->dsts = (struct ir3_register **)ptr;
#ifdef DEBUG
instr->regs_max = ndst + nsrc;
{
struct ir3_instruction *new_instr = instr_create(instr->block, instr->opc,
instr->dsts_count, instr->srcs_count);
- struct ir3_register **regs;
+ struct ir3_register **regs, **dsts, **srcs;
unsigned i;
regs = new_instr->regs;
+ dsts = new_instr->dsts;
+ srcs = new_instr->srcs;
*new_instr = *instr;
new_instr->regs = regs;
+ new_instr->dsts = dsts;
+ new_instr->srcs = srcs;
insert_instr(instr->block, new_instr);
#ifdef DEBUG
debug_assert(instr->srcs_count < instr->srcs_max);
#endif
+ if (instr->srcs_count == 0)
+ instr->srcs = instr->regs + instr->dsts_count;
instr->srcs_count++;
return ir3_reg_create(instr, num, flags);
}
#endif
unsigned regs_count, srcs_count, dsts_count;
struct ir3_register **regs;
+ struct ir3_register **dsts;
+ struct ir3_register **srcs;
union {
struct {
char inv1, inv2;