From 96ff511b7562ee37aeca787b16010167d77d29c1 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Sun, 17 Mar 2024 12:55:33 +0100 Subject: [PATCH] aco/optimizer: combine v_mul_i32_i24 and add to mad Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_optimizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index d4b52e85402..2d3cb4b4a25 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -4523,6 +4523,8 @@ combine_instruction(opt_ctx& ctx, aco_ptr& instr) } else if (combine_add_bcnt(ctx, instr)) { } else if (combine_three_valu_op(ctx, instr, aco_opcode::v_mul_u32_u24, aco_opcode::v_mad_u32_u24, "120", 1 | 2)) { + } else if (combine_three_valu_op(ctx, instr, aco_opcode::v_mul_i32_i24, + aco_opcode::v_mad_i32_i24, "120", 1 | 2)) { } else if (ctx.program->gfx_level >= GFX9 && !instr->usesModifiers()) { if (combine_three_valu_op(ctx, instr, aco_opcode::s_xor_b32, aco_opcode::v_xad_u32, "120", 1 | 2)) { @@ -4544,6 +4546,8 @@ combine_instruction(opt_ctx& ctx, aco_ptr& instr) } else if (!carry_out && combine_add_bcnt(ctx, instr)) { } else if (!carry_out && combine_three_valu_op(ctx, instr, aco_opcode::v_mul_u32_u24, aco_opcode::v_mad_u32_u24, "120", 1 | 2)) { + } else if (!carry_out && combine_three_valu_op(ctx, instr, aco_opcode::v_mul_i32_i24, + aco_opcode::v_mad_i32_i24, "120", 1 | 2)) { } else if (!carry_out && combine_add_lshl(ctx, instr, false)) { } } else if (instr->opcode == aco_opcode::v_sub_u32 || instr->opcode == aco_opcode::v_sub_co_u32 ||