freedreno/ir3: Add ihadd/uhadd

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
This commit is contained in:
Rob Clark 2021-08-29 08:39:39 -07:00 committed by Marge Bot
parent f5ce806ed7
commit f58438320c
2 changed files with 10 additions and 0 deletions

View File

@ -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.

View File

@ -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;