[Mesa-dev] [PATCH 17/42] panfrost/midgard: Implement f2u16 and friends
Alyssa Rosenzweig
alyssa.rosenzweig at collabora.com
Mon Jul 8 14:08:30 UTC 2019
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
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.20.1
More information about the mesa-dev
mailing list