From 4726c08f53fdc0e2d885bab7ab0b974cf8421575 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 15 Jul 2025 06:31:48 +1000 Subject: [PATCH] nak: add uniform support for s2r This adds s2ur support to the backend compiler. Part-of: --- src/nouveau/compiler/nak/sm70_encode.rs | 10 +++++++--- src/nouveau/compiler/nak/sm75_instr_latencies.rs | 7 +++++++ src/nouveau/compiler/nak/sm80_instr_latencies.rs | 7 +++++++ 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/nouveau/compiler/nak/sm70_encode.rs b/src/nouveau/compiler/nak/sm70_encode.rs index 12d836202a2..cca327a6848 100644 --- a/src/nouveau/compiler/nak/sm70_encode.rs +++ b/src/nouveau/compiler/nak/sm70_encode.rs @@ -3722,9 +3722,13 @@ impl SM70Op for OpS2R { } fn encode(&self, e: &mut SM70Encoder<'_>) { - assert!(!self.is_uniform()); - e.set_opcode(if self.is_uniform() { 0x9c3 } else { 0x919 }); - e.set_dst(&self.dst); + if self.is_uniform() { + e.set_opcode(0x9c3); + e.set_udst(&self.dst); + } else { + e.set_opcode(0x919); + e.set_dst(&self.dst); + } e.set_field(72..80, self.idx); } } diff --git a/src/nouveau/compiler/nak/sm75_instr_latencies.rs b/src/nouveau/compiler/nak/sm75_instr_latencies.rs index 0e297a6af29..1e2119058ed 100644 --- a/src/nouveau/compiler/nak/sm75_instr_latencies.rs +++ b/src/nouveau/compiler/nak/sm75_instr_latencies.rs @@ -932,6 +932,13 @@ impl URegLatencySM75 { panic!("Illegal R2UR in ureg"); } } + Op::S2R(_) => { + if !reader { + R2UR + } else { + panic!("Illegal S2UR in ureg"); + } + } Op::Vote(_) => VoteU, Op::FRnd(_) => vdecoupled, diff --git a/src/nouveau/compiler/nak/sm80_instr_latencies.rs b/src/nouveau/compiler/nak/sm80_instr_latencies.rs index 335fb0723d8..d1c8b32413b 100644 --- a/src/nouveau/compiler/nak/sm80_instr_latencies.rs +++ b/src/nouveau/compiler/nak/sm80_instr_latencies.rs @@ -1067,6 +1067,13 @@ impl URegLatencySM80 { panic!("Illegal R2UR in ureg"); } } + Op::S2R(_) => { + if !reader { + ToUr + } else { + panic!("Illegal S2UR in ureg"); + } + } Op::Vote(_) => VoteU, Op::FRnd(_) => vdecoupled,