pco: legalize between movs1/mbyp without emitting additional ops

Signed-off-by: Simon Perretta <simon.perretta@imgtec.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
Simon Perretta 2025-07-01 15:58:38 +01:00 committed by Marge Bot
parent e2d466f06c
commit a201e21b4e

View file

@ -51,6 +51,14 @@ static inline bool ref_needs_olchk(pco_ref ref)
*/
static void insert_mov_ref(pco_instr *instr, pco_ref *ref, bool needs_s124)
{
if (instr->op == PCO_OP_MBYP && needs_s124 && !pco_ref_has_mods_set(*ref)) {
instr->op = PCO_OP_MOVS1;
return;
} else if (instr->op == PCO_OP_MOVS1 && !needs_s124) {
instr->op = PCO_OP_MBYP;
return;
}
assert(pco_ref_is_scalar(*ref));
pco_ref new_ref = pco_ref_new_ssa(instr->parent_func,
pco_ref_get_bits(*ref),