From 9d89214a693f2b60ca1afcb7ed4eef4034314071 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 8 May 2025 14:21:45 -0400 Subject: [PATCH] nak/sm70: Use rZ for the 3rd source of lea when .hi is not set Pre-blackwell, it's ignored so we can set whatever. On Blackwell+, it seems to be take into account somehow (more RE needed?) so we need to set it to rZ to get the old behavior. Part-of: --- src/nouveau/compiler/nak/sm70_encode.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nouveau/compiler/nak/sm70_encode.rs b/src/nouveau/compiler/nak/sm70_encode.rs index 4f163602003..dfc27810b7a 100644 --- a/src/nouveau/compiler/nak/sm70_encode.rs +++ b/src/nouveau/compiler/nak/sm70_encode.rs @@ -1643,10 +1643,13 @@ impl SM70Op for OpLea { || self.b.src_mod == SrcMod::None ); + let zero = 0.into(); let c = if self.dst_high { Some(&self.a_high) } else { - None + // TODO: On Ada and earlier, src2 is ignored if !dst_high. On + // Blackwell+, it seems to do something. + Some(&zero) }; if self.is_uniform() { @@ -1699,7 +1702,9 @@ impl SM70Op for OpLeaX { let c = if self.dst_high { Some(&self.a_high) } else { - None + // TODO: On Ada and earlier, src2 is ignored if !dst_high. On + // Blackwell+, it seems to do something. + Some(&Src::ZERO) }; if self.is_uniform() {