<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 19:59, Renato Golin 写道:<br>
</div>
<blockquote
cite="mid:CAMSE1kdWRnXEmd8vFJ=gUx0eqCCb4wTw8z79wwOQWU9i05bk1w@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div dir="ltr">On 27 March 2013 10:57, Jiong Wang <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:jiwang@tilera.com"
target="_blank">jiwang@tilera.com</a>></span> wrote:<br>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
after your patch:<br>
...<br>
-9|499965.55555556<br>
+9|499965.55555555<br>
...<br>
<br>
still the last bit is different, so TILE-Gx has a
different fail reason, I guess this is related with
TILE-Gx runtime.<br>
</blockquote>
<div><br>
</div>
</div>
<br>
</div>
<div class="gmail_extra" style="">That's ok, it just means that
FP in TILE-Gx suffer more from sqlite3's bad code than ARM or
x86_64.</div>
<div class="gmail_extra" style=""><br>
</div>
<div class="gmail_extra" style="">Please, try the new patch
attached, which rounds by the 7th digit.</div>
</div>
</blockquote>
<br>
Hi Renato,<br>
<br>
after your patch, TILE-Gx still failed. I have debugged the
sqlite3 code, and found the cause is here:<br>
<br>
sqlite3.c: 14120, in vxprintf which play lots of trick on float
point:<br>
<br>
(gdb) n<br>
14120 while( realvalue>=1e32 && exp<=350
){ realvalue *= 1e-32; exp+=32; }<br>
<br>
the realvalue is 496647.33333333331, then realvalue * 0.1 gets
different result on TILE-Gx and X86, <br>
<br>
on TILE-Gx:<br>
(gdb) p realvalue*0.1<br>
$6 = 49664.733333333337<br>
<br>
on X86<br>
(gdb) p 496647.33333333331* 0.1<br>
$2 = 49664.733333333315<br>
<br>
these minor differences accumulated, and thus cause the the final
digit difference on TILE-Gx and X86/ARM.<br>
<br>
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. <br>
<br>
@@ -14100,6 +14101,7 @@ static void vxprintf(<br>
else if( flag_blanksign ) prefix = ' ';<br>
else prefix = 0;<br>
}<br>
+ temp = realvalue;<br>
if( xtype==etGENERIC && precision>0 )
precision--;<br>
<br>
<br>
---<br>
Regards,<br>
Jiong<br>
<br>
<br>
<br>
<br>
<blockquote
cite="mid:CAMSE1kdWRnXEmd8vFJ=gUx0eqCCb4wTw8z79wwOQWU9i05bk1w@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra" style=""><br>
</div>
<div class="gmail_extra" style="">cheers,</div>
<div class="gmail_extra" style="">--renato</div>
<div class="gmail_extra" style=""><br>
</div>
</div>
</blockquote>
<br>
</body>
</html>