<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 28, 2016 at 11:31 AM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/23/2016 08:09 PM, Jason Ekstrand wrote:<br>
> Is there a 64-bit pow in GLSL?  If so, this is the right implementation.<br>
<br>
</span>There isn't.  But there also aren't double versions of sin or cos, and<br>
9076c4e2 added those.  However, it didn't add double versions of fexp2<br>
or flog2 (both of which are not supported in GLSL).<br>
<br>
Ugh... it also did not add double versions of frsq or fsqrt... which are<br>
supported in GLSL.<br>
<br>
So, there are some extra functions and some missing functions.  My gut<br>
tells me we should just do all of them so that people don't have to<br>
think about which ones should / shouldn't be implemented.<br></blockquote><div><br></div><div>That seems reasonable.  Either that or flag those opcodes as only supporting 32-bit types for now.  I think I'd rather just implement them if it's not too much work.  You know someone's going to write a an fp64_pow extension some day... <br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Looking more closely... I think fabs, fnot, fsign, and fsat should have<br>
explicit double support as well... it seems the existing implementations<br>
of both of these will cause some small values to be incorrectly<br>
"flushed" to zero.  What are the rules in C when you compare a double<br>
variable with a single constant?<br>
<br>
void foo(double d)<br>
{<br>
    /* Does d get converted to single, or does 0.0f get converted to<br>
     * double?<br>
     */<br>
    if (d == 0.0f)<br>
        printf("zero\n");<br>
}<br>
<br>
> Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a><br>
> <mailto:<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>>><br>
<span class="">><br>
> On Mar 23, 2016 7:42 PM, "Ian Romanick" <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a><br>
</span><span class="">> <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>>> wrote:<br>
><br>
>     From: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
</span>>     <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>><br>
<span class="">><br>
>     Found (randomly) by inspection.  Looking at the rest of the changes in<br>
>     this file in commit 9076c4e2, I'm certain this is what was intended.<br>
><br>
>     Signed-off-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a><br>
</span>>     <mailto:<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>>><br>
>     Cc: Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a> <mailto:<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>>><br>
>     Cc: <a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a><br>
>     <mailto:<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>><br>
<span class="">>     ---<br>
>      src/compiler/nir/nir_opcodes.py | 2 +-<br>
>      1 file changed, 1 insertion(+), 1 deletion(-)<br>
><br>
>     diff --git a/src/compiler/nir/nir_opcodes.py<br>
>     b/src/compiler/nir/nir_opcodes.py<br>
>     index 553f924..ac59130 100644<br>
>     --- a/src/compiler/nir/nir_opcodes.py<br>
>     +++ b/src/compiler/nir/nir_opcodes.py<br>
>     @@ -520,7 +520,7 @@ for (int i = 0; i < 32; i += 8) {<br>
>      }<br>
>      """)<br>
><br>
>     -binop("fpow", tfloat, "", "bit_size == 64 ? powf(src0, src1) :<br>
>     pow(src0, src1)")<br>
>     +binop("fpow", tfloat, "", "bit_size == 64 ? pow(src0, src1) :<br>
>     powf(src0, src1)")<br>
><br>
>      binop_horiz("pack_half_2x16_split", 1, tuint32, 1, tfloat32, 1,<br>
>     tfloat32,<br>
>                  "pack_half_1x16(src0.x) | (pack_half_1x16(src1.x) << 16)")<br>
>     --<br>
>     2.5.5<br>
><br>
>     _______________________________________________<br>
>     mesa-dev mailing list<br>
</span>>     <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a>><br>
>     <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
<br>
</blockquote></div><br></div></div>