Mesa (master): pan/bi: Pack second argument of F32_TO_F16

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 3 17:45:45 UTC 2020


Module: Mesa
Branch: master
Commit: 8a4efe2d730cc61d42eefffd01ee0ae4f853ec0c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8a4efe2d730cc61d42eefffd01ee0ae4f853ec0c

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Jun  2 19:28:55 2020 -0400

pan/bi: Pack second argument of F32_TO_F16

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5307>

---

 src/panfrost/bifrost/bi_pack.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index ecb315fae0a..b865b2c59c2 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -829,17 +829,19 @@ bi_pack_convert(bi_instruction *ins, bi_registers *regs, bool FMA)
         assert((MAX2(from_size, to_size) / MIN2(from_size, to_size)) <= 2);
 
         /* f32 to f16 is special */
-        if (from_size == 32 && to_size == 16 && from_base == nir_type_float && to_base == from_base) {
-                /* TODO: second vectorized source? */
+        if (from_size == 32 && to_size == 16 && from_base == to_base) {
+                /* TODO uint/int */
+                assert(from_base == nir_type_float);
+
                 struct bifrost_fma_2src pfma = {
                         .src0 = bi_get_src(ins, regs, 0),
-                        .src1 = BIFROST_SRC_STAGE, /* 0 */
+                        .src1 = bi_get_src(ins, regs, 1),
                         .op = BIFROST_FMA_FLOAT32_TO_16
                 };
 
                 struct bifrost_add_2src padd = {
                         .src0 = bi_get_src(ins, regs, 0),
-                        .src1 = BIFROST_SRC_STAGE, /* 0 */
+                        .src1 = bi_get_src(ins, regs, 1),
                         .op = BIFROST_ADD_FLOAT32_TO_16
                 };
 



More information about the mesa-commit mailing list