summaryrefslogtreecommitdiff
path: root/src/panfrost/bifrost/bifrost_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/panfrost/bifrost/bifrost_compile.c')
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 9b35a901ea3..6c52c38340b 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -570,9 +570,8 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
assert((alu.type != BI_SPECIAL) || !(ctx->quirks & BIFROST_NO_FAST_OP));
unsigned comps = nir_dest_num_components(instr->dest.dest);
-
- if (alu.type != BI_COMBINE)
- assert(comps <= MAX2(1, 32 / comps));
+ bool vector = comps > MAX2(1, 32 / nir_dest_bit_size(instr->dest.dest));
+ assert(!vector || alu.type == BI_COMBINE || alu.type == BI_MOV);
if (!instr->dest.dest.is_ssa) {
for (unsigned i = 0; i < comps; ++i)
@@ -668,6 +667,15 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr)
break;
}
+ if (alu.type == BI_MOV && vector) {
+ alu.type = BI_COMBINE;
+
+ for (unsigned i = 0; i < comps; ++i) {
+ alu.src[i] = alu.src[0];
+ alu.swizzle[i][0] = instr->src[0].swizzle[i];
+ }
+ }
+
if (alu.type == BI_CSEL) {
/* Default to csel3 */
alu.cond = BI_COND_NE;