pan/bit: Add swizzles to round tests
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 1 May 2020 20:13:09 +0000 (16:13 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Mon, 4 May 2020 15:08:16 +0000 (11:08 -0400)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>

src/panfrost/bifrost/test/bi_test_pack.c

index ba9828cffe03edcb73250467bc240bdcc42d3277..e1176711a0e986d53fb6e0427f0bbd91bdf7dd1b 100644 (file)
@@ -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);
+                        }
                 }
         }
 }