summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2021-06-18 14:01:58 +0200
committerMarge Bot <eric+marge@anholt.net>2021-06-23 17:20:29 +0000
commitdb7814ad56468b7fd5ffb6e8469ade10ae64a4c6 (patch)
treefb1e550802867bc71158ab04213bba98cd1a207a /src
parent59b9935877ee29a4ad7f83ac6f0753781530f08b (diff)
ir3: Add srcs/dsts arrays to ir3_instruction
Initially these will shadow regs, so that we can transition things before getting rid of regs. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11469>
Diffstat (limited to 'src')
-rw-r--r--src/freedreno/ir3/ir3.c9
-rw-r--r--src/freedreno/ir3/ir3.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 59e2777767f..11d7054e173 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -400,6 +400,7 @@ static struct ir3_instruction *instr_create(struct ir3_block *block,
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;
@@ -424,12 +425,16 @@ struct ir3_instruction * ir3_instr_clone(struct ir3_instruction *instr)
{
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);
@@ -482,6 +487,8 @@ struct ir3_register * ir3_src_create(struct ir3_instruction *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);
}
diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h
index 141906d50d3..ca58233df89 100644
--- a/src/freedreno/ir3/ir3.h
+++ b/src/freedreno/ir3/ir3.h
@@ -283,6 +283,8 @@ struct ir3_instruction {
#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;