aco: fix unreachable() for uniform 8/16-bit nir_op_mov from VGPR

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: d20a752c0d ("aco: use Builder::copy more")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8380>
This commit is contained in:
Rhys Perry 2021-01-08 11:44:33 +00:00
parent 10431c8964
commit 816b7fb5cb
1 changed files with 6 additions and 4 deletions

View File

@ -1240,12 +1240,14 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
}
case nir_op_mov: {
Temp src = get_alu_src(ctx, instr->src[0]);
if (src.bytes() != dst.bytes())
unreachable("wrong src or dst register class for nir_op_mov");
if (src.type() == RegType::vgpr && dst.type() == RegType::sgpr)
if (src.type() == RegType::vgpr && dst.type() == RegType::sgpr) {
/* use size() instead of bytes() for 8/16-bit */
assert(src.size() == dst.size() && "wrong src or dst register class for nir_op_mov");
bld.pseudo(aco_opcode::p_as_uniform, Definition(dst), src);
else
} else {
assert(src.bytes() == dst.bytes() && "wrong src or dst register class for nir_op_mov");
bld.copy(Definition(dst), src);
}
break;
}
case nir_op_inot: {