gallium/ttn: add UMAD
Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
@@ -629,6 +629,12 @@ ttn_dph(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)
|
||||
ttn_channel(b, src[1], W)));
|
||||
}
|
||||
|
||||
static void
|
||||
ttn_umad(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)
|
||||
{
|
||||
ttn_move_dest(b, dest, nir_iadd(b, nir_imul(b, src[0], src[1]), src[2]));
|
||||
}
|
||||
|
||||
static void
|
||||
ttn_arr(nir_builder *b, nir_op op, nir_alu_dest dest, nir_ssa_def **src)
|
||||
{
|
||||
@@ -1071,7 +1077,7 @@ static const nir_op op_trans[TGSI_OPCODE_LAST] = {
|
||||
[TGSI_OPCODE_U2F] = nir_op_u2f,
|
||||
[TGSI_OPCODE_UADD] = nir_op_iadd,
|
||||
[TGSI_OPCODE_UDIV] = nir_op_udiv,
|
||||
[TGSI_OPCODE_UMAD] = 0, /* XXX */
|
||||
[TGSI_OPCODE_UMAD] = 0,
|
||||
[TGSI_OPCODE_UMAX] = nir_op_umax,
|
||||
[TGSI_OPCODE_UMIN] = nir_op_umin,
|
||||
[TGSI_OPCODE_UMOD] = nir_op_umod,
|
||||
@@ -1220,6 +1226,10 @@ ttn_emit_instruction(struct ttn_compile *c)
|
||||
ttn_dph(b, op_trans[tgsi_op], dest, src);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_UMAD:
|
||||
ttn_umad(b, op_trans[tgsi_op], dest, src);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_LRP:
|
||||
ttn_move_dest(b, dest, nir_flrp(b, src[2], src[1], src[0]));
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user