Mesa (staging/21.2): pan/bi: Use the computed scale for fexp NaN propagation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 12 17:09:47 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 1e4967c1846f2d6eeb08697746d032f0a237f45d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1e4967c1846f2d6eeb08697746d032f0a237f45d

Author: Icecream95 <ixn at disroot.org>
Date:   Sun Aug  8 20:57:30 2021 +1200

pan/bi: Use the computed scale for fexp NaN propagation

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>
(cherry picked from commit ee2bb57f1ed2f19024adaf4f178a893354c680ae)

---

 .pick_status.json                      | 2 +-
 src/panfrost/bifrost/bifrost_compile.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index f6df2df1135..5148197a0de 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -193,7 +193,7 @@
         "description": "pan/bi: Use the computed scale for fexp NaN propagation",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "499397700c10f260e806921ba59103eab0998de8"
     },
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index 0ec187dd208..74639ff7d6b 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -1488,8 +1488,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



More information about the mesa-commit mailing list