From 68a89bb08563113b99367714b5c9a9dfd6cc9fdf Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Thu, 24 Apr 2025 11:28:43 +0200 Subject: [PATCH] etnaviv: compiler: Handle f2f16 and f2f32 They are needed by some pack/unpack lowerings. Signed-off-by: Christian Gmeiner Part-of: --- src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c index 708f0788b58..d7a8ad75dea 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c @@ -76,6 +76,8 @@ static const struct etna_op_info etna_ops[] = { UOP(f2u32, F2I), OPCT(f2u16, F2I, TRUE, U16), OPCT(f2u8, F2I, TRUE, U8), + OPCT(f2f16, CONV, TRUE, F16), + OPCT(f2f32, CONV, TRUE, F32), UOP(b2f32, AND), /* AND with fui(1.0f) */ UOP(b2i32, AND), /* AND with 1 */ UOP(b2i8, AND), /* AND with 1 */ @@ -172,6 +174,12 @@ etna_emit_alu(struct etna_compile *c, nir_op op, struct etna_inst_dst dst, case nir_op_b2i32: inst.src[1] = etna_immediate_int(1); break; + case nir_op_f2f16: + inst.src[1] = etna_immediate_int(0); + break; + case nir_op_f2f32: + inst.src[1] = etna_immediate_int(1); + break; case nir_op_ineg: /* ADD 0, -x */ inst.src[0] = etna_immediate_int(0);