From: Alyssa Rosenzweig Date: Fri, 17 Apr 2020 19:40:12 +0000 (-0400) Subject: pan/bit: Add fp16 min/max tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=29fb5451a97a9c98821fa17dc8d7495c85c5e813;p=mesa.git pan/bit: Add fp16 min/max tests Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c index e127ea3b8de..4f2376e5752 100644 --- a/src/panfrost/bifrost/test/bi_test_pack.c +++ b/src/panfrost/bifrost/test/bi_test_pack.c @@ -200,7 +200,10 @@ bit_fmod_helper(struct panfrost_device *dev, { bi_instruction ins = bit_ins(c, 2, nir_type_float, size); - for (unsigned outmod = 0; outmod < 4; ++outmod) { + bool fp16 = (size == 16); + bool has_outmods = fma || !fp16; + + for (unsigned outmod = 0; outmod < (has_outmods ? 4 : 1); ++outmod) { for (unsigned inmod = 0; inmod < 16; ++inmod) { ins.outmod = outmod; ins.op.minmax = op; @@ -209,8 +212,8 @@ bit_fmod_helper(struct panfrost_device *dev, ins.src_neg[0] = (inmod & 0x4); ins.src_neg[1] = (inmod & 0x8); - /* Skip over tests that cannot run on FMA */ - if (fma && (size == 16) && ins.src_abs[0] && ins.src_abs[1]) + /* Skip over tests that cannot run */ + if ((fma || c == BI_MINMAX) && fp16 && ins.src_abs[0] && ins.src_abs[1]) continue; if (!bit_test_single(dev, &ins, input, fma, debug)) { @@ -466,12 +469,10 @@ bit_packing(struct panfrost_device *dev, enum bit_debug debug) (uint32_t *) input32; bit_fmod_helper(dev, BI_ADD, sz, true, input, debug, 0); + bit_fmod_helper(dev, BI_ADD, sz, false, input, debug, 0); - if (sz == 32) { - bit_fmod_helper(dev, BI_ADD, sz, false, input, debug, 0); - bit_fmod_helper(dev, BI_MINMAX, sz, false, input, debug, BI_MINMAX_MIN); - bit_fmod_helper(dev, BI_MINMAX, sz, false, input, debug, BI_MINMAX_MAX); - } + bit_fmod_helper(dev, BI_MINMAX, sz, false, input, debug, BI_MINMAX_MIN); + bit_fmod_helper(dev, BI_MINMAX, sz, false, input, debug, BI_MINMAX_MAX); bit_fma_helper(dev, sz, input, debug); }