aco: implement 16-bit nir_op_ldexp

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4452>
This commit is contained in:
Samuel Pitoiset
2020-04-03 15:40:35 +02:00
parent 55537ed9d3
commit 981ced07a5

View File

@@ -2048,14 +2048,16 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr)
break; break;
} }
case nir_op_ldexp: { case nir_op_ldexp: {
if (dst.size() == 1) { Temp src0 = get_alu_src(ctx, instr->src[0]);
bld.vop3(aco_opcode::v_ldexp_f32, Definition(dst), Temp src1 = get_alu_src(ctx, instr->src[1]);
as_vgpr(ctx, get_alu_src(ctx, instr->src[0])), if (dst.regClass() == v2b) {
get_alu_src(ctx, instr->src[1])); Temp tmp = bld.tmp(v1);
} else if (dst.size() == 2) { emit_vop2_instruction(ctx, instr, aco_opcode::v_ldexp_f16, tmp, false);
bld.vop3(aco_opcode::v_ldexp_f64, Definition(dst), bld.pseudo(aco_opcode::p_split_vector, Definition(dst), bld.def(v2b), tmp);
as_vgpr(ctx, get_alu_src(ctx, instr->src[0])), } else if (dst.regClass() == v1) {
get_alu_src(ctx, instr->src[1])); bld.vop3(aco_opcode::v_ldexp_f32, Definition(dst), as_vgpr(ctx, src0), src1);
} else if (dst.regClass() == v2) {
bld.vop3(aco_opcode::v_ldexp_f64, Definition(dst), as_vgpr(ctx, src0), src1);
} else { } else {
fprintf(stderr, "Unimplemented NIR instr bit size: "); fprintf(stderr, "Unimplemented NIR instr bit size: ");
nir_print_instr(&instr->instr, stderr); nir_print_instr(&instr->instr, stderr);