aco: add helper function for can_use_input_modifiers

Some instructions have restrictions that can't be expressed with the bitfield.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23059>
This commit is contained in:
Georg Lehmann 2023-05-16 17:02:45 +02:00 committed by Marge Bot
parent b4ff7e2567
commit 0ffc9bccfa
2 changed files with 14 additions and 0 deletions

View file

@ -469,6 +469,19 @@ convert_to_DPP(amd_gfx_level gfx_level, aco_ptr<Instruction>& instr, bool dpp8)
return tmp;
}
bool
can_use_input_modifiers(amd_gfx_level gfx_level, aco_opcode op, int idx)
{
if (op == aco_opcode::v_mov_b32)
return gfx_level >= GFX10;
if (op == aco_opcode::v_ldexp_f16 || op == aco_opcode::v_ldexp_f32 ||
op == aco_opcode::v_ldexp_f64)
return idx == 0;
return instr_info.can_use_input_modifiers[(int)op];
}
bool
can_use_opsel(amd_gfx_level gfx_level, aco_opcode op, int idx)
{

View file

@ -1823,6 +1823,7 @@ is_dead(const std::vector<uint16_t>& uses, const Instruction* instr)
return !(get_sync_info(instr).semantics & (semantic_volatile | semantic_acqrel));
}
bool can_use_input_modifiers(amd_gfx_level gfx_level, aco_opcode op, int idx);
bool can_use_opsel(amd_gfx_level gfx_level, aco_opcode op, int idx);
bool instr_is_16bit(amd_gfx_level gfx_level, aco_opcode op);
uint8_t get_gfx11_true16_mask(aco_opcode op);