panfrost/midgard: Implement f2u16 and friends
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 2 Jul 2019 00:41:20 +0000 (17:41 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 10 Jul 2019 13:12:04 +0000 (06:12 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/midgard/midgard_compile.c
src/gallium/drivers/panfrost/midgard/nir_lower_framebuffer.c

index fc17ad2b05137508c0908827720e63e9823b99e2..21197efa499ff844202bcd8e9a365809463d39c5 100644 (file)
@@ -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);
 
index 5233fbc92808a4cc17ec3bc4a85bff38d1c0d88f..9a08a4c43bfd4d7bda8e43a622bac89f18ae28be 100644 (file)
@@ -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;