mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 15:20:10 +01:00
nak: make is_fneg_zero detect -rZ
fold_imm starts with this check:
let SrcRef::Imm32(mut u) = self.src_ref else {
return *self;
};
For -rZ we thus return early and the matching in is_fneg_zero does not
find it. This MR adds a match for SrcRef::Zero + SrcMod::FNeg.
This lets copy propagation fold this:
r3 = shfl.bfly r2 0x2 0x1c03
r3 = fswzadd.ftz r3 r2 [sub, sub, subr, subr]
r3 = fadd.ftz -rZ |r3|
r16 = shfl.bfly r2 0x1 0x1c03
r16 = fswzadd.ftz r16 r2 [sub, subr, sub, subr]
r16 = fadd.ftz -rZ |r16|
r3 = fadd.ftz r16 r3
into:
r3 = shfl.bfly r2 0x2 0x1c03
r3 = fswzadd.ftz r3 r2 [sub, sub, subr, subr]
r16 = shfl.bfly r2 0x1 0x1c03
r16 = fswzadd.ftz r16 r2 [sub, subr, sub, subr]
r3 = fadd.ftz |r16| |r3|
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12480
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33107>
This commit is contained in:
parent
47fc468944
commit
d55a69e769
1 changed files with 1 additions and 0 deletions
|
|
@ -1309,6 +1309,7 @@ impl Src {
|
|||
|
||||
pub fn is_fneg_zero(&self, src_type: SrcType) -> bool {
|
||||
match self.fold_imm(src_type).src_ref {
|
||||
SrcRef::Zero => self.src_mod == SrcMod::FNeg,
|
||||
SrcRef::Imm32(0x00008000) => src_type == SrcType::F16,
|
||||
SrcRef::Imm32(0x80000000) => src_type == SrcType::F32,
|
||||
SrcRef::Imm32(0x80008000) => src_type == SrcType::F16v2,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue