From 91aa596ca7ef3411264181f49f58743f5c965710 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 14 Apr 2020 16:59:20 +0200 Subject: [PATCH] aco: implement nir_op_f2i8/nir_op_f2u8 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I think we should really refactor the conversions path. Signed-off-by: Samuel Pitoiset Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.30.2