[Mesa-dev] [PATCH 4/8] glsl: Evaluate constant pack/unpack 4x8 expressions

Matt Turner mattst88 at gmail.com
Fri Jan 25 13:31:48 PST 2013


On Fri, Jan 25, 2013 at 11:59 AM, Chad Versace
<chad.versace at linux.intel.com> wrote:
>>> +   *x = unpack_1x8((uint8_t) (u & 0xff));
>>> +   *y = unpack_1x8((uint8_t) (u >> 8));
>>> +   *z = unpack_1x8((uint8_t) (u >> 16));
>>> +   *w = unpack_1x8((uint8_t) (u >> 24));
>>> +}
>>
>> The bitmask (u & 0xff) confused me for a few moments, made me say "Why does Matt
>> need a bitmask there?". But, then I realized that I did the same for unpack_2x16,
>> and you likely just copied my pattern. Oh well. I'd prefer that unpack_2x16
>> and unpack_4x8 follow a similar visual pattern rather than clean that up now,
>> so I'm ok with that funny looking bitmask staying in this patch.

Hah, I wondered the same thing about your patch. :)

gcc, and I assume any other compiler we could possible care about,
knows the & 0xff is a nop.


More information about the mesa-dev mailing list