diff --git a/src/freedreno/ir3/ir3.c b/src/freedreno/ir3/ir3.c
index 11d7054e173..4654eb9148b 100644
--- a/src/freedreno/ir3/ir3.c
+++ b/src/freedreno/ir3/ir3.c
@@ -442,17 +442,18 @@ struct ir3_instruction * ir3_instr_clone(struct ir3_instruction *instr)
new_instr->regs_count = 0;
new_instr->dsts_count = 0;
new_instr->srcs_count = 0;
- for (i = 0; i < instr->regs_count; i++) {
- struct ir3_register *reg = instr->regs[i];
- struct ir3_register *new_reg;
- if (reg->flags & IR3_REG_DEST)
- new_reg = ir3_dst_create(new_instr, reg->num, reg->flags);
- else
- new_reg = ir3_src_create(new_instr, reg->num, reg->flags);
+ for (i = 0; i < instr->dsts_count; i++) {
+ struct ir3_register *reg = instr->dsts[i];
+ struct ir3_register *new_reg = ir3_dst_create(new_instr, reg->num, reg->flags);
*new_reg = *reg;
- if ((new_reg->flags & IR3_REG_DEST) && new_reg->instr)
+ if (new_reg->instr)
new_reg->instr = new_instr;
}
+ for (i = 0; i < instr->srcs_count; i++) {
+ struct ir3_register *reg = instr->srcs[i];
+ struct ir3_register *new_reg = ir3_src_create(new_instr, reg->num, reg->flags);
+ *new_reg = *reg;
+ }
return new_instr;
}
diff --git a/src/freedreno/isa/encode.c b/src/freedreno/isa/encode.c
index 1a29a53e78a..470c7d38fa3 100644
--- a/src/freedreno/isa/encode.c
+++ b/src/freedreno/isa/encode.c
@@ -52,7 +52,7 @@ extract_SRC1_R(struct ir3_instruction *instr)
assert(!instr->repeat);
return instr->nop & 0x1;
}
- return !!(instr->regs[1]->flags & IR3_REG_R);
+ return !!(instr->srcs[0]->flags & IR3_REG_R);
}
static inline bool
@@ -63,8 +63,8 @@ extract_SRC2_R(struct ir3_instruction *instr)
return (instr->nop >> 1) & 0x1;
}
/* src2 does not appear in all cat2, but SRC2_R does (for nop encoding) */
- if (instr->regs_count > 2)
- return !!(instr->regs[2]->flags & IR3_REG_R);
+ if (instr->srcs_count > 1)
+ return !!(instr->srcs[1]->flags & IR3_REG_R);
return 0;
}
@@ -97,7 +97,7 @@ __instruction_case(struct encode_state *s, struct ir3_instruction *instr)
return OPC_BRAX;
}
} else if (instr->opc == OPC_MOV) {
- struct ir3_register *src = instr->regs[1];
+ struct ir3_register *src = instr->srcs[0];
if (src->flags & IR3_REG_IMMED) {
return OPC_MOV_IMMED;
} if (src->flags & IR3_REG_RELATIV) {
@@ -157,15 +157,15 @@ extract_cat5_SRC(struct ir3_instruction *instr, unsigned n)
if (instr->flags & IR3_INSTR_S2EN) {
n++;
}
- if (n < instr->regs_count)
- return instr->regs[n];
+ if (n < instr->srcs_count)
+ return instr->srcs[n];
return NULL;
}
static inline bool
extract_cat5_FULL(struct ir3_instruction *instr)
{
- struct ir3_register *reg = extract_cat5_SRC(instr, 1);
+ struct ir3_register *reg = extract_cat5_SRC(instr, 0);
/* some cat5 have zero src regs, in which case 'FULL' is false */
if (!reg)
return false;
@@ -207,7 +207,7 @@ extract_cat5_DESC_MODE(struct ir3_instruction *instr)
static inline unsigned
extract_cat6_DESC_MODE(struct ir3_instruction *instr)
{
- struct ir3_register *ssbo = instr->regs[1];
+ struct ir3_register *ssbo = instr->srcs[0];
if (ssbo->flags & IR3_REG_IMMED) {
return 0; // todo enum
} else if (instr->flags & IR3_INSTR_NONUNIF) {
@@ -230,8 +230,8 @@ extract_cat6_SRC(struct ir3_instruction *instr, unsigned n)
if (instr->flags & IR3_INSTR_G) {
n++;
}
- assert(n < instr->regs_count);
- return instr->regs[n];
+ assert(n < instr->srcs_count);
+ return instr->srcs[n];
}
typedef enum {
diff --git a/src/freedreno/isa/ir3-cat1.xml b/src/freedreno/isa/ir3-cat1.xml
index 2633894a05e..4ad4e7d7225 100644
--- a/src/freedreno/isa/ir3-cat1.xml
+++ b/src/freedreno/isa/ir3-cat1.xml
@@ -76,10 +76,10 @@ SOFTWARE.
001
-
-
+
+
-
+
@@ -354,7 +354,7 @@ SOFTWARE.
10
-
+
@@ -377,9 +377,9 @@ SOFTWARE.
00
-
-
-
+
+
+
@@ -402,10 +402,10 @@ SOFTWARE.
01
-
-
-
-
+
+
+
+
@@ -428,10 +428,10 @@ SOFTWARE.
10
-
-
-
-
+
+
+
+
@@ -463,7 +463,7 @@ SOFTWARE.
the existing stuff:
-->
-
+
diff --git a/src/freedreno/isa/ir3-cat2.xml b/src/freedreno/isa/ir3-cat2.xml
index d62c933d3aa..204d641cbc3 100644
--- a/src/freedreno/isa/ir3-cat2.xml
+++ b/src/freedreno/isa/ir3-cat2.xml
@@ -60,11 +60,11 @@ SOFTWARE.
-
-
+
+
diff --git a/src/freedreno/isa/ir3-cat3.xml b/src/freedreno/isa/ir3-cat3.xml
index 8ae7d1e31d1..f59e0aa099e 100644
--- a/src/freedreno/isa/ir3-cat3.xml
+++ b/src/freedreno/isa/ir3-cat3.xml
@@ -132,16 +132,16 @@ SOFTWARE.
-
+
-
-
-
-
+
+
+
+
diff --git a/src/freedreno/isa/ir3-cat4.xml b/src/freedreno/isa/ir3-cat4.xml
index 9a1ea49b117..a9acda2d965 100644
--- a/src/freedreno/isa/ir3-cat4.xml
+++ b/src/freedreno/isa/ir3-cat4.xml
@@ -60,13 +60,13 @@ SOFTWARE.
100
-
+
-
-
+
+
diff --git a/src/freedreno/isa/ir3-cat5.xml b/src/freedreno/isa/ir3-cat5.xml
index a1c2dea967a..a75c428d697 100644
--- a/src/freedreno/isa/ir3-cat5.xml
+++ b/src/freedreno/isa/ir3-cat5.xml
@@ -141,7 +141,7 @@ SOFTWARE.
-
+
@@ -153,12 +153,12 @@ SOFTWARE.
-
-
-
+
+
+
diff --git a/src/freedreno/isa/ir3-cat6.xml b/src/freedreno/isa/ir3-cat6.xml
index 5740cd2d92d..9283d30d653 100644
--- a/src/freedreno/isa/ir3-cat6.xml
+++ b/src/freedreno/isa/ir3-cat6.xml
@@ -70,10 +70,10 @@ SOFTWARE.
00
00000
-
-
-
-
+
+
+
+
@@ -110,11 +110,11 @@ SOFTWARE.
x
00011
-
-
+
+
-
-
+
+
@@ -132,9 +132,9 @@ SOFTWARE.
xxxxxxxxx
xx
-
-
-
+
+
+
@@ -185,8 +185,8 @@ SOFTWARE.
xx
11111
-
-
+
+
@@ -212,9 +212,9 @@ SOFTWARE.
-->
-
- "
-
+
+ "
+
@@ -279,8 +279,8 @@ SOFTWARE.
xx
11100
-
-
+
+
@@ -309,8 +309,8 @@ SOFTWARE.
01111
-
-
+
+
@@ -349,12 +349,12 @@ SOFTWARE.
-
-
-
-
-
-
+
+
+
+
+
+
@@ -390,14 +390,14 @@ SOFTWARE.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -459,14 +459,14 @@ SOFTWARE.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -591,10 +591,10 @@ SOFTWARE.
1
-
+
-
-
+
+
@@ -664,8 +664,8 @@ SOFTWARE.
-
-
+
+
@@ -693,9 +693,9 @@ SOFTWARE.
-
-
-
+
+
+
@@ -716,7 +716,7 @@ SOFTWARE.
000110
10
-
+
@@ -869,4 +869,4 @@ SOFTWARE.
-
\ No newline at end of file
+
diff --git a/src/freedreno/isa/ir3.xml b/src/freedreno/isa/ir3.xml
index fc5cb20885c..fc95e90298d 100644
--- a/src/freedreno/isa/ir3.xml
+++ b/src/freedreno/isa/ir3.xml
@@ -64,10 +64,10 @@ TODO:
that are specific to a single instruction category,
mappings should be defined at that level instead.
-->
-
-
-
-
+
+
+
+