pan/bi: Add special op for exp2
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 14 Apr 2020 16:22:28 +0000 (12:22 -0400)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 17 Apr 2020 20:25:34 +0000 (16:25 -0400)
Needs some extra help but basically exp2_fast

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4615>

src/panfrost/bifrost/bi_print.c
src/panfrost/bifrost/compiler.h

index c9e6beb1249558b3f3b40399fbb3415c4f4236e0..2e6ef45289936be598bc0818e0c69d8dfd6ce296 100644 (file)
@@ -267,6 +267,7 @@ bi_special_op_name(enum bi_special_op op)
         switch (op) {
         case BI_SPECIAL_FRCP: return "frcp";
         case BI_SPECIAL_FRSQ: return "frsq";
+        case BI_SPECIAL_EXP2_LOW: return "exp2_low";
         default: return "invalid";
         }
 }
index 64baf8cc4c7c377c4225d7ec3fdbc046e1478404..90f0e94a6e0931774df84f54c779cd8a266bfd41 100644 (file)
@@ -195,6 +195,11 @@ enum bi_table_op {
 enum bi_special_op {
         BI_SPECIAL_FRCP,
         BI_SPECIAL_FRSQ,
+
+        /* fp32 exp2() with low precision, suitable for half_exp2() in CL or
+         * exp2() in GL. In the first argument, it takes f2i_rte(x * 2^24). In
+         * the second, it takes x itself. */
+        BI_SPECIAL_EXP2_LOW,
 };
 
 typedef struct {