diff options
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3.h')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3.h b/src/gallium/drivers/freedreno/ir3/ir3.h index 30932854884..430bcf22d6f 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3.h +++ b/src/gallium/drivers/freedreno/ir3/ir3.h @@ -205,6 +205,9 @@ struct ir3_instruction { int off; /* component/offset */ } fo; struct { + int aid; + } fi; + struct { struct ir3_block *if_block, *else_block; } flow; struct { @@ -264,6 +267,19 @@ struct ir3_instruction { */ struct ir3_instruction *address; + /* in case of a instruction with relative dst instruction, we need to + * capture the dependency on the fanin for the previous values of + * the array elements. Since we don't know at compile time actually + * which array elements are written, this serves to preserve the + * unconditional write to array elements prior to the conditional + * write. + * + * TODO only cat1 can do indirect write.. we could maybe move this + * into instr->cat1.fanin (but would require the frontend to insert + * the extra mov) + */ + struct ir3_instruction *fanin; + struct ir3_instruction *next; #ifdef DEBUG uint32_t serialno; @@ -373,6 +389,8 @@ static inline int ir3_instr_regno(struct ir3_instruction *instr, } +#define MAX_ARRAYS 16 + /* comp: * 0 - x * 1 - y @@ -498,6 +516,8 @@ static inline bool reg_gpr(struct ir3_register *r) static inline unsigned __ssa_src_cnt(struct ir3_instruction *instr) { + if (instr->fanin) + return instr->regs_count + 2; if (instr->address) return instr->regs_count + 1; return instr->regs_count; @@ -505,6 +525,8 @@ static inline unsigned __ssa_src_cnt(struct ir3_instruction *instr) static inline struct ir3_instruction * __ssa_src_n(struct ir3_instruction *instr, unsigned n) { + if (n == (instr->regs_count + 1)) + return instr->fanin; if (n == (instr->regs_count + 0)) return instr->address; return ssa(instr->regs[n]); |