mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
nak/legalize: Fix too many IADD3 source modifiers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
parent
0222107699
commit
86c7bcc9e3
1 changed files with 8 additions and 0 deletions
|
|
@ -108,6 +108,14 @@ fn legalize_instr(b: &mut impl SSABuilder, instr: &mut Instr) {
|
|||
let [ref mut src0, ref mut src1, ref mut src2] = op.srcs;
|
||||
swap_srcs_if_not_reg(src0, src1);
|
||||
swap_srcs_if_not_reg(src2, src1);
|
||||
if !src0.src_mod.is_none() && !src1.src_mod.is_none() {
|
||||
let val = b.alloc_ssa(RegFile::GPR, 1);
|
||||
b.push_op(OpIAdd3 {
|
||||
srcs: [Src::new_zero(), *src0, Src::new_zero()],
|
||||
dst: val.into(),
|
||||
});
|
||||
*src0 = val.into();
|
||||
}
|
||||
copy_src_if_not_reg(b, src0, RegFile::GPR);
|
||||
copy_src_if_not_reg(b, src2, RegFile::GPR);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue