ir3: always set wrmask for movmsk

We failed to set the wrmask of movmsk expanded from ballot.macro. This
caused legalization to miss the need for (ss) when a component other
than the first is used.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: 1a78604d20 ("ir3: Add support for subgroup arithmetic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32918>
This commit is contained in:
Job Noorman
2025-01-07 10:51:47 +01:00
committed by Marge Bot
parent c20c46cf7b
commit c3e7384bbb

View File

@@ -468,10 +468,13 @@ lower_instr(struct ir3 *ir, struct ir3_block **block, struct ir3_instruction *in
break;
case OPC_BALLOT_MACRO: {
unsigned comp_count = util_last_bit(instr->dsts[0]->wrmask);
unsigned wrmask = instr->dsts[0]->wrmask;
unsigned comp_count = util_last_bit(wrmask);
struct ir3_instruction *movmsk = ir3_instr_create_at(
ir3_before_terminator(then_block), OPC_MOVMSK, 1, 0);
struct ir3_register *dst =
ir3_dst_create(movmsk, instr->dsts[0]->num, instr->dsts[0]->flags);
dst->wrmask = wrmask;
movmsk->repeat = comp_count - 1;
break;
}