<div dir="ltr">Hi Nicolas,<div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 10, 2016 at 11:19 PM, Nicolas Cellier <span dir="ltr">&lt;<a href="mailto:nicolas.cellier.aka.nice@gmail.com" target="_blank">nicolas.cellier.aka.nice@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><div dir="ltr"><div><div><div><div><div><div>Hi Levente,<br></div>I have forgotten where do we load the FloatMathPluginTests from?<br></div></div></div></div></div></div></blockquote><div><br></div><div>It&#39;s in VMMaker and VMMaker.oscog.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Could it be related to:<br></div><a href="http://lists.squeakfoundation.org/pipermail/vm-dev/2010-December/006302.html" target="_blank">http://lists.squeakfoundation.org/pipermail/vm-dev/2010-December/006302.html</a></div></div></div></div></div></blockquote><div><br></div><div>It could be, but the issue is 64-bits only, and the optimised version seems to work fine on 32-bits except for three functions, see platforms//win32/plugins/FloatMathPlugin/Makefile:</div><div><br></div><div><div># Special OFLAGS for some files</div><div>k_tan.o: k_tan.c</div><div>    $(MAKE) -f ../../Makefile.plugin OFLAGS=&quot;-O0&quot; $*.o</div><div><br></div><div>acos.o: acos.c</div><div>    $(MAKE) -f ../../Makefile.plugin OFLAGS=&quot;-O0&quot; $*.o</div><div><br></div><div>tanh.o: tanh.c</div><div>    $(MAKE) -f ../../Makefile.plugin OFLAGS=&quot;-O0&quot; $*.o</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>fdlibm uses pointer aliasing, so special compiler flags are mandatory on modern C compiler to make it work<br></div><a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-February/168890.html" target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-February/168890.html</a></div></div></div></div></blockquote><div><br></div><div>Right.  So I will add the equivalent if it exists in clang. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div>Once I proposed simple changes to &quot;fix&quot; the library<br></div><a href="http://lists.squeakfoundation.org/pipermail/vm-dev/2010-December/006350.html" target="_blank">http://lists.squeakfoundation.org/pipermail/vm-dev/2010-December/006350.html</a></div></div></div></blockquote><div><br></div><div>I *think* that none of the aliasing would be required if the code were rewritten to use a 64-bit integer datatype (long long) to hold doubles.  Looks to me that everything was written before long long; the tables of 64-bit floating-point constants are split into 32-bit halves, etc.  But it&#39;s a lot of work to rewrite.  I wonder whether there are other open source communities interested in collaborating on this.  Also, how much work would it be to write an equivalent library using Slang?</div><div><br></div><div>Anyone know if a company like Google or Facebook would have the resources to fund a replacement?  It looks to be less than a months work by someone competent, perhaps a week.  Also are there any tests?  I&#39;ve not been able to find them.  It&#39;s incredible that much of the industry is replying on an old and inefficient version of such critical functionality.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div>Note that 64bits also require -D__LITTLE_ENDIAN flag on 64bits<br></div><a href="http://lists.squeakfoundation.org/pipermail/vm-dev/2010-December/006352.html" target="_blank">http://lists.squeakfoundation.org/pipermail/vm-dev/2010-December/006352.html</a></div></div></blockquote><div><br></div><div><br></div><div>IMO, better would be to include sqConfg.h.  A &quot;clean&quot; way to do this is to rename fdlibm.h to e.g. realfdlibm.h and have a new fdlibm.h that includes sqConfig.h, defines __LITTLE_ENDIAN in terms of VMBIGENDIAN and then includes realfdlibm.h<br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">Nicolas<br></div></blockquote><div><br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"></div><div class="gmail_extra">2016-05-10 23:52 GMT+02:00 Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>&gt;</span>:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Hi All,<br>
<br>
Evaluating any of the three lines below will make the VM (64-bit 3684 on linux) crash:<br>
<br>
FloatMathPluginTests basicNew cos: -7.384669756559583e-194<br>
FloatMathPluginTests basicNew sin: -7.384669756559583e-194<br>
FloatMathPluginTests basicNew tan: -7.384669756559583e-194<br>
<br>
There&#39;s no crash with the 32-bit VM.<span><font color="#888888"><br>
<br>
Levente<br>
</font></span></blockquote></div><br></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>