From: Samuel Pitoiset Date: Tue, 14 Apr 2020 14:59:20 +0000 (+0200) Subject: aco: implement nir_op_f2i8/nir_op_f2u8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91aa596ca7ef3411264181f49f58743f5c965710;p=mesa.git aco: implement nir_op_f2i8/nir_op_f2u8 I think we should really refactor the conversions path. Signed-off-by: Samuel Pitoiset Reviewed-by: Daniel Schürmann Part-of: --- diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 2acb4e822a3..c0977f518b8 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -2262,6 +2262,7 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr) } break; } + case nir_op_f2i8: case nir_op_f2i16: { Temp src = get_alu_src(ctx, instr->src[0]); if (instr->src[0].src.ssa->bit_size == 16) @@ -2272,11 +2273,12 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr) src = bld.vop1(aco_opcode::v_cvt_i32_f64, bld.def(v1), src); if (dst.type() == RegType::vgpr) - bld.pseudo(aco_opcode::p_split_vector, Definition(dst), bld.def(v2b), src); + bld.pseudo(aco_opcode::p_extract_vector, Definition(dst), src, Operand(0u)); else bld.pseudo(aco_opcode::p_as_uniform, Definition(dst), src); break; } + case nir_op_f2u8: case nir_op_f2u16: { Temp src = get_alu_src(ctx, instr->src[0]); if (instr->src[0].src.ssa->bit_size == 16) @@ -2287,7 +2289,7 @@ void visit_alu_instr(isel_context *ctx, nir_alu_instr *instr) src = bld.vop1(aco_opcode::v_cvt_u32_f64, bld.def(v1), src); if (dst.type() == RegType::vgpr) - bld.pseudo(aco_opcode::p_split_vector, Definition(dst), bld.def(v2b), src); + bld.pseudo(aco_opcode::p_extract_vector, Definition(dst), src, Operand(0u)); else bld.pseudo(aco_opcode::p_as_uniform, Definition(dst), src); break;