nir/range_analysis: Add "is finite" range analysis tracking
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 17 Aug 2020 22:56:24 +0000 (15:56 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 11 Mar 2021 22:00:30 +0000 (22:00 +0000)
commitd4f21b53f291e69ac6b846df9dd5f44f2a663535
tree5b88fc809e7e0147d191c093073c0b5d719307a2
parent86fb53b1be1fea5ccea34d5bfca9d9aea64f3af2
nir/range_analysis: Add "is finite" range analysis tracking

The obvious changes to nir_search_helpers.h are in a separate commit to
limit the scope of this change.  These additions are really only needed
to support the next commit "nir/range_analysis: Add "is a number" range
analysis tracking".  This reduction in scope is intended to increase the
suitability for stable branches.

No shader-db or fossil-db changes on any Intel platform.

v2: Pack and unpack is_finite.

v3: Split nir_search_helpers.h changes into a separate commit.

v4: Remove assertion intended for the next commit.  Update is_finite
comment for fsign.  Both noticed by Rhys.  Fix is_finite handling for
load_const vectors.  If any element is not finite, set the flag to
false.  This is the same way is_integral is already handled.

v5: Update handling of b2i32.  intBitsToFloat(int(true)) is
1.401298464324817e-45.  Return a value consistent with that.

Fixes: 405de7ccb6c ("nir/range-analysis: Rudimentary value range analysis pass")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9108>
src/compiler/nir/nir_range_analysis.c
src/compiler/nir/nir_range_analysis.h