[Mesa-dev] [PATCH] i965: Fix undefined df bits in brw_reg comparisons.

Emil Velikov emil.l.velikov at gmail.com
Tue May 17 10:40:37 UTC 2016


On 16 May 2016 at 05:33, Kenneth Graunke <kenneth at whitecape.org> wrote:
> On Saturday, May 14, 2016 2:42:20 PM PDT Emil Velikov wrote:
>> Hi Ken,
>>
>> On 14 May 2016 at 01:44, Kenneth Graunke <kenneth at whitecape.org> wrote:
>> > Commit 5310bca024f77da40ea6f4c275455f9cb0528f9e added a new "double df"
>> > field to the brw_reg struct, adding an extra 4 bytes of data that isn't
>> > usually initialized (or may contain irrelevant garbage if the struct is
>> > mutated).  This means that it's no longer safe to memcmp().
>> >
>> > Instead, add a brw_regs_equal() function which ignores the extra df bits
>> > unless they matter.  To keep the implementation cheap, we wrap the first
>> > set of fields in a union/struct so that we can use a single DWord
>> > comparison.
>> >
>> This seems to be roughly what I did a while ago [1], as part of a
>> series [2] to remove the memclear/memcmp in {brw,fs,src,dst}_reg.
>> Shame the series never got much input, even after a few pings :-(
>>
>> -Emil
>> [1] https://patchwork.freedesktop.org/patch/63840/
>> [2] https://patchwork.freedesktop.org/series/483/
>
> Yikes...I didn't realize that your series went unmerged.
>
> I would have credited you for the patch had I realized you'd written
> it months earlier.  Sorry :(
>
No problems.

> The other patches look pretty reasonable, too, but I don't think
> they still apply at this point...
>
Indeed they don't (as-is). Since it's not urgent, I'll respin it after
the branch point.

-Emil


More information about the mesa-dev mailing list