pan/cs: Accept val=undef when cs_branch_label() condition is ALWAYS

The register is not used in that case anyway, so we can pick r0 and
call it a day.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Rebecca Mckeever <rebecca.mckeever@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30969>
This commit is contained in:
Boris Brezillon 2024-08-30 14:00:53 +02:00 committed by Marge Bot
parent f6c3fb11ea
commit 8f825a51a8

View file

@ -588,7 +588,7 @@ cs_branch_label(struct cs_builder *b, struct cs_label *label,
cs_emit(b, BRANCH, I) {
I.offset = offset;
I.condition = cond;
I.value = cs_to_reg32(val);
I.value = cond != MALI_CS_CONDITION_ALWAYS ? cs_to_reg32(val) : 0;
}
label->last_forward_ref = branch_ins_pos;