From 1dcf291e3bf7050a396cee74b6baca99a575d915 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 4 May 2020 14:40:26 -0400 Subject: [PATCH] pan/bit: Add IMATH packing tests Signed-off-by: Alyssa Rosenzweig Part-of: --- 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); } -- 2.30.2