From 041ba62e8766aec2565234d56c0df02517c26ad0 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 1 May 2020 16:13:09 -0400 Subject: [PATCH] pan/bit: Add swizzles to round tests Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/test/bi_test_pack.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c index ba9828cffe0..e1176711a0e 100644 --- a/src/panfrost/bifrost/test/bi_test_pack.c +++ b/src/panfrost/bifrost/test/bi_test_pack.c @@ -364,11 +364,18 @@ bit_round_helper(struct panfrost_device *dev, uint32_t *input, unsigned sz, bool bi_instruction ins = bit_ins(BI_ROUND, 1, nir_type_float, sz); for (enum bifrost_roundmode mode = 0; mode <= 3; ++mode) { - ins.roundmode = mode; + for (unsigned swizzle = 0; swizzle < (sz == 16 ? 4 : 1); ++swizzle) { + if (sz == 16) { + for (unsigned i = 0; i < 2; ++i) + ins.swizzle[0][i] = ((swizzle >> i) & 1) ? 1 : 0; + } + + ins.roundmode = mode; - if (!bit_test_single(dev, &ins, input, FMA, debug)) { - fprintf(stderr, "FAIL: round.%u.%u\n", - sz, mode); + if (!bit_test_single(dev, &ins, input, FMA, debug)) { + fprintf(stderr, "FAIL: round.%u.%u\n", + sz, mode); + } } } } -- 2.30.2