diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-04-14 12:55:02 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2020-04-17 16:25:36 -0400 |
commit | 68b4e708f14d116518edc55017dcb8da539328fd (patch) | |
tree | 847ce7a85344f54b3859789b46cd8856a1e534de | |
parent | 36cfe722e5ab6c01216f30cad6909888425d2931 (diff) |
pan/bit: Add frexp_log test
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
-rw-r--r-- | src/panfrost/bifrost/test/bi_test_pack.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c index 03c88d7dd91..9d4b6fe723a 100644 --- a/src/panfrost/bifrost/test/bi_test_pack.c +++ b/src/panfrost/bifrost/test/bi_test_pack.c @@ -287,6 +287,22 @@ bit_special_helper(struct panfrost_device *dev, } static void +bit_frexp_helper(struct panfrost_device *dev, uint32_t *input, enum bit_debug debug) +{ + bi_instruction ins = bit_ins(BI_FREXP, 1, nir_type_float, 32); + ins.dest_type = nir_type_int32; + + for (enum bi_frexp_op op = 0; op <= BI_FREXPE_LOG; ++op) { + ins.op.frexp = op; + + if (!bit_test_single(dev, &ins, input, true, debug)) { + fprintf(stderr, "FAIL: frexp.%s\n", + bi_frexp_op_name(op)); + } + } +} + +static void bit_convert_helper(struct panfrost_device *dev, unsigned from_size, unsigned to_size, unsigned cx, unsigned cy, bool FMA, enum bifrost_roundmode roundmode, @@ -389,5 +405,5 @@ bit_packing(struct panfrost_device *dev, enum bit_debug debug) bit_convert_helper(dev, 16, 16, c & 1, c >> 1, false, rm, (uint32_t *) input16, debug); } - + bit_frexp_helper(dev, (uint32_t *) input32, debug); } |