aboutsummaryrefslogtreecommitdiffstats
path: root/src/panfrost/bifrost
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-04-14 15:25:27 -0400
committerAlyssa Rosenzweig <[email protected]>2020-04-17 16:25:36 -0400
commit1e3960a7256cc0bd3cf8d46d9f945372d86e0d7a (patch)
tree120d886930c379e4f526b398a96ff4846eb6bdc4 /src/panfrost/bifrost
parent93fffd8a11ae78bfcb67a8ff5c0cd7842cad885f (diff)
pan/bit: Add BI_TABLE 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.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/test/bi_test_pack.c b/src/panfrost/bifrost/test/bi_test_pack.c
index b68d10a07c9..088492524cb 100644
--- a/src/panfrost/bifrost/test/bi_test_pack.c
+++ b/src/panfrost/bifrost/test/bi_test_pack.c
@@ -287,6 +287,21 @@ bit_special_helper(struct panfrost_device *dev,
}
static void
+bit_table_helper(struct panfrost_device *dev, uint32_t *input, enum bit_debug debug)
+{
+ bi_instruction ins = bit_ins(BI_TABLE, 1, nir_type_float, 32);
+
+ for (enum bi_table_op op = 0; op <= BI_TABLE_LOG2_U_OVER_U_1_LOW; ++op) {
+ ins.op.table = op;
+
+ if (!bit_test_single(dev, &ins, input, false, debug)) {
+ fprintf(stderr, "FAIL: table.%s\n",
+ bi_table_op_name(op));
+ }
+ }
+}
+
+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);
@@ -400,6 +415,8 @@ bit_packing(struct panfrost_device *dev, enum bit_debug debug)
float special[4] = { 0.9 };
uint32_t special16[4] = { _mesa_float_to_half(special[0]) | (_mesa_float_to_half(0.2) << 16) };
+ bit_table_helper(dev, (uint32_t *) special, debug);
+
for (unsigned sz = 16; sz <= 32; sz *= 2) {
uint32_t *input =
(sz == 16) ? special16 :