<div dir="ltr"><div><div>Hi everyone,<br><br></div>It's the last week of the GSoC but not the last week of my contribution.<br>The library of functions isn't finish yet. I still has to debug the multiply function and to implement the fma.<br></div><div>I wrote a post about my GSoC:<br><a href="https://hopetech.github.io/tech/2016/08/18/Last_week_GSoC.html">https://hopetech.github.io/tech/2016/08/18/Last_week_GSoC.html</a><br></div><div><br></div><div>Have a nice day!<br></div>Elie<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-07-29 7:10 GMT+02:00 Connor Abbott <span dir="ltr"><<a href="mailto:cwabbott0@gmail.com" target="_blank">cwabbott0@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(Re-adding the list)<br>
<span class=""><br>
On Mon, Jul 25, 2016 at 4:46 AM, tournier.elie <<a href="mailto:tournier.elie@gmail.com">tournier.elie@gmail.com</a>> wrote:<br>
> Hi.<br>
><br>
> Thanks for your email.<br>
> It seems that you don't work for nvidia. :P.<br>
><br>
> 1.<br>
> In my *.shader_test files, I have:<br>
> [require]<br>
> GLSL >= 1.30<br>
><br>
> Should I still add "#version 130" at the top of each shaders?<br>
<br>
</span>Yes, since AFAIK that's just a requirement on the OpenGL<br>
implementation ("you must support at least GLSL 1.30 to run this<br>
test") and it doesn't actually add the version tag. If you take a look<br>
at any random shader_test file in piglit (e.g.<br>
tests/spec/glsl-1.30/<wbr>execution/vs-attrib-ivec4-<wbr>precision.shader_test)<br>
you'll see that it declares the version explicitly. And you've already<br>
seen the kind of shenanigans that happen when you don't add it and<br>
don't test with Mesa.<br>
<span class=""><br>
><br>
> 3.<br>
> I think that I just need recip and rsqrt to finish the library. (and to test<br>
> my code of course.)<br>
> I will check which functions does I need to implement<br>
> GL_ARB_gpu_shader_fp64.<br>
<br>
</span>Ok, although I think you'll need to implement fma to get the precision<br>
you need to implement sqrt, inverse, and rsqrt. I believe "real"<br>
softfloat libraries use some kind of integer-based higher-precision<br>
thing, but you don't need an exact result so you don't need to be that<br>
fancy (again, a good reason why our implementation is probably better<br>
to base off of!).<br>
<span class="HOEnZb"><font color="#888888"><br>
Connor<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> Elie<br>
><br>
><br>
> Le samedi 23 juillet 2016, Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> a écrit :<br>
>><br>
>> On Sat, Jul 23, 2016 at 3:32 PM, tournier.elie <<a href="mailto:tournier.elie@gmail.com">tournier.elie@gmail.com</a>><br>
>> wrote:<br>
>> > Hello,<br>
>> ><br>
>> > I hope you are well and that you enjoy these beautiful summer days.<br>
>> ><br>
>> > You can found a new post on my blog : <a href="https://hopetech.github.io/" rel="noreferrer" target="_blank">https://hopetech.github.io/</a> .<br>
>> > During these few days, I implemented eq_fp64, le_fp64, lt_fp64,<br>
>> > mul_fp64,<br>
>> > add_fp64 and fp64-to-fp32-conversion. The code can be found on<br>
>> > <a href="https://github.com/Hopetech/libSoftFloat" rel="noreferrer" target="_blank">https://github.com/Hopetech/<wbr>libSoftFloat</a> .<br>
>> ><br>
>> > Like I say in my post, I will try to make a Docker file for Mesa and<br>
>> > Piglit<br>
>> > developers.<br>
>> > The goal is to have an "easy to install" working environment.<br>
>> > If you have any ideas/recommandations, please don't hesitate to contact<br>
>> > me.<br>
>> ><br>
>> > Have a nice day.<br>
>> > Elie Tournier<br>
>> ><br>
>> > ______________________________<wbr>_________________<br>
>> > mesa-dev mailing list<br>
>> > <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/<wbr>mailman/listinfo/mesa-dev</a><br>
>> ><br>
>><br>
>> Hi,<br>
>><br>
>> Here are a few things to consider:<br>
>><br>
>> 1. If you want your implementation to be pure GLSL 1.30, then you need<br>
>> to add "#version 130" at the top of all your shaders. Otherwise,<br>
>> you'll nominally get GLSL 1.10 (which doesn't support bit-twiddling at<br>
>> all), but certain vendors (*cough* nvidia *cough*) will take it to<br>
>> mean "just turn all of the extensions on." If you don't add the<br>
>> version tag, then you might accidentally do something that won't fly<br>
>> on other implementations. For example, you're using pointers all over<br>
>> the place in function parameters when that's not valid GLSL 1.30 (or<br>
>> any other unextended version of GLSL) since GLSL doesn't have the<br>
>> concept of pointers. Instead, you should be using out/inout parameters<br>
>> (e.g. "out uint zExpPtr").<br>
>><br>
>> 2. I wouldn't worry too much about underflow, etc. since GLSL doesn't<br>
>> require it. The goal in the end is to implement fp64 in a way that<br>
>> satisfies the GLSL spec, so you don't need to worry about implementing<br>
>> all of IEEE if GLSL says it isn't required.<br>
>><br>
>> 2. For sqrt, rsqrt, mod, and so on, I'd check out Intel's<br>
>> implementation of them in our compiler:<br>
>><br>
>> <a href="https://cgit.freedesktop.org/mesa/mesa/tree/src/compiler/nir/nir_lower_double_ops.c" rel="noreferrer" target="_blank">https://cgit.freedesktop.org/<wbr>mesa/mesa/tree/src/compiler/<wbr>nir/nir_lower_double_ops.c</a><br>
>> Intel GPU's are missing a lot of the fp64 operations required by GLSL<br>
>> (they basically only have the ones you already implemented, plus fma),<br>
>> so we had to emulate the others ourselves. Once you get fma working,<br>
>> you can just follow the code there to implement the rest, since your<br>
>> goal is very similar to ours. This should be much more straightforward<br>
>> than basing your code on another softfloat library, since, like you,<br>
>> we assume the existence of all the fp32 operations and don't try to be<br>
>> exact when GLSL doesn't require us to be.<br>
>><br>
>> Connor<br>
</div></div></blockquote></div><br></div>