[PATCH] LNT ARM sqlite3

Renato Golin rengolin at systemcall.org
Wed Mar 27 01:34:22 PDT 2013


Hi Jiong,

Thanks for looking into it. What's the diff between the outputs?

Maybe I'm being too adventurous in rounding by the 8th digit. Can you
change the round to something like 5 (in speedtest.tcl) just to make
sure it's not that?

thanks,
--renato

On 27 March 2013 02:57, Jiong Wang <jiwang at tilera.com> wrote:
> 于 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
>
>




More information about the llvm-commits mailing list