summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/ir3/ir3.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2015-01-23 15:04:46 -0500
committerRob Clark <[email protected]>2015-03-08 17:42:43 -0400
commit060d3499202c339a27fbc366335f2122ed4ff7bc (patch)
treec4135c86fd9c28be0f67ca1257f3c048730a7405 /src/gallium/drivers/freedreno/ir3/ir3.h
parentb7703212d8dc2b38407565768ac45d1a307cd810 (diff)
freedreno/ir3: relative dst
To simplify RA, assign arrays that are written to first. Since enough dependency information is in the graph to preserve order of reads and writes of array, so all SSA names for the array collapse into one, just assign the entire thing by array-id. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3.h')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3.h22
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]);