[PATCH] LNT ARM sqlite3

Jiong Wang jiwang at tilera.com
Tue Mar 26 19:57:51 PDT 2013


? 2013/3/27 1:26, Renato Golin ??:
> 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?

Hi Renato,

   I met trouble with sqlite3 on TILE-Gx also, but I am not sure if it's 
the same root cause with ARM.

   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.

   I had applied your patch, but still failed.
>
> cheers,
> --renato
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130327/c83ac360/attachment.html>


More information about the llvm-commits mailing list