Mesa (master): pan/bi: Implement scalar i2i8/u2u8

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 22:43:59 UTC 2021


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Tue Jan  5 19:22:25 2021 -0500

pan/bi: Implement scalar i2i8/u2u8

Doesn't work for vectors though that's the vectorization branch's
problem to deal with now. Suffices for fragment output.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Tested-by: Maciej Matuszczyk <maccraft123mc at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8427>

---

 src/panfrost/bifrost/bifrost_compile.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index d29c9fc948b..5f96b5a3eb6 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -1107,7 +1107,12 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
 
         case nir_op_i2i8:
         case nir_op_u2u8:
-                unreachable("should've been lowered");
+                /* No vectorization in this part of the loop, so downcasts are
+                 * a noop. When vectorization support lands, some case
+                 * handlingg will be needed, but for the scalar case this is
+                 * optimal as it can be copypropped away */
+                bi_mov_i32_to(b, dst, s0);
+                break;
 
         case nir_op_fround_even:
         case nir_op_fceil:



More information about the mesa-commit mailing list