src/util: Remove out-of-range comparison
authorKristian H. Kristensen <hoegsberg@google.com>
Fri, 22 May 2020 21:33:17 +0000 (14:33 -0700)
committerKristian H. Kristensen <hoegsberg@google.com>
Tue, 26 May 2020 19:46:18 +0000 (12:46 -0700)
Silence the warning about this always-true comparison.

src/util/softfloat.c:214:42: warning: comparison of constant 32768
with expression of type 'int16_t' (aka 'short') is always false
[-Wtautological-constant-out-of-range-compare]
        } else if ((e > 0x1d) || (0x8000 <= m)) {
                                  ~~~~~~ ^  ~

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>

src/util/softfloat.c

index 591128efd474e9e0bb114e56428c5a3988f6b2ce..365b15bbf0c2f29f148217a168d88ac79772a4f9 100644 (file)
@@ -211,7 +211,7 @@ uint16_t _mesa_roundtozero_f16(int16_t s, int16_t e, int16_t m)
         if (e < 0) {
             m = _mesa_shift_right_jam32(m, -e);
             e = 0;
-        } else if ((e > 0x1d) || (0x8000 <= m)) {
+        } else if (e > 0x1d) {
             e = 0x1f;
             m = 0;
             return (s << 15) + (e << 10) + m - 1;