From f577118fe108729260f3e72cb3f2c121c3638979 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Thu, 23 Jan 2025 12:09:35 +0100 Subject: [PATCH] ir3/a7xx: enable delayed src2 read for all cat3 instructions cat3 instructions read their 3rd src later than their first two srcs. Pre-a7xx, this was only supported for mad(sh) but on a7xx, it works for all cat3 instructions. Signed-off-by: Job Noorman Part-of: --- src/freedreno/ir3/ir3_delay.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/freedreno/ir3/ir3_delay.c b/src/freedreno/ir3/ir3_delay.c index f227bc8eb32..13c4de50c88 100644 --- a/src/freedreno/ir3/ir3_delay.c +++ b/src/freedreno/ir3/ir3_delay.c @@ -37,8 +37,13 @@ ir3_src_read_delay(struct ir3_compiler *compiler, struct ir3_instruction *instr, return src_n; } - /* cat3 instructions consume their last source one or two cycles later. */ - if ((is_mad(instr->opc) || is_madsh(instr->opc)) && src_n == 2) { + /* cat3 instructions consume their last source one or two cycles later. Note + * that not all cat3 instructions seem to do this pre-a7xx. + */ + bool cat3_reads_later = compiler->gen >= 7 + ? (opc_cat(instr->opc) == 3) + : (is_mad(instr->opc) || is_madsh(instr->opc)); + if (cat3_reads_later && src_n == 2) { return compiler->delay_slots.cat3_src2_read; }