[PATCH] LNT ARM sqlite3

Jiong Wang jiwang at tilera.com
Thu Mar 28 02:58:17 PDT 2013


? 2013/3/27 19:59, Renato Golin ??:
> On 27 March 2013 10:57, Jiong Wang <jiwang at tilera.com 
> <mailto:jiwang at tilera.com>> wrote:
>
>       after your patch:
>     ...
>     -9|499965.55555556
>     +9|499965.55555555
>     ...
>
>      still the last bit is different, so TILE-Gx has a different fail
>     reason, I guess this is related with TILE-Gx runtime.
>
>
>
> That's ok, it just means that FP in TILE-Gx suffer more from sqlite3's 
> bad code than ARM or x86_64.
>
> Please, try the new patch attached, which rounds by the 7th digit.

Hi Renato,

   after your patch, TILE-Gx still failed.  I have debugged the sqlite3 
code, and found the cause is here:

sqlite3.c: 14120, in vxprintf which play lots of trick on float point:

(gdb) n
14120             while( realvalue>=1e32 && exp<=350 ){ realvalue *= 
1e-32; exp+=32; }

the realvalue is 496647.33333333331, then realvalue * 0.1 gets different 
result on TILE-Gx and X86,

on TILE-Gx:
(gdb) p realvalue*0.1
$6 = 49664.733333333337

on X86
(gdb) p  496647.33333333331* 0.1
$2 = 49664.733333333315

these minor differences accumulated, and thus cause the the final digit 
difference on TILE-Gx and X86/ARM.

And I found in your sqlite3.patch, you are trying to skip those tricky 
float point transformation to keep realvalue untouched. I guess it 
better to assign "temp" after the negative number processed.

@@ -14100,6 +14101,7 @@ static void vxprintf(
            else if( flag_blanksign )    prefix = ' ';
            else                         prefix = 0;
          }
+        temp = realvalue;
          if( xtype==etGENERIC && precision>0 ) precision--;


---
Regards,
Jiong




>
> cheers,
> --renato
>

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


More information about the llvm-commits mailing list