From d8c084d2ca58710897df3e4cc9468177e791d1e8 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 1 Jul 2019 17:41:20 -0700 Subject: [PATCH] panfrost/midgard: Implement f2u16 and friends Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/midgard/midgard_compile.c | 5 +++++ src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/panfrost/midgard/midgard_compile.c b/src/gallium/drivers/panfrost/midgard/midgard_compile.c index fc17ad2b051..21197efa499 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_compile.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_compile.c @@ -841,6 +841,11 @@ emit_alu(compiler_context *ctx, nir_alu_instr *instr) ALU_CASE(i2f32, i2f_rtz); ALU_CASE(u2f32, u2f_rtz); + ALU_CASE(f2i16, f2i_rtz); + ALU_CASE(f2u16, f2u_rtz); + ALU_CASE(i2f16, i2f_rtz); + ALU_CASE(u2f16, u2f_rtz); + ALU_CASE(fsin, fsin); ALU_CASE(fcos, fcos); diff --git a/src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c b/src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c index 5233fbc9280..9a08a4c43bf 100644 --- a/src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c +++ b/src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c @@ -51,7 +51,7 @@ nir_float_to_native(nir_builder *b, nir_ssa_def *c_float) nir_ssa_def *scaled = nir_fmul_imm(b, nir_fsat(b, degraded), 255.0); /* Next, we type convert */ - nir_ssa_def *converted = nir_u2u8(b, nir_f2u32(b, + nir_ssa_def *converted = nir_u2u8(b, nir_f2u16(b, nir_fround_even(b, scaled))); return converted; -- 2.30.2