aco: fix GFX8 16-bit packing

def.physReg() was uninitialized.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: d96f387e7a ('aco: improve code sequences for 16bit packing')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7334>
This commit is contained in:
Daniel Schürmann 2020-10-27 11:35:27 +01:00
parent 666817ce84
commit cb12879401
1 changed files with 5 additions and 5 deletions

View File

@ -1217,17 +1217,17 @@ void do_pack_2x16(lower_context *ctx, Builder& bld, Definition def, Operand lo,
/* either lo or hi can be placed with just a v_mov */
assert(lo.physReg().byte() == 0 || hi.physReg().byte() == 2);
Operand& op = lo.physReg().byte() == 0 ? lo : hi;
Definition def = Definition(def.physReg().advance(op.physReg().byte()), v2b);
bld.vop1(aco_opcode::v_mov_b32, def, op);
op.setFixed(def.physReg());
PhysReg reg = def.physReg().advance(op.physReg().byte());
bld.vop1(aco_opcode::v_mov_b32, Definition(reg, v2b), op);
op.setFixed(reg);
}
if (ctx->program->chip_class >= GFX8) {
/* either hi or lo are already placed correctly */
if (lo.physReg().reg() == def.physReg().reg())
bld.copy(Definition(def.physReg(), v2b), Operand(hi.physReg(), v2b));
bld.copy(def_hi, hi);
else
bld.copy(Definition(def.physReg(), v2b), Operand(lo.physReg(), v2b));
bld.copy(def_lo, lo);
return;
}