From be91c321c92d4426812e5bb0250f82e978252f77 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Tue, 4 Jun 2024 14:55:04 -0500 Subject: [PATCH] nak/calc_instr_deps: Add latencies for uniform instructions We know this is wrong. In many cases, they're faster than warp instructions, sometimes with a latency as low as 2. However, there seem to be a bunch of exceptions we don't understand and it's better to be more concervative and have correct shaders. Part-of: --- src/nouveau/compiler/nak/calc_instr_deps.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/nouveau/compiler/nak/calc_instr_deps.rs b/src/nouveau/compiler/nak/calc_instr_deps.rs index deaeadf459c..a84c1818974 100644 --- a/src/nouveau/compiler/nak/calc_instr_deps.rs +++ b/src/nouveau/compiler/nak/calc_instr_deps.rs @@ -478,10 +478,14 @@ fn instr_latency(op: &Op, dst_idx: usize) -> u32 { }; // This is BS and we know it - if file.is_predicate() { - 13 - } else { - 6 + match file { + RegFile::GPR => 6, + RegFile::UGPR => 12, + RegFile::Pred => 13, + RegFile::UPred => 11, + RegFile::Bar => 0, // Barriers have a HW scoreboard + RegFile::Carry => 6, + RegFile::Mem => panic!("Not a register"), } }