From 02ad147c5c80a124630992ae6c5ae705c6c68bed Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 30 Mar 2020 20:54:51 -0400 Subject: [PATCH] pan/bi: Fix handling of constants with COMBINE We should never see COMBINE constants explicitly since they'll become moves anyway, so we can simplify that. On the other hand, we do need the type information for the lowering to work properly. Signed-off-by: Alyssa Rosenzweig Tested-by: Marge Bot Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index f78dfddbcce..0eced9713da 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -320,6 +320,9 @@ emit_load_const(bi_context *ctx, nir_load_const_instr *instr) .src = { BIR_INDEX_CONSTANT }, + .src_types = { + instr->def.bit_size | nir_type_uint, + }, .constant = { .u64 = nir_const_value_as_uint(instr->value[0], instr->def.bit_size) } @@ -560,6 +563,9 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr) unsigned constants_left = (64 / dest_bits); unsigned constant_shift = 0; + if (alu.type == BI_COMBINE) + constants_left = 0; + /* Copy sources */ unsigned num_inputs = nir_op_infos[instr->op].num_inputs; -- 2.30.2