[Mesa-dev] [PATCH 06/16] i965: Add a brw_invert_cmod() function.

Matt Turner mattst88 at gmail.com
Wed Jan 21 20:09:23 PST 2015


On Wed, Jan 21, 2015 at 6:57 PM, Ian Romanick <idr at freedesktop.org> wrote:
> On 01/21/2015 03:05 PM, Matt Turner wrote:
>> On Wed, Jan 21, 2015 at 2:52 PM, Kenneth Graunke <kenneth at whitecape.org> wrote:
>>> On Wednesday, January 21, 2015 01:02:46 PM Matt Turner wrote:
>>>> Okay, I changed the name, and in the process of thinking about that
>>>> and a comment Jason made I realized that part of this function was
>>>> wrong. When you negate, you don't want to swap Z <-> NZ. I've changed
>>>> the function accordingly:
>>>>
>>>> +   switch (cmod) {
>>>> +   case BRW_CONDITIONAL_Z:
>>>> +   case BRW_CONDITIONAL_NZ:
>>>> +      return cmod;
>>>> [snip]
>>>
>>> What?  This function takes a comparison that produces "A" and gives you
>>> a new one that produces "!A".
>>
>> No. It gives the conditional mod you get by negating both operands of
>> the comparison.
>
> Which is the same as if you commute the arguments, right?

Yes, actually. Thanks for mentioning that. That's made me realize the
rest of the patch is wrong (in addition to Z/NZ) and that I should
just be using the existing brw_swap_cmod() function.


More information about the mesa-dev mailing list