diff --git a/src/freedreno/ir3/ir3.h b/src/freedreno/ir3/ir3.h index 58ddb4b9460..07cc651b682 100644 --- a/src/freedreno/ir3/ir3.h +++ b/src/freedreno/ir3/ir3.h @@ -124,6 +124,8 @@ struct ir3_register { IR3_REG_BNOT = 0x400, /* (ei) flag, end-input? Set on last bary, presumably to signal * that the shader needs no more input: + * + * Note: Has different meaning on other instructions like add.s/u */ IR3_REG_EI = 0x2000, /* meta-flags, for intermediate stages of IR, ie. diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 7821f3e847e..56108ef90d9 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -553,6 +553,14 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu) case nir_op_iadd: dst[0] = ir3_ADD_U(b, src[0], 0, src[1], 0); break; + case nir_op_ihadd: + dst[0] = ir3_ADD_S(b, src[0], 0, src[1], 0); + dst[0]->dsts[0]->flags |= IR3_REG_EI; + break; + case nir_op_uhadd: + dst[0] = ir3_ADD_U(b, src[0], 0, src[1], 0); + dst[0]->dsts[0]->flags |= IR3_REG_EI; + break; case nir_op_iand: dst[0] = ir3_AND_B(b, src[0], 0, src[1], 0); break;