[Mesa-dev] [PATCH 1/7] mesa: add ASTC 2D LDR decoder

Roland Scheidegger sroland at vmware.com
Tue Jul 31 22:57:55 UTC 2018


Am 24.07.2018 um 01:52 schrieb Marek Olšák:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> +uint16_t _mesa_uint16_div_64k_to_half(uint16_t v)
> +{
> +   /* Zero or subnormal. Set the mantissa to (v << 8) and return. */
> +   if (v < 4)
> +      return v << 8;
> +
> +   /* Count the leading 0s in the uint16_t */
> +   int n = __builtin_clz(v) - (sizeof(unsigned int) - sizeof(uint16_t)) * 8;
This broke the windows build.
I think either use util_last_bit and some arithmetic or define some new
util function...

Roland


More information about the mesa-dev mailing list