<HTML>
<div><style> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</style>It just seems highly dependent on the source code and can easily break if it's changed... and not just the Floor function, but also possibly if Trunc and Frac are modified in some way. The code does boil down to two instructions in SSE 4.1 and AVX, but it depends on many different nodes with an exact arrangement, and if something is changed (but still functionally equivalent), the optimisation will break.<br>
</div><div><br>
</div><div>Adding a platform-specific internal function and having floor() point to it on said platform is probably out of the question, although will help alleviate some of the dependencies. This is actually an interesting conundrum.</div><div><br>
</div><div>Gareth aka. Kit<br>
</div> <br>
<br>
<span style="font-weight: bold;">On Sun 03/02/19 21:44 , Florian Klämpfl florian@freepascal.org sent:<br>
</span><blockquote style="BORDER-LEFT: #F5F5F5 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">Am 03.02.19 um 22:29 schrieb Jonas Maebe:
<br>
<span style="color: rgb(102, 102, 102);">> On 03/02/19 21:26, J. Gareth Moreton wrote:
</span><br>
<span style="color: rgb(102, 102, 102);">>> One thing that I should ask though... if a unit like Math is compiled
</span><br>
<span style="color: rgb(102, 102, 102);">>> with -fAVX, then another project that uses it is built without any
</span><br>
<span style="color: rgb(102, 102, 102);">>> special floating-point types, is Math recompiled or will it use the
</span><br>
<span style="color: rgb(102, 102, 102);">>> code already built, thereby possibly putting AVX code into a non-AVX
</span><br>
<span style="color: rgb(102, 102, 102);">>> project?
</span><br>
<span style="color: rgb(102, 102, 102);">>
</span><br>
<span style="color: rgb(102, 102, 102);">> The latter.
</span><br>
<br>
This is why I proposed to use inlining, especially as it seems to boil
<br>
down to two instructions.
<br>
<br>
_______________________________________________
<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>
<br>
<a target="_blank" href="<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a>"><span style="color: red;">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</span></a>
<br>
<br>
<br>
</blockquote></HTML>