[Mesa-dev] [PATCH 07/18] intel/compiler: fix for memmove argument on annotating error

Matt Turner mattst88 at gmail.com
Fri Nov 17 04:51:58 UTC 2017


On Wed, Nov 15, 2017 at 12:13 AM, Rogovin, Kevin
<kevin.rogovin at intel.com> wrote:
> I have just seen that I have had an epic brain lapse on this.
>
> The code is pretty clear, the correct value of count should be ann_count - i. This is because:
>   a. The value of ann_count is the value of the array size BEFORE the insert; this is clear from the code within the if (offset + ..) where it increments ann_count.
>  b. Since ann_count is the size before the insert, it should move the content in the open range [i, ann_count) to [i + 1, ann_count + 1); thus the number of elements is given by ann_count - i.
>
> Changing the count to ann_count - i does the right thing, and also makes it quite clear that Matt is correct on patch 11: that it was just papering over a bug from using the wrong count value.

I think I used the wrong data structure :)

I reproduced the problem you were having and then got tired of
thinking about how to memmove elements. I rewrote the annotation code
yesterday to use a linked list, which is much more natural. I just
sent the patches. Attached is a patch you can squash into your series
in order to make it work on top of my series.

> However, once this is done, the build does assert() on some shaders that I have; this is because it fails to understand some registers.

I think that's a result of the disassembler not knowing how to
disassemble sends/sendsc. Both Toni and Neil have written patches for
that. I'll see if I can rebase them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p
Type: application/octet-stream
Size: 2293 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171116/c534d280/attachment.obj>


More information about the mesa-dev mailing list