aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-14 16:45:22 -0400
committerAlyssa Rosenzweig <[email protected]>2020-04-17 16:25:36 -0400
commit8890fa4050dabee9f3ef4a44871a0bc696afb9c7 (patch)
treecf8eb8af736713e314920623fcf722a7e83e30df /src/panfrost
parentb7dd5b579dadb02715029b47b284fb2979fa71c8 (diff)
pan/bit: Add FMA_MSCALE test
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
Diffstat (limited to 'src/panfrost')
-rw-r--r--src/panfrost/bifrost/test/bi_test_pack.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c
index 088492524cb..e097d74b8d9 100644
--- a/src/panfrost/bifrost/test/bi_test_pack.c
+++ b/src/panfrost/bifrost/test/bi_test_pack.c
@@ -249,6 +249,30 @@ bit_fma_helper(struct panfrost_device *dev,
}
static void
+bit_fma_mscale_helper(struct panfrost_device *dev, uint32_t *input, enum bit_debug debug)
+{
+ bi_instruction ins = bit_ins(BI_FMA, 4, nir_type_float, 32);
+ ins.op.mscale = true;
+ ins.src_types[3] = nir_type_int32;
+ ins.src[2] = ins.src[3]; /* Not enough ports! */
+
+ for (unsigned outmod = 0; outmod < 4; ++outmod) {
+ for (unsigned inmod = 0; inmod < 8; ++inmod) {
+ ins.outmod = outmod;
+ ins.src_abs[0] = (inmod & 0x1);
+ ins.src_neg[1] = (inmod & 0x2);
+ ins.src_neg[2] = (inmod & 0x4);
+
+ if (!bit_test_single(dev, &ins, input, true, debug)) {
+ fprintf(stderr, "FAIL: fma_mscale%s.%u\n",
+ outmod ? bi_output_mod_name(outmod) : ".none",
+ inmod);
+ }
+ }
+ }
+}
+
+static void
bit_csel_helper(struct panfrost_device *dev,
unsigned size, uint32_t *input, enum bit_debug debug)
{
@@ -439,4 +463,9 @@ bit_packing(struct panfrost_device *dev, enum bit_debug debug)
bit_frexp_helper(dev, (uint32_t *) input32, debug);
bit_reduce_helper(dev, (uint32_t *) input32, debug);
+
+ uint32_t mscale_input[4];
+ memcpy(mscale_input, input32, sizeof(input32));
+ mscale_input[3] = 0x7;
+ bit_fma_mscale_helper(dev, mscale_input, debug);
}