TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Spying on floating point behavior of existing unmodified scientific applications

42 pointsby aluketover 4 years ago

5 comments

Const-meover 4 years ago
I don’t think these results mean much. Take a look: <a href="https:&#x2F;&#x2F;godbolt.org&#x2F;z&#x2F;Wd98eG" rel="nofollow">https:&#x2F;&#x2F;godbolt.org&#x2F;z&#x2F;Wd98eG</a><p>When asked to divide 2 float numbers by another 2 numbers, clang compiler used division instruction for 4-wide vectors (for 32-bit floats, modern hardware only implements 4-wide and 8-wide vectors), that code runs 0.0 &#x2F; 0.0 in the unused higher 2 lanes.<p>That code is correct (we only want 2 lower lanes, and the result there is good), but FPSpy would then show these red lights for that software.
评论 #24649817 未加载
FartyMcFarterover 4 years ago
Regarding the &quot;inexact results&quot;, how do we know that the application authors didn&#x27;t take those into account while analyzing their algorithms? If you know that your end result is accurate enough, you don&#x27;t need to care about those.
评论 #24649727 未加载
评论 #24649276 未加载
gnufxover 4 years ago
You don&#x27;t need anything special to say you have relevant exceptions. GCC with a benchmark set currently in progress (which has other problems):<p>Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG<p>The &quot;inexact&quot; exception message you got at the end of essentially anything on SunOS at one time was quite annoying. (I can&#x27;t remember whether that was specific to the SunPro compiler.) Fortran provides control over this with IEEE_ARITHMETIC, but I don&#x27;t remember whether that&#x27;s actually part of the standard.
alasarmasover 4 years ago
LD_PRELOAD strikes again! I learned about LD_PRELOAD last year from another HN post, and I&#x27;m not saying it&#x27;s a silver bullet for instrumenting binaries on Linux, but it does seem to come in handy.<p>Edit: a SO question about &quot;the LD_PRELOAD trick&quot;: <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;426230&#x2F;what-is-the-ld-preload-trick" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;426230&#x2F;what-is-the-ld-pr...</a>
评论 #24655450 未加载
throwawaybutwhyover 4 years ago
Wow. Kudos to Adrian for finding this pearl [0]. Source code (non-commercial use license): [1].<p>[0] <a href="http:&#x2F;&#x2F;pdinda.org&#x2F;Papers&#x2F;hpdc20.pdf" rel="nofollow">http:&#x2F;&#x2F;pdinda.org&#x2F;Papers&#x2F;hpdc20.pdf</a><p>[1] <a href="http:&#x2F;&#x2F;presciencelab.org&#x2F;FPSpy&#x2F;fpspy-1.0.tgz" rel="nofollow">http:&#x2F;&#x2F;presciencelab.org&#x2F;FPSpy&#x2F;fpspy-1.0.tgz</a>