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

Kenneth Graunke kenneth at whitecape.org
Mon May 16 04:33:36 UTC 2016


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 :(

The other patches look pretty reasonable, too, but I don't think
they still apply at this point...

--Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160515/d8920d2d/attachment.sig>


More information about the mesa-dev mailing list