nak: Print the % for SSA predicates
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34794>
This commit is contained in:
Faith Ekstrand 2025-05-05 17:24:12 -04:00 committed by Marge Bot
parent 56bdf9043b
commit 20543981b5
2 changed files with 2 additions and 7 deletions

View file

@ -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),
}
}

View file

@ -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())
}
}