<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 16, 2017 at 8:33 PM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">Am 17.03.2017 um 02:29 schrieb Dave Airlie:<br>
> On 17 March 2017 at 11:09, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
>> On March 16, 2017 5:04:37 PM Dave Airlie <<a href="mailto:airlied@gmail.com">airlied@gmail.com</a>> wrote:<br>
>><br>
>>> From: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
>>><br>
>>> In order to get isinf(NaN) correct, at least radv can't<br>
>>> use an unordered equals which feq has to be for us, this<br>
>>> passes isinf to the backend and let's it sort it out as it<br>
>>> pleases.<br>
>><br>
>><br>
>> I think comparisons are something that were going to need to sort out better<br>
>> in general.  SPIR-V's rules are stricter than GL (at least the way we<br>
>> interpret it).  Could you please be more specific about the issue?<br>
><br>
> IsInf(NaN) unordered appears to end up at true, when the spec for isinf<br>
> says it should be false.<br>
><br>
> well SPIR-V has the unorder and ordered stuff for OpenCL kernels, just<br>
> not sure what want in NIR in this area. If I default to using ordered compares<br>
> for NIR I get isnan and funord fails last I tried.<br>
<br>
</span>FWIW tgsi uses ordered for all comparisons except not equal.<br>
Ok well maybe not all drivers do, but that's what I'd consider what it<br>
should be (radeonsi does that too at a quick glance). Because, well, you<br>
guessed it, d3d10... GL of course won't mandate anything with its super<br>
relaxed nan rules. But this pretty much matches what you get with<br>
ordinary comparison operators in c, so may uneducated guess is it would<br>
be a good match for nir too...<span class="gmail-HOEnZb"><font color="#888888"><br>
</font></span></blockquote></div><br></div><div class="gmail_extra">That was more-or-less my plan.<br></div><div class="gmail_extra"><br>On Thu, Mar 16, 2017 at 6:32 PM, Dave Airlie <span dir="ltr"><<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">> Another option would be to make this lower_isinf and add a quick lowering<br>
> line to nir_opt_algebraic.  That's more idiomatic for nir.<br>
<br>
</span>If I do that though won't that mean I have to set lower_isinf for all<br>
current NIR<br>
users?<span class="gmail-HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div>No, just us.  We're the only ones that consume SPIR-V. :-)</div></div>