Mesa (master): pan/bi: Generalize f2i16, f2u16

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 6 19:51:41 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Wed Jan  6 17:13:34 2021 -0500

pan/bi: Generalize f2i16, f2u16

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

---

 src/panfrost/bifrost/bifrost_compile.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 30381a996b8..5d7eee1b5ca 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -1797,21 +1797,18 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
                         bi_f16_to_s32_to(b, dst, s0, BI_ROUND_RTZ);
                 break;
 
+        /* Note 32-bit sources => no vectorization, so 32-bit works */
         case nir_op_f2u16:
-                if (src_sz == 32) {
-                        bi_mkvec_v2i16_to(b, dst,
-                                        bi_f32_to_u32(b, s0, BI_ROUND_RTZ),
-                                        bi_imm_u16(0));
-                } else
+                if (src_sz == 32)
+                        bi_f32_to_u32_to(b, dst, s0, BI_ROUND_RTZ);
+                else
                         bi_v2f16_to_v2u16_to(b, dst, s0, BI_ROUND_RTZ);
                 break;
 
         case nir_op_f2i16:
-                if (src_sz == 32) {
-                        bi_mkvec_v2i16_to(b, dst,
-                                        bi_f32_to_s32(b, s0, BI_ROUND_RTZ),
-                                        bi_imm_u16(0));
-                } else
+                if (src_sz == 32)
+                        bi_f32_to_s32_to(b, dst, s0, BI_ROUND_RTZ);
+                else
                         bi_v2f16_to_v2s16_to(b, dst, s0, BI_ROUND_RTZ);
                 break;
 



More information about the mesa-commit mailing list