From 20543981b56f4032daf0f3543eae53e6771e1c8e Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 5 May 2025 17:24:12 -0400 Subject: [PATCH] nak: Print the % for SSA predicates I don't remember why we special-cased predicates. There isn't a particularly good reason. This lets us drop the weird fmt_plain() and just use fmt() for everything. Part-of: --- src/nouveau/compiler/nak/ir.rs | 2 +- src/nouveau/compiler/nak/ssa_value.rs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/nouveau/compiler/nak/ir.rs b/src/nouveau/compiler/nak/ir.rs index d23f351ca2f..fec544ef871 100644 --- a/src/nouveau/compiler/nak/ir.rs +++ b/src/nouveau/compiler/nak/ir.rs @@ -6706,7 +6706,7 @@ impl fmt::Display for PredRef { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { PredRef::None => write!(f, "pT"), - PredRef::SSA(ssa) => ssa.fmt_plain(f), + PredRef::SSA(ssa) => ssa.fmt(f), PredRef::Reg(reg) => reg.fmt(f), } } diff --git a/src/nouveau/compiler/nak/ssa_value.rs b/src/nouveau/compiler/nak/ssa_value.rs index 6e09cc1013b..33c95bec277 100644 --- a/src/nouveau/compiler/nak/ssa_value.rs +++ b/src/nouveau/compiler/nak/ssa_value.rs @@ -44,10 +44,6 @@ impl SSAValue { pub fn idx(&self) -> u32 { self.packed.get() & 0x1fffffff } - - pub fn fmt_plain(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{}{}", self.file().fmt_prefix(), self.idx()) - } } impl HasRegFile for SSAValue { @@ -59,8 +55,7 @@ impl HasRegFile for SSAValue { impl fmt::Display for SSAValue { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "%")?; - self.fmt_plain(f) + write!(f, "%{}{}", self.file().fmt_prefix(), self.idx()) } }