From: Alyssa Rosenzweig Date: Sat, 28 Mar 2020 00:08:03 +0000 (-0400) Subject: pan/bi: Add one-source f32->f16 op X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2fd8b2e6d4ca6fd9276baf4002228de99350e8c5;p=mesa.git pan/bi: Add one-source f32->f16 op This really has a second op for vectorization but we don't handle this quite yet... Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c index cac1ef5f31f..c53b40fe2b4 100644 --- a/src/panfrost/bifrost/bi_pack.c +++ b/src/panfrost/bifrost/bi_pack.c @@ -642,7 +642,14 @@ bi_pack_fma_convert(bi_instruction *ins, struct bi_registers *regs) } } else if (from_size == 32 && to_size == 16) { if (from_base == nir_type_float) { - /* float32_to_float16 */ + /* TODO: second vectorized source? */ + struct bifrost_fma_2src pack = { + .src0 = bi_get_src(ins, regs, 0, true), + .src1 = BIFROST_SRC_STAGE, /* 0 */ + .op = BIFROST_FMA_FLOAT32_TO_16 + }; + + RETURN_PACKED(pack); } else { /* XXX: No int32_to_int16? */ }