aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-05-01 16:38:23 -0400
committerAlyssa Rosenzweig <[email protected]>2020-05-04 11:08:16 -0400
commit9bc684cad838094ae7d26a102079862246dc9eab (patch)
treed2bfcea69f8482a6fb69cdf9cc243c375e7498e1 /src/panfrost/bifrost
parent041ba62e8766aec2565234d56c0df02517c26ad0 (diff)
pan/bit: Add more 16-bit fmod tests
Swizzles and more abs. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4883>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r--src/panfrost/bifrost/test/bi_test_pack.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c
index e1176711a0e..25c87d0c144 100644
--- a/src/panfrost/bifrost/test/bi_test_pack.c
+++ b/src/panfrost/bifrost/test/bi_test_pack.c
@@ -190,6 +190,23 @@ bit_ins(enum bi_class C, unsigned argc, nir_alu_type base, unsigned size)
return ins;
}
+#define BIT_FOREACH_SWIZZLE(swz, args, sz) \
+ for (unsigned swz = 0; swz < ((sz == 16) ? (1 << (2 * args)) : 1); ++swz)
+
+static void
+bit_apply_swizzle(bi_instruction *ins, unsigned swz, unsigned args, unsigned sz)
+{
+ unsigned slots_per_arg = (sz == 16) ? 4 : 1;
+ unsigned slots_per_chan = (sz == 16) ? 1 : 0;
+ unsigned mask = (sz == 16) ? 1 : 0;
+
+ for (unsigned i = 0; i < args; ++i) {
+ for (unsigned j = 0; j < (32 / sz); ++j) {
+ ins->swizzle[i][j] = ((swz >> (slots_per_arg * i)) >> (slots_per_chan * j)) & mask;
+ }
+ }
+}
+
/* Tests all 64 combinations of floating point modifiers for a given
* instruction / floating-type / test type */
@@ -204,6 +221,7 @@ bit_fmod_helper(struct panfrost_device *dev,
bool has_outmods = fma || !fp16;
for (unsigned outmod = 0; outmod < (has_outmods ? 4 : 1); ++outmod) {
+ BIT_FOREACH_SWIZZLE(swz, 2, size) {
for (unsigned inmod = 0; inmod < 16; ++inmod) {
ins.outmod = outmod;
ins.op.minmax = op;
@@ -211,10 +229,7 @@ bit_fmod_helper(struct panfrost_device *dev,
ins.src_abs[1] = (inmod & 0x2);
ins.src_neg[0] = (inmod & 0x4);
ins.src_neg[1] = (inmod & 0x8);
-
- /* Skip over tests that cannot run */
- if ((fma || c == BI_MINMAX) && fp16 && ins.src_abs[0] && ins.src_abs[1])
- continue;
+ bit_apply_swizzle(&ins, swz, 2, size);
if (!bit_test_single(dev, &ins, input, fma, debug)) {
fprintf(stderr, "FAIL: fmod.%s%u.%s%s.%u\n",
@@ -226,6 +241,7 @@ bit_fmod_helper(struct panfrost_device *dev,
}
}
}
+ }
}
static void