From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22725 invoked by alias); 4 Aug 2009 13:03:04 -0000 Received: (qmail 22586 invoked by uid 22791); 4 Aug 2009 13:03:01 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_41,J_CHICKENPOX_53 X-Spam-Check-By: sourceware.org Received: from web112518.mail.gq1.yahoo.com (HELO web112518.mail.gq1.yahoo.com) (98.137.26.190) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Tue, 04 Aug 2009 13:02:55 +0000 Received: (qmail 81618 invoked by uid 60001); 4 Aug 2009 13:02:52 -0000 Message-ID: <904065.32186.qm@web112518.mail.gq1.yahoo.com> Received: from [123.237.137.138] by web112518.mail.gq1.yahoo.com via HTTP; Tue, 04 Aug 2009 06:02:52 PDT Date: Tue, 04 Aug 2009 13:03:00 -0000 From: paawan oza Subject: Re: final i386.floating.record.patch To: Hui Zhu Cc: Michael Snyder , "gdb-patches@sourceware.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00040.txt.bz2 Hi Hui, I am not sure which test case (insn) caused this. would you please send me= the example (.c file) which you have tried to run ? please also try to let me know at which insn (at which point it fails). Regards, Oza. --- On Tue, 8/4/09, Hui Zhu wrote: > From: Hui Zhu > Subject: Re: final i386.floating.record.patch > To: "paawan oza" > Cc: "Michael Snyder" , "gdb-patches@sourceware.org" <= gdb-patches@sourceware.org> > Date: Tuesday, August 4, 2009, 8:49 AM > Hi Paawan, >=20 > Thanks for your work. >=20 > I do a some test works with the test code that you sent in > before. > I get the values of fp reg with command "info > all-registers". >=20 > It looks like some fp reg's values not right in replay > mode. >=20 > In record mode they are: > fctrl=A0 =A0 =A0 =A0 =A0 > 0x37f=A0=A0=A0 895 > fstat=A0 =A0 =A0 =A0 =A0 > 0x0=A0=A0=A0 0 > ftag=A0 =A0 =A0 =A0 > =A0=A0=A00xffff=A0=A0=A0 65535 > fiseg=A0 =A0 =A0 =A0 =A0 > 0x0=A0=A0=A0 0 > fioff=A0 =A0 =A0 =A0 =A0 > 0x0=A0=A0=A0 0 > ---Type to continue, or q to > quit--- > foseg=A0 =A0 =A0 =A0 =A0 > 0x0=A0=A0=A0 0 > fooff=A0 =A0 =A0 =A0 =A0 > 0x0=A0=A0=A0 0 > fop=A0 =A0 =A0 =A0 =A0 =A0 > 0x0=A0=A0=A0 0 >=20 > In replay mode they are: > fctrl=A0 =A0 =A0 =A0 =A0 > 0x37f=A0=A0=A0 895 > fstat=A0 =A0 =A0 =A0 =A0 > 0x6069=A0=A0=A0 24681 > ftag=A0 =A0 =A0 =A0 > =A0=A0=A00x557f=A0=A0=A0 21887 > fiseg=A0 =A0 =A0 =A0 =A0 > 0x73=A0=A0=A0 115 > fioff=A0 =A0 =A0 =A0 =A0 > 0x8048bfd=A0=A0=A0 134515709 > ---Type to continue, or q to > quit--- > foseg=A0 =A0 =A0 =A0 =A0 > 0x7b=A0=A0=A0 123 > fooff=A0 =A0 =A0 =A0 =A0 > 0x0=A0=A0=A0 0 > fop=A0 =A0 =A0 =A0 =A0 =A0 > 0x2e9=A0=A0=A0 745 >=20 >=20 >=20 > Thanks, > Hui >=20 >=20 > #include > #include > #include >=20 > /* the test intends to test following insns. > flds faddp fstps fstpl fldl fxch fabs fdivrp fmulp fsubrp > fucomp fnstsw fsqrt > fchs f2xm1 fyl2x fxtract fprem1 fld fdecstp fld1 fldl2t > fldl2e FLDPI > FLDLG2 FLDLN2 > FLDZ fincstp ffree fptan fpatan fincstp fsincos frndint > fscale fsin fcos fcmovb > fcmovbe fcmove fcmovu fcmovnb fcmovnbe fsave frstor fstsw > */ >=20 > float no1,no2,no3,no4,no5,no6,no7; > double x =3D 100.345, y =3D 25.7789; > long double ldx =3D 88888888888888888888.88, ldy =3D > 9999999999999999999.99; > float result,resultd,resultld; > float *float_memory; >=20 > /* initialization of floats */ > void init_floats() > { > no1 =3D 10.45; > no2 =3D 20.77; > no3 =3D 156.89874646; > no4 =3D 14.56; > no5 =3D 11.11; > no6 =3D 66.77; > no7 =3D 88.88; > float_memory =3D malloc(sizeof(float) * 4); > *float_memory =3D 256.256; > *(float_memory + 1) =3D 356.356; > *(float_memory + 2) =3D 456.456; > *(float_memory + 3) =3D 556.556; > } >=20 > /* marks FPU stack as empty */ > void empty_fpu_stack() > { > asm ("ffree %st(1) \n\t" > =A0 =A0 =A0 "ffree %st(2) \n\t" > =A0 =A0 =A0 "ffree %st(3) \n\t" > =A0 =A0 =A0 "ffree %st(4) \n\t" > =A0 =A0 =A0 "ffree %st(5) \n\t" > =A0 =A0 =A0 "ffree %st(6) \n\t" > =A0 =A0 =A0 "ffree %st(7)"); > } >=20 > /* tests floating point arithmatic */ > void test_arith_floats() > { > result =3D no1 + no2 + no3 + no4 + no5 + no6 + no7; > printf("result is %f\n",result); >=20 > result =3D fmodf(no2,no1); > printf("result is %f\n",result); >=20 > resultd =3D fmod(x,y); > printf("result is %f\n",resultd); >=20 > resultld =3D fmodl(ldy,ldy); > printf("result is %f\n",resultld); >=20 > result =3D fabsf(no1); > printf("result is %f\n",result); >=20 > result =3D no3 / no4; > printf("result is %f\n",result); >=20 > result =3D no1 * no2 * no3 * no4; > printf("result is %f\n",result); >=20 > result =3D no1 - no2 - no3 - no4; > printf("result is %f\n",result); >=20 >=20 > asm ("fld %0" : :"m"(*float_memory)); > asm ("fchs"); >=20 > /* test for f2xm1 */ > asm ("fld %0" : :"m"(*float_memory)); > asm ("f2xm1"); >=20 > asm ("fyl2x"); >=20 > asm ("fld %0" : :"m"(*float_memory)); > asm ("fxtract"); >=20 > asm ("fld %0" : :"m"(*float_memory)); > asm ("fprem1"); >=20 > /* decrement fpu stack pointer only status register should > get affected */ > asm ("fld %0" : :"m"(*float_memory)); >=20 > empty_fpu_stack(); >=20 > asm ("fld1"); > asm ("fldl2t"); > asm ("fldl2e"); > asm ("fldpi"); > asm ("fldlg2"); > asm ("fldln2"); > asm ("fldz"); >=20 > empty_fpu_stack(); > /* finishing emptying the stack */ >=20 > result =3D sqrt(no3); > printf("result is %f\n",result); > } >=20 > void test_log_exp_floats() > { > result =3D log10(no3); > printf("result is %f\n",result); >=20 > result =3D log(no3); > printf("result is %f\n",result); >=20 > result =3D exp10(no3); > printf("result is %f\n",result); >=20 > result =3D exp(no3); > printf("result is %f\n",result); > } >=20 > void test_trigo_floats() > { > result =3D sin(30); > printf("result is %f\n",result); >=20 > result =3D cos(30); > printf("result is %f\n",result); >=20 > result =3D tan(30); > printf("result is %f\n",result); >=20 > result =3D atan(30); > printf("result is %f\n",result); >=20 > asm ("fld %0" : :"m"(*float_memory)); > asm ("fptan"); >=20 > /* changes st1 and popping register stack */ > asm ("fpatan"); >=20 > asm("fincstp"); > asm ("fld %0" : :"m"(float_memory)); > asm ("fsincos"); >=20 > asm ("fld %0" : :"m"(*float_memory)); > asm ("frndint"); >=20 > asm ("fld %0" : :"m"(*float_memory)); > asm ("fld %0" : :"m"(*(float_memory+1))); > asm ("fscale"); >=20 > empty_fpu_stack(); >=20 > asm ("fld %0" : :"m"(*float_memory)); > asm ("fsin"); > asm ("fcos"); >=20 > /* currently we assume condition likely and always record > the registers > code could be optimized only if the flag is set then > record */ > asm ("fld %0" : :"m"(*float_memory)); > asm ("fld %0" : :"m"(*(float_memory+1))); > asm ("fcmovb %st(1), %st"); > asm ("fcmovbe %st(1), %st"); > asm ("fcmove %st(1), %st"); > asm ("fcmovu %st(1), %st"); > asm ("fcmovnb %st(1), %st"); > asm ("fcmovnbe %st(1), %st"); >=20 > empty_fpu_stack(); > /* finished emtyping the stack */ > } >=20 > void test_compare_floats() > { > =A0=A0=A0ldy =3D 88888888888888888888.88; > =A0=A0=A0if (ldx =3D=3D ldy) > =A0 =A0=A0=A0ldy =3D > 7777777777777777777777777777.777; > =A0=A0=A0else > =A0 =A0=A0=A0ldy =3D > 666666666666666666666666666.666; > } >=20 > /* test loading and saving of FPU environment */ > void test_fpu_env() > { > asm ("fsave %0" : "=3Dm"(*float_memory) : ); > asm ("frstor %0" : : "m"(*float_memory)); > asm ("fstsw %ax"); > } >=20 > int main() > { > =A0=A0=A0init_floats(); > =A0=A0=A0test_arith_floats(); > =A0=A0=A0test_log_exp_floats(); > =A0=A0=A0test_trigo_floats(); > =A0=A0=A0test_compare_floats(); > =A0=A0=A0test_fpu_env(); > } >=20 >=20 >=20 >=20 > On Mon, Aug 3, 2009 at 22:56, paawan oza > wrote: > > Hi, > > > > please find the patch attached. I have attached as per > your suggestion. > > I am attaching it from opera browser. > > > > Regards, > > Oza. > > > > --- On Thu, 7/30/09, Michael Snyder > wrote: > > > >> From: Michael Snyder > >> Subject: Re: final =A0 i386.floating.record.patch > >> To: "paawan oza" > >> Cc: "gdb-patches@sourceware.org" > > >> Date: Thursday, July 30, 2009, 11:31 PM > >> paawan oza wrote: > >> > Hi, > >> > > >> > please find my answers below. > >> > > >> >=A0 1) Are you using a Windows machine to send > your > >> >=A0 emails?=A0 If so, > >> >=A0 is it possible that there is a Unix/Linux > >> machine you could > >> >=A0 try > >> >=A0 sending from?=A0 Your attachments look OK > for > >> me, but > >> >=A0 some people > >> >=A0 seem to have had problems with them. > >> > > >> > Oza : I used to send all from windows till > now. > >> > but this patch I sent it from Linux...from > opera. > >> >=A0=A0=A02) And are you using cut-and-paste to > >> insert the patches > >> >=A0 into the > >> >=A0 body of your email?=A0 That would certainly > >> cause > >> >=A0 problems, because > >> >=A0 tabs might be changed into spaces (which > is > >> exactly what > >> >=A0 was > >> >=A0 causing patch to fail for me today). > >> >=A0 Oza: yes I am using copy-paste....I dont > know > >> any-other way. > >> > because attachmenet are not welcome, so I am > not sure > >> how I could proceed with this. > >> > >> It's not that attachments are not welcome. > >> There are various binary encodings for > attachments, and > >> some of those binary encodings are not welcome.=A0 > I > >> think > >> because there's no open-source way of decoding > them. > >> > >> If you look at the list, you'll see that > attachments are > >> used a lot. > >> > >> Copy-and-paste, though, in general will not work, > because > >> it > >> usually changes tabs into spaces, which ruins a > patch. > >> > >> > >> > I will send you updated patch.....may be I > might have > >> mistaken of old gdb file. sorry for incovenience. > >> > >> I think it was just the tabs-to-spaces issue. > >> Why don't you try sending an attachment from > Opera? > >> > >> > > > > > > >=20