Mesa (master): pan/bit: Add IMATH packing tests

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 4 19:01:44 UTC 2020


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

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Mon May  4 14:40:26 2020 -0400

pan/bit: Add IMATH packing tests

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

---

 src/panfrost/bifrost/test/bi_test_pack.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c
index 832eddaa163..352a7794b51 100644
--- a/src/panfrost/bifrost/test/bi_test_pack.c
+++ b/src/panfrost/bifrost/test/bi_test_pack.c
@@ -545,6 +545,18 @@ bit_bitwise_helper(struct panfrost_device *dev, uint32_t *input, unsigned size,
         }
 }
 
+static void
+bit_imath_helper(struct panfrost_device *dev, uint32_t *input, unsigned size, enum bit_debug debug, bool FMA)
+{
+        bi_instruction ins = bit_ins(BI_IMATH, 2, nir_type_uint, size);
+        bit_swizzle_identity(&ins, 2, size);
+
+        for (unsigned op = BI_IMATH_ADD; op <= BI_IMATH_SUB; ++op) {
+                ins.op.imath = op;
+                bit_test_single(dev, &ins, input, FMA, debug);
+        }
+}
+
 void
 bit_packing(struct panfrost_device *dev, enum bit_debug debug)
 {
@@ -616,6 +628,10 @@ bit_packing(struct panfrost_device *dev, enum bit_debug debug)
         bit_fcmp_helper(dev, (uint32_t *) input32, 32, debug, true);
         bit_fcmp_helper(dev, (uint32_t *) input32, 16, debug, true);
 
-        for (unsigned sz = 8; sz <= 32; sz *= 2)
+        for (unsigned sz = 8; sz <= 32; sz *= 2) {
                 bit_bitwise_helper(dev, (uint32_t *) input32, sz, debug);
+                bit_imath_helper(dev, (uint32_t *) input32, sz, debug, false);
+        }
+
+        bit_imath_helper(dev, (uint32_t *) input32, 32, debug, true);
 }



More information about the mesa-commit mailing list