nak: OpDAdd doesn't have saturate

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26743>
This commit is contained in:
Faith Ekstrand
2023-12-07 22:25:59 -06:00
committed by Marge Bot
parent ada338bfcc
commit c53f562d1a
2 changed files with 5 additions and 9 deletions

View File

@@ -2471,14 +2471,12 @@ pub struct OpDAdd {
#[src_type(F64)]
pub srcs: [Src; 2],
pub saturate: bool,
pub rnd_mode: FRndMode,
}
impl DisplayOp for OpDAdd {
fn fmt_op(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let sat = if self.saturate { ".sat" } else { "" };
write!(f, "dadd{sat}")?;
write!(f, "dadd")?;
if self.rnd_mode != FRndMode::NearestEven {
write!(f, "{}", self.rnd_mode)?;
}

View File

@@ -319,12 +319,10 @@ impl CopyPropPass {
}
Op::DAdd(add) => {
let dst = add.dst.as_ssa().unwrap();
if !add.saturate {
if add.srcs[0].is_fneg_zero(SrcType::F64) {
self.add_fp64_copy(dst, add.srcs[1]);
} else if add.srcs[1].is_fneg_zero(SrcType::F64) {
self.add_fp64_copy(dst, add.srcs[0]);
}
if add.srcs[0].is_fneg_zero(SrcType::F64) {
self.add_fp64_copy(dst, add.srcs[1]);
} else if add.srcs[1].is_fneg_zero(SrcType::F64) {
self.add_fp64_copy(dst, add.srcs[0]);
}
}
Op::Lop3(lop) => {