Module: Mesa Branch: main Commit: 48917600fb818286c98d13de56f8f240eeef7155 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=48917600fb818286c98d13de56f8f240eeef7155
Author: Faith Ekstrand <faith.ekstr...@collabora.com> Date: Tue Dec 5 23:41:04 2023 -0600 nak: Add a B32 source type Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26535> --- src/nouveau/compiler/nak_ir.rs | 9 +++++++++ src/nouveau/compiler/nak_legalize.rs | 3 ++- src/nouveau/compiler/nak_opt_copy_prop.rs | 6 +++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/nouveau/compiler/nak_ir.rs b/src/nouveau/compiler/nak_ir.rs index ec6350d201a..c76c65b69e8 100644 --- a/src/nouveau/compiler/nak_ir.rs +++ b/src/nouveau/compiler/nak_ir.rs @@ -993,6 +993,7 @@ pub enum SrcType { F32, F64, I32, + B32, Pred, Bar, } @@ -1159,6 +1160,14 @@ impl Src { self.src_ref.is_alu() } + SrcType::B32 => { + match self.src_mod { + SrcMod::None | SrcMod::BNot => (), + _ => return false, + } + + self.src_ref.is_alu() + } SrcType::Pred => { match self.src_mod { SrcMod::None | SrcMod::BNot => (), diff --git a/src/nouveau/compiler/nak_legalize.rs b/src/nouveau/compiler/nak_legalize.rs index e7d2113bebc..92370d8a4fa 100644 --- a/src/nouveau/compiler/nak_legalize.rs +++ b/src/nouveau/compiler/nak_legalize.rs @@ -299,7 +299,8 @@ fn legalize_instr( SrcType::ALU | SrcType::F32 | SrcType::F64 - | SrcType::I32 => { + | SrcType::I32 + | SrcType::B32 => { panic!("ALU srcs must be legalized explicitly"); } SrcType::Pred => { diff --git a/src/nouveau/compiler/nak_opt_copy_prop.rs b/src/nouveau/compiler/nak_opt_copy_prop.rs index 5a80e783860..6ebd366900d 100644 --- a/src/nouveau/compiler/nak_opt_copy_prop.rs +++ b/src/nouveau/compiler/nak_opt_copy_prop.rs @@ -294,7 +294,11 @@ impl CopyPropPass { SrcType::GPR => { self.prop_to_gpr_src(src); } - SrcType::ALU | SrcType::F32 | SrcType::I32 | SrcType::Pred => { + SrcType::ALU + | SrcType::F32 + | SrcType::I32 + | SrcType::B32 + | SrcType::Pred => { self.prop_to_scalar_src(src_type, src); } SrcType::F64 => {