aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-14 17:00:31 -0400
committerAlyssa Rosenzweig <[email protected]>2020-04-17 16:25:36 -0400
commit15fe8d5d7b0d7edc976ad39d93e76aab6ad0e929 (patch)
treee5ce48502add24800bfa80227a7d36e6db33b7a3 /src/panfrost/bifrost
parent20f255b18e48f61a5a0b22041c7149225f3bed64 (diff)
pan/bit: Add fexp2_fast test
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>
Diffstat (limited to 'src/panfrost/bifrost')
-rw-r--r--src/panfrost/bifrost/test/bi_test_pack.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c
index e097d74b8d9..ac0a80572db 100644
--- a/src/panfrost/bifrost/test/bi_test_pack.c
+++ b/src/panfrost/bifrost/test/bi_test_pack.c
@@ -295,14 +295,28 @@ static void
bit_special_helper(struct panfrost_device *dev,
unsigned size, uint32_t *input, enum bit_debug debug)
{
- bi_instruction ins = bit_ins(BI_SPECIAL, 1, nir_type_float, size);
+ bi_instruction ins = bit_ins(BI_SPECIAL, 2, nir_type_float, size);
+ uint32_t exp_input[4];
+
+ for (enum bi_special_op op = BI_SPECIAL_FRCP; op <= BI_SPECIAL_EXP2_LOW; ++op) {
+ if (op == BI_SPECIAL_EXP2_LOW) {
+ /* exp2 only supported in fp32 mode */
+ if (size != 32)
+ continue;
+
+ /* Give expected input */
+ exp_input[1] = input[0];
+ float *ff = (float *) input;
+ exp_input[0] = (int) (ff[0] * (1 << 24));
+ }
- for (enum bi_special_op op = BI_SPECIAL_FRCP; op <= BI_SPECIAL_FRSQ; ++op) {
for (unsigned c = 0; c < ((size == 16) ? 2 : 1); ++c) {
ins.op.special = op;
ins.swizzle[0][0] = c;
- if (!bit_test_single(dev, &ins, input, false, debug)) {
+ if (!bit_test_single(dev, &ins,
+ op == BI_SPECIAL_EXP2_LOW ? exp_input : input,
+ false, debug)) {
fprintf(stderr, "FAIL: special%u.%s\n",
size, bi_special_op_name(op));
}