[Mesa-dev] [PATCH] i965: Avoid dependency hints on math opcodes

Mike Stroyan mike at lunarg.com
Fri Feb 28 14:35:27 PST 2014


Matt,

  You haven't replied to my mail with an updated shader test that shows the
math instructions alone causing trouble.
Do you now agree that my patch avoiding math instructions in
opt_set_dependency_control is the appropriate fix?


On Fri, Feb 21, 2014 at 11:30 AM, Mike Stroyan <mike at lunarg.com> wrote:

> Matt,
>
>   I still see the math instructions as the troublemakers.  The NoDDChk bit
> is about write hazards and should not disable checking for read hazards.
>
>   Here is a slightly changed shader test that avoids using NoDDChk on the
> instruction that consumes the result of the 'math exp' instructions.  The
> only difference between the shaders when applying my patch is the presence
> of NoDDChk and NoDDClr on the math instructions.  And the z channel still
> gets almost always incorrect results when NoDDChk is used.
>
>
>
> On Thu, Feb 20, 2014 at 7:52 PM, Matt Turner <mattst88 at gmail.com> wrote:
>
>> On Thu, Feb 20, 2014 at 4:55 PM, Mike Stroyan <mike at lunarg.com> wrote:
>> > Ian,
>> >
>> >   Here is a shader_test version.  It lacks the sparkling uncertainty of
>> the
>> > pixel values in the previous animated example program.
>> > It just gets all vertices uniformly wrong when I run it.
>>
>> Thanks for the test Mike. I reproduced it locally.
>>
>> Comparing the vertex shader assembly before and after your patch, I
>> get the attached diff.
>>
>> The good news is that it doesn't look like the math instructions'
>> dependency control flags are broken. The bad news is that our
>> dependency control optimization has a bug. :)
>>
>> After three math exp instructions write to g8.{x,y,z}, we mov.sat
>> g8.xyz into g116.xyz which we use as a message register. The problem
>> is that we wrote a 1.0 into g116.w before the exp instructions, and
>> the dependency control optimization code recognized that the write to
>> g116.xyz would stall waiting for the write to g116.w and marked the
>> instructions with NoDDClr/NoDDChk. Unfortunately, marking the write to
>> g116.xyz with NoDDChk means that the instruction doesn't wait on the
>> writes to g8 to complete either!
>>
>
>
>
> --
>
>  Mike Stroyan - Software Architect
>  LunarG, Inc.  - The Graphics Experts
>  Cell:  (970) 219-7905
>  Email: Mike at LunarG.com
>  Website: http://www.lunarg.com
>



-- 

 Mike Stroyan - Software Architect
 LunarG, Inc.  - The Graphics Experts
 Cell:  (970) 219-7905
 Email: Mike at LunarG.com
 Website: http://www.lunarg.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140228/03d8d125/attachment.html>


More information about the mesa-dev mailing list