mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-24 11:40:25 +01:00
panfrost/midgard: Fix 1-arg ALU memory corruption
Certain ops that only take one argument have an imaginary "zero" constant for their second argument. For instance, conversions: i2f [dest], [source], #0 Memory corruption meant that #0 was instead random noise. For some ops, that doesn't matter (manifested as abnormally large code size and poor scheduling due to extra constants in random places). But for others, where a 1-op is emulated by a 2-op with an implicit 0 second argument, that broke things. Fixes iabs (emulated by iabsdiff). Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-By: Ryan Houdek <Sonicadvance1@gmail.com>
This commit is contained in:
parent
9f14e20fa1
commit
88c59798fe
1 changed files with 2 additions and 1 deletions
|
|
@ -930,7 +930,8 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr)
|
|||
}
|
||||
|
||||
ins.alu.src2 = vector_alu_srco_unsigned(blank_alu_src_xxxx);
|
||||
} else if (instr->op == nir_op_f2b32 || instr->op == nir_op_i2b32) {
|
||||
} else if (nr_inputs == 1 && !quirk_flipped_r24) {
|
||||
/* Lots of instructions need a 0 plonked in */
|
||||
ins.ssa_args.inline_constant = false;
|
||||
ins.ssa_args.src1 = SSA_FIXED_REGISTER(REGISTER_CONSTANT);
|
||||
ins.has_constants = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue