mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-18 19:10:32 +01:00
aco: implement nir_op_f2i8/nir_op_f2u8
I think we should really refactor the conversions path. 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/4551>
This commit is contained in:
parent
04a7ec7c8a
commit
91aa596ca7
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue