From 3be57aa4c3f39a69855cdeaa7c85ce8dac42b7d1 Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Mon, 13 Apr 2026 19:25:41 +0200 Subject: [PATCH] nak: Allows predicate in legalize_ext_instr With OpLd now having a predicate, we forgot to update legalize_ext_instr to allow predicates for it. We should really get ride of those functions but for now let's keep it simple and sync the implementation to what SM20 backend have. Signed-off-by: Mary Guillemard Fixes: 9d90cbc314f ("nak: add input predicate to load_global_nv and OpLd") Reviewed-by: Karol Herbst Part-of: --- src/nouveau/compiler/nak/sm32.rs | 2 +- src/nouveau/compiler/nak/sm50.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nouveau/compiler/nak/sm32.rs b/src/nouveau/compiler/nak/sm32.rs index f689ddcae0f..a9d64dad849 100644 --- a/src/nouveau/compiler/nak/sm32.rs +++ b/src/nouveau/compiler/nak/sm32.rs @@ -2503,7 +2503,7 @@ fn legalize_ext_instr(op: &mut impl SrcsAsSlice, _b: &mut LegalizeBuilder) { panic!("ALU srcs must be legalized explicitly"); } SrcType::Pred => { - panic!("Predicates must be legalized explicitly"); + assert!(src_is_reg(src, RegFile::Pred)); } SrcType::Carry => { panic!("Carry values must be legalized explicitly"); diff --git a/src/nouveau/compiler/nak/sm50.rs b/src/nouveau/compiler/nak/sm50.rs index c31c41c2f2a..c17a0ecd9d3 100644 --- a/src/nouveau/compiler/nak/sm50.rs +++ b/src/nouveau/compiler/nak/sm50.rs @@ -449,7 +449,7 @@ fn legalize_ext_instr(op: &mut impl SrcsAsSlice, _b: &mut LegalizeBuilder) { panic!("ALU srcs must be legalized explicitly"); } SrcType::Pred => { - panic!("Predicates must be legalized explicitly"); + assert!(src_is_reg(src, RegFile::Pred)); } SrcType::Carry => { panic!("Carry values must be legalized explicitly");