broadcom/compiler: drop unnecessary MOV

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39687>
This commit is contained in:
Iago Toral Quiroga 2026-02-02 10:04:43 +01:00 committed by Marge Bot
parent 2f957d5bad
commit c589268b5c

View file

@ -1321,6 +1321,7 @@ f2f16_rtz(struct v3d_compile *c, struct qreg f32)
/**
* Takes the result value of a signed integer width conversion from a smaller
* type to a larger type and if needed, it applies sign extension to it.
* This is destructive: the return qreg is the same as the source qreg.
*/
static struct qreg
sign_extend(struct v3d_compile *c,
@ -1330,24 +1331,22 @@ sign_extend(struct v3d_compile *c,
{
assert(src_bit_size < dst_bit_size);
struct qreg tmp = vir_MOV(c, value);
/* Do we need to sign-extend? */
uint32_t sign_mask = 1 << (src_bit_size - 1);
struct qinst *sign_check =
vir_AND_dest(c, vir_nop_reg(),
tmp, vir_uniform_ui(c, sign_mask));
value, vir_uniform_ui(c, sign_mask));
vir_set_pf(c, sign_check, V3D_QPU_PF_PUSHZ);
/* If so, fill in leading sign bits */
uint32_t extend_bits = ~(((1 << src_bit_size) - 1)) &
((1ull << dst_bit_size) - 1);
struct qinst *extend_inst =
vir_OR_dest(c, tmp, tmp,
vir_OR_dest(c, value, value,
vir_uniform_ui(c, extend_bits));
vir_set_cond(extend_inst, V3D_QPU_COND_IFNA);
return tmp;
return value;
}
static void