intel/mi_builder: Fix a misleading comment
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 18 Feb 2021 15:37:44 +0000 (09:37 -0600)
committerMarge Bot <eric+marge@anholt.net>
Thu, 18 Feb 2021 21:28:40 +0000 (21:28 +0000)
This doesn't actually assume the top 32 bits of the source value are
zero.  Instead, it does (src >> shift) & UINT32_MAX regardless of what
the top bits of src are.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9116>

src/intel/common/gen_mi_builder.h

index 24e16ac..79a1679 100644 (file)
@@ -868,7 +868,7 @@ gen_mi_ushr32_imm(struct gen_mi_builder *b,
                   struct gen_mi_value src, uint32_t shift)
 {
    /* We right-shift by left-shifting by 32 - shift and taking the top 32 bits
-    * of the result.  This assumes the top 32 bits are zero.
+    * of the result.
     */
    if (shift > 64)
       return gen_mi_imm(0);