pan/bi: Use the computed scale for fexp NaN propagation
authorIcecream95 <ixn@disroot.org>
Sun, 8 Aug 2021 08:57:30 +0000 (20:57 +1200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Aug 2021 22:42:08 +0000 (22:42 +0000)
This makes pow(NaN, x) return NaN rather than 1.0.

Fixes: 499397700c1 ("pan/bi: Don't lower fpow")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5189
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12269>

src/panfrost/bifrost/bifrost_compile.c

index a8df910..651eaf7 100644 (file)
@@ -1514,8 +1514,8 @@ bi_fexp_32(bi_builder *b, bi_index dst, bi_index s0, bi_index log2_base)
         bi_index fixed_pt = bi_f32_to_s32(b, scale, BI_ROUND_NONE);
 
         /* Compute the result for the fixed-point input, but pass along
-         * the original input for correct NaN propagation */
-        bi_fexp_f32_to(b, dst, fixed_pt, s0);
+         * the floating-point scale for correct NaN propagation */
+        bi_fexp_f32_to(b, dst, fixed_pt, scale);
 }
 
 static void