mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 16:00:24 +01:00
vc4: don't lower uadd_carry
We can produce slightly better code for these in the backend, so do that. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18019>
This commit is contained in:
parent
7ee0b8b8df
commit
210e8a80ac
1 changed files with 18 additions and 0 deletions
|
|
@ -1053,6 +1053,14 @@ ntq_fddy(struct vc4_compile *c, struct qreg src)
|
|||
qir_FSUB(c, src, from_bottom)));
|
||||
}
|
||||
|
||||
static struct qreg
|
||||
ntq_emit_cond_to_int(struct vc4_compile *c, enum qpu_cond cond)
|
||||
{
|
||||
return qir_MOV(c, qir_SEL(c, cond,
|
||||
qir_uniform_ui(c, 1),
|
||||
qir_uniform_ui(c, 0)));
|
||||
}
|
||||
|
||||
static void
|
||||
ntq_emit_alu(struct vc4_compile *c, nir_alu_instr *instr)
|
||||
{
|
||||
|
|
@ -1291,6 +1299,16 @@ ntq_emit_alu(struct vc4_compile *c, nir_alu_instr *instr)
|
|||
result = ntq_fddy(c, src[0]);
|
||||
break;
|
||||
|
||||
case nir_op_uadd_carry:
|
||||
qir_SF(c, qir_ADD(c, src[0], src[1]));
|
||||
result = ntq_emit_cond_to_int(c, QPU_COND_CS);
|
||||
break;
|
||||
|
||||
case nir_op_usub_borrow:
|
||||
qir_SF(c, qir_SUB(c, src[0], src[1]));
|
||||
result = ntq_emit_cond_to_int(c, QPU_COND_CS);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf(stderr, "unknown NIR ALU inst: ");
|
||||
nir_print_instr(&instr->instr, stderr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue