aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/panfrost/midgard/compiler.h4
-rw-r--r--src/panfrost/midgard/midgard_compile.c2
-rw-r--r--src/panfrost/midgard/mir.c9
3 files changed, 10 insertions, 5 deletions
diff --git a/src/panfrost/midgard/compiler.h b/src/panfrost/midgard/compiler.h
index 780e4323554..60d5b9d0e20 100644
--- a/src/panfrost/midgard/compiler.h
+++ b/src/panfrost/midgard/compiler.h
@@ -88,8 +88,8 @@ typedef struct midgard_instruction {
unsigned src[3];
unsigned dest;
- /* Swizzle for the conditional for a csel */
- unsigned csel_swizzle;
+ /* Swizzle for the conditional for a csel/branch */
+ unsigned cond_swizzle;
/* Special fields for an ALU instruction */
midgard_reg_info registers;
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index 95ec48e9563..337f46f2e0d 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -1095,7 +1095,7 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
};
if (nr_inputs == 3) {
- ins.csel_swizzle = SWIZZLE_FROM_ARRAY(nirmods[2]->swizzle);
+ ins.cond_swizzle = SWIZZLE_FROM_ARRAY(nirmods[2]->swizzle);
assert(!nirmods[2]->abs);
assert(!nirmods[2]->negate);
}
diff --git a/src/panfrost/midgard/mir.c b/src/panfrost/midgard/mir.c
index 9e5ba7abcb0..faeac16d18d 100644
--- a/src/panfrost/midgard/mir.c
+++ b/src/panfrost/midgard/mir.c
@@ -42,8 +42,8 @@ unsigned
mir_get_swizzle(midgard_instruction *ins, unsigned idx)
{
if (ins->type == TAG_ALU_4) {
- if (idx == 2)
- return ins->csel_swizzle;
+ if (idx == 2 || ins->compact_branch)
+ return ins->cond_swizzle;
unsigned b = (idx == 0) ? ins->alu.src1 : ins->alu.src2;
@@ -105,6 +105,11 @@ void
mir_set_swizzle(midgard_instruction *ins, unsigned idx, unsigned new)
{
if (ins->type == TAG_ALU_4) {
+ if (idx == 2 || ins->compact_branch) {
+ ins->cond_swizzle = new;
+ return;
+ }
+
unsigned b = (idx == 0) ? ins->alu.src1 : ins->alu.src2;
midgard_vector_alu_src s =