pan/mdg: Use util_logbase2 instead of C99 log2
authorIcecream95 <ixn@disroot.org>
Sat, 19 Jun 2021 03:01:15 +0000 (15:01 +1200)
committerAlyssa Rosenzweig <alyssa@collabora.com>
Sat, 5 Mar 2022 19:27:44 +0000 (14:27 -0500)
log2 operates on double, we only need the integer util/ function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15250>

src/panfrost/midgard/disassemble.c

index 8437e0e..1d8ee51 100644 (file)
@@ -870,7 +870,7 @@ print_vector_field(disassemble_context *ctx, FILE *fp, const char *name,
         /* Mask out unused components based on the writemask, but don't mask out
          * components that are used for interlane instructions like fdot3. */
         uint8_t src_mask =
-                rep ? expand_writemask(mask_of(rep), log2(128 / bits_for_mode(mode))) : mask;
+                rep ? expand_writemask(mask_of(rep), util_logbase2(128 / bits_for_mode(mode))) : mask;
 
         fprintf(fp, ", ");