aco: don't use constant_bits when not applying constants

This is incorrect for 16bit integer operands.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35020>
This commit is contained in:
Georg Lehmann 2025-05-16 12:20:49 +02:00 committed by Marge Bot
parent f98d20fec6
commit cd4c0bc58e
2 changed files with 4 additions and 5 deletions

View file

@ -3603,7 +3603,7 @@ combine_mad_mix(opt_ctx& ctx, aco_ptr<Instruction>& instr)
continue;
}
if (get_operand_type(instr, i).constant_bits() != 32)
if (get_operand_type(instr, i).bit_size != 32)
continue;
/* Conversion to VOP3P will add inline constant operands, but that shouldn't affect
@ -3853,8 +3853,7 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
if (is_add_mix && info.parent_instr->definitions[0].bytes() == 2)
continue;
if (get_operand_type(instr, i).constant_bits() !=
info.parent_instr->definitions[0].bytes() * 8)
if (get_operand_type(instr, i).bytes() != info.parent_instr->definitions[0].bytes())
continue;
bool legacy = info.parent_instr->opcode == aco_opcode::v_mul_legacy_f32;
@ -4560,7 +4559,7 @@ select_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
continue;
bool input_mods = can_use_input_modifiers(ctx.program->gfx_level, instr->opcode, 0) &&
get_operand_type(instr, 0).constant_bits() == 32;
get_operand_type(instr, 0).bit_size == 32;
bool mov_uses_mods = info.parent_instr->valu().neg[0] || info.parent_instr->valu().abs[0];
if (((dpp8 && ctx.program->gfx_level < GFX11) || !input_mods) && mov_uses_mods)
continue;

View file

@ -638,7 +638,7 @@ try_combine_dpp(pr_opt_ctx& ctx, aco_ptr<Instruction>& instr)
continue;
bool input_mods = can_use_input_modifiers(ctx.program->gfx_level, instr->opcode, i) &&
get_operand_type(instr, i).constant_bits() == 32;
get_operand_type(instr, i).bit_size == 32;
bool mov_uses_mods = mov->valu().neg[0] || mov->valu().abs[0];
if (((dpp8 && ctx.program->gfx_level < GFX11) || !input_mods) && mov_uses_mods)
continue;