<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">于 2013/3/27 1:26, Renato Golin 写道:<br>
    </div>
    <blockquote
cite="mid:CAPH-gfdCsime1ZREKRT5z8H02uegMHVNmXPtiyovkmufsEu6aw@mail.gmail.com"
      type="cite">
      <pre wrap="">Hi folks,

Been working on sqlite this week and found a few issues.

First, the results from avg(b) is different on x86_64 and ARM because
"long double" is f128 on the former and f64 on the latter in regards
to vxprintf() function. That alone would warrant more care while
writing code, but it seems that vxprintf() is the best example I've
seen so far on what NOT to do with floating points, big or small.

Since that function has a lot of dependencies, I was forced to
improvise and came up with the "sqlite3.patch" attached. It was then
that I found another bug, in fpcmp.

I was getting the values close enough, so I set FP_TOLERANCE to 1e-8
but fpcmp was printing me errors within 1e+3!! That was no FP bug, and
upon investigation, I found that fpcmp was comparing two different
lines...

Not wanting to go down that route, I prepared the second patch
(sqlite3-results.patch) which simple apply the SQL function
"round(avg(b), 8)" and removed the FP comparison altogether, achieving
the same result without hitting the fpcmp bug.

I know it was cowardice, but I didn't want to fix yet another bug (on
unknown territory) while getting the test-suite green, sorry about
that... :(

So, applying sqlite3-results.patch will make it pass on both x86_64
and ARM, and most likely any other 32-bit and 64-bit machines out
there. Any objections?</pre>
    </blockquote>
    <br>
    Hi Renato,<br>
    <br>
      I met trouble with sqlite3 on TILE-Gx also, but I am not sure if
    it's the same root cause with ARM.<br>
     <br>
      the test result is the same between TILE-Gx gcc and TILE-Gx llvm,
    but different with X86, and the only difference is the last bit of
    the float point.<br>
    <br>
      I had applied your patch, but still failed.<br>
    <blockquote
cite="mid:CAPH-gfdCsime1ZREKRT5z8H02uegMHVNmXPtiyovkmufsEu6aw@mail.gmail.com"
      type="cite">
      <pre wrap="">

cheers,
--renato
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
llvm-commits mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>