Mercurial > hg > CbC > old > device
diff test/float.c @ 427:0c256ea2a97e
Bitfield left value for ia32
author | kono |
---|---|
date | Sat, 30 Oct 2004 18:49:25 +0900 |
parents | c7abd48191b3 |
children | cfa4db8b18a5 |
line wrap: on
line diff
--- a/test/float.c Sat Oct 30 14:04:45 2004 +0900 +++ b/test/float.c Sat Oct 30 18:49:25 2004 +0900 @@ -56,59 +56,59 @@ unsigned u; double d00 = ac?0.5:3; - printf("%g\n",d00); + printf("#0058:%g\n",d00); g = 1.0; g = -g; - printf("%d\ncond0 ",1); - if(f==f*1.0) printf("t "); - printf("%d\ncond1 ",f==f*1.0); - if(d==f*1.0) printf("t "); - printf("%d\ncond2 ",d==f*1.0); - if(f==f1) printf("t "); - printf("%d\ncond3 ",f==f1); - if(d==d1) printf("t "); - printf("%d\ncond4 ",d==d2); - if(d==d2) printf("t "); - printf("%d\ncond5 ",(d==d2)); - if(d>d1) printf("t "); - printf("%d\ncond6 ",d>d1); - if(d>d2) printf("t "); - printf("%d\ncond7 ",d>d2); - if(d>=d1) printf("t "); - printf("%d\ncond8 ",d>=d1); - if(d>=d2) printf("t "); - printf("%d\ncond9 ",d>=d2); - if(d!=d1) printf("t "); - printf("%d\ncond10 ",d!=d1); - if(d!=d2) printf("5 "); - printf("%d\ncond11 ",d!=d2); - if(d<d1) printf("t "); - printf("%d\ncond12 ",d<d1); - if(d<d2) printf("t "); - printf("%d\ncond13 ",d<d2); - if(d<=d1) printf("t "); - printf("%d\ncond14 ",d<=d1); - if(d<=d2) printf("t "); - printf("%d\ncond15 ",d<=d2); + printf("#0062:%d\ncond0 ",1); + if(f==f*1.0) printf("#0063:t "); + printf("#0064:%d\ncond1 ",f==f*1.0); + if(d==f*1.0) printf("#0065:t "); + printf("#0066:%d\ncond2 ",d==f*1.0); + if(f==f1) printf("#0067:t "); + printf("#0068:%d\ncond3 ",f==f1); + if(d==d1) printf("#0069:t "); + printf("#0070:%d\ncond4 ",d==d2); + if(d==d2) printf("#0071:t "); + printf("#0072:%d\ncond5 ",(d==d2)); + if(d>d1) printf("#0073:t "); + printf("#0074:%d\ncond6 ",d>d1); + if(d>d2) printf("#0075:t "); + printf("#0076:%d\ncond7 ",d>d2); + if(d>=d1) printf("#0077:t "); + printf("#0078:%d\ncond8 ",d>=d1); + if(d>=d2) printf("#0079:t "); + printf("#0080:%d\ncond9 ",d>=d2); + if(d!=d1) printf("#0081:t "); + printf("#0082:%d\ncond10 ",d!=d1); + if(d!=d2) printf("#0083:5 "); + printf("#0084:%d\ncond11 ",d!=d2); + if(d<d1) printf("#0085:t "); + printf("#0086:%d\ncond12 ",d<d1); + if(d<d2) printf("#0087:t "); + printf("#0088:%d\ncond13 ",d<d2); + if(d<=d1) printf("#0089:t "); + printf("#0090:%d\ncond14 ",d<=d1); + if(d<=d2) printf("#0091:t "); + printf("#0092:%d\ncond15 ",d<=d2); d = 123.4234; f=-234.333; i = d; d = i; i = f; f = i; - printf("\ni=%d d=%g f=%f",i,d,f); + printf("#0098:\ni=%d d=%g f=%f",i,d,f); f = g = d = d1 = d2 = f; - printf(" i=%d d=%g f=%f g=%g\n",i,d,f,g); + printf("#0100: i=%d d=%g f=%f g=%g\n",i,d,f,g); d = 4204967294.4234; f=4204967294.4234; u = d; - printf("1: u=%u d=%g f=%f\n",u,d,f); + printf("#0104:1: u=%u d=%g f=%f\n",u,d,f); d = u; - printf("2: u=%u d=%g f=%f\n",u,d,f); + printf("#0106:2: u=%u d=%g f=%f\n",u,d,f); u = f; - printf("3: u=%u d=%g f=%f\n",u,d,f); + printf("#0108:3: u=%u d=%g f=%f\n",u,d,f); f = u; - printf("4: u=%u d=%g f=%f\n",u,d,f); + printf("#0110:4: u=%u d=%g f=%f\n",u,d,f); print(1.0); print(0.1234); @@ -116,7 +116,7 @@ print(1.234e-10); test1(); - printf("nested call: %g\n",test2(test2(test2(test2(-0.333,3),5),6),7)); + printf("#0118:nested call: %g\n",test2(test2(test2(test2(-0.333,3),5),6),7)); return 0; } @@ -129,12 +129,12 @@ f = d; dd = (int*) &d; - printf("d %g ",d); - printf("dx %08x %08x\n",*(dd),*(dd+1)); + printf("#0131:d %g ",d); + printf("#0132:dx %08x %08x\n",*(dd),*(dd+1)); dd = (int*) &f; - printf("f %g ",f); - printf("dx %08x \n",*(dd)); + printf("#0135:f %g ",f); + printf("#0136:dx %08x \n",*(dd)); } double @@ -162,175 +162,175 @@ double *pg1; int n = 1; - printf("simple double "); + printf("#0164:simple double "); f = 1.3; g = 1.0; g = g+g; - printf("%d:%g\t",n++,g); + printf("#0169:%d:%g\t",n++,g); g1 = g*g; - printf("%d:%g\t",n++,g1); + printf("#0171:%d:%g\t",n++,g1); g = g/g1; - printf("%d:%g\t",n++,g); + printf("#0173:%d:%g\t",n++,g); g = g-g1; - printf("%d:%g\t",n++,g); + printf("#0175:%d:%g\t",n++,g); g = sin(g1); - printf("%d:%g\t",n++,g); + printf("#0177:%d:%g\t",n++,g); g = testd(g,g1); - printf("%d:%g\t",n++,g); - printf("\n"); + printf("#0179:%d:%g\t",n++,g); + printf("#0180:\n"); - printf("simple float "); + printf("#0182:simple float "); f = f+f; - printf("%d:%g\t",n++,f); + printf("#0184:%d:%g\t",n++,f); f1 = f*f; - printf("%d:%g\t",n++,f1); + printf("#0186:%d:%g\t",n++,f1); f = f/f1; - printf("%d:%g\t",n++,f); + printf("#0188:%d:%g\t",n++,f); f = f-f1; - printf("%d:%g\t",n++,f); + printf("#0190:%d:%g\t",n++,f); f = sin(f1); - printf("%d:%g\t",n++,f); - printf("\n"); + printf("#0192:%d:%g\t",n++,f); + printf("#0193:\n"); - printf("post/pre increment "); + printf("#0195:post/pre increment "); g1 = g; - printf("%d:%g\t",n++,g1++ - ++g); + printf("#0197:%d:%g\t",n++,g1++ - ++g); f1 = f; - printf("%d:%g\t",n++,f1++ - ++f); + printf("#0200:%d:%g\t",n++,f1++ - ++f); g1 = g; - printf("%d:%g\t",n++,g1-- - --g); + printf("#0203:%d:%g\t",n++,g1-- - --g); f1 = f; - printf("%d:%g\t",n++,f1-- - --f); + printf("#0206:%d:%g\t",n++,f1-- - --f); - printf("\n"); - printf("simple calc "); + printf("#0208:\n"); + printf("#0209:simple calc "); f=0.13; g=-0.56; f1=-0.13; g1=0.56; g = f+f; - printf("%d:%g\t",n++,g); + printf("#0214:%d:%g\t",n++,g); f = g*g; - printf("%d:%g\t",n++,f); + printf("#0216:%d:%g\t",n++,f); g = g*g+f*f-g1*g1; - printf("%d:%g\t",n++,g); - printf("\n"); + printf("#0218:%d:%g\t",n++,g); + printf("#0219:\n"); - printf("float argument "); + printf("#0221:float argument "); f = testf(f,f1); - printf("%d:%g\t",n++,f); + printf("#0223:%d:%g\t",n++,f); - printf("\nindirect "); + printf("#0225:\nindirect "); n=1; f = 1.3; pf=&f; pf1=&f1; g = 1.0; pg=&g; pg1=&g1; *pg = *pg+ *pg; - printf("%d:%g\t",n++,*pg); + printf("#0231:%d:%g\t",n++,*pg); *pg1 = *pg**pg; - printf("%d:%g\t",n++,*pg1); + printf("#0233:%d:%g\t",n++,*pg1); *pg = *pg/ *pg1; - printf("%d:%g\t",n++,*pg); + printf("#0235:%d:%g\t",n++,*pg); *pg = *pg-*pg1; - printf("%d:%g\t",n++,*pg); + printf("#0237:%d:%g\t",n++,*pg); *pg = sin(*pg1); - printf("%d:%g\t",n++,*pg); + printf("#0239:%d:%g\t",n++,*pg); *pg = testd(*pg,*pg1); - printf("%d:%g\t",n++,*pg); - printf("\n"); + printf("#0241:%d:%g\t",n++,*pg); + printf("#0242:\n"); *pf = *pf+*pf; - printf("%d:%g\t",n++,*pf); + printf("#0245:%d:%g\t",n++,*pf); *pf1 = *pf**pf; - printf("%d:%g\t",n++,*pf1); + printf("#0247:%d:%g\t",n++,*pf1); *pf = *pf/ *pf1; - printf("%d:%g\t",n++,*pf); + printf("#0249:%d:%g\t",n++,*pf); *pf = *pf-*pf1; - printf("%d:%g\t",n++,*pf); + printf("#0251:%d:%g\t",n++,*pf); *pf = sin(*pf1); - printf("%d:%g\t",n++,*pf); - printf("\n"); + printf("#0253:%d:%g\t",n++,*pf); + printf("#0254:\n"); - printf("indirect post/pre "); + printf("#0256:indirect post/pre "); *pg1 = *pg; - printf("%d:%g\t",n++,(*pg1)++ - ++(*pg)); + printf("#0258:%d:%g\t",n++,(*pg1)++ - ++(*pg)); *pf1 = *pf; - printf("%d:%g\t",n++,(*pf1)++ - ++(*pf)); + printf("#0261:%d:%g\t",n++,(*pf1)++ - ++(*pf)); *pg1 = *pg; - printf("%d:%g\t",n++, (*pg1)-- - --(*pg)); + printf("#0264:%d:%g\t",n++, (*pg1)-- - --(*pg)); *pf1 = *pf; - printf("%d:%g\t",n++, (*pf1)-- - --(*pf)); - printf("\n"); + printf("#0267:%d:%g\t",n++, (*pf1)-- - --(*pf)); + printf("#0268:\n"); *pf=0.13; *pg=-0.56; *pf1=-0.13; *pg1=0.56; *pg = *pf+*pf; - printf("%d:%g\t",n++,*pg); + printf("#0273:%d:%g\t",n++,*pg); *pf = *pg**pg; - printf("%d:%g\t",n++,*pf); + printf("#0275:%d:%g\t",n++,*pf); *pg = *pg**pg+*pf**pf-*pg1**pg1; - printf("%d:%g\t",n++,*pg); - printf("\n"); + printf("#0277:%d:%g\t",n++,*pg); + printf("#0278:\n"); - printf("float argument "); + printf("#0280:float argument "); *pf = testf(*pf,*pf1); - printf("%d:%g\t",n++,*pf); + printf("#0283:%d:%g\t",n++,*pf); - printf("\nassop "); + printf("#0286:\nassop "); n=1; f = 1.3; g = 1.0; g *= 2*g; - printf("%d:%g\t",n++,g); + printf("#0292:%d:%g\t",n++,g); g /= 2*g; - printf("%d:%g\t",n++,g); + printf("#0294:%d:%g\t",n++,g); g -= 2*g; - printf("%d:%g\t",n++,g); + printf("#0296:%d:%g\t",n++,g); g += 2*g; - printf("%d:%g\t",n++,g); + printf("#0298:%d:%g\t",n++,g); f *= 2*g; - printf("%d:%g\t",n++,f); + printf("#0301:%d:%g\t",n++,f); f /= 2*g; - printf("%d:%g\t",n++,f); + printf("#0303:%d:%g\t",n++,f); f -= 2*g; - printf("%d:%g\t",n++,f); + printf("#0305:%d:%g\t",n++,f); f += 2*g; - printf("%d:%g\t",n++,f); - printf("\n"); + printf("#0307:%d:%g\t",n++,f); + printf("#0308:\n"); n=1; f = 1.3; g = 1.0; - printf("indirect assop "); + printf("#0314:indirect assop "); *pg *= 2**pg; - printf("%d:%g\t",n++,*pg); + printf("#0316:%d:%g\t",n++,*pg); *pg /= 2**pg; - printf("%d:%g\t",n++,*pg); + printf("#0318:%d:%g\t",n++,*pg); *pg -= 2**pg; - printf("%d:%g\t",n++,*pg); + printf("#0320:%d:%g\t",n++,*pg); *pg += 2**pg; - printf("%d:%g\t",n++,*pg); + printf("#0322:%d:%g\t",n++,*pg); *pf *= 2**pg; - printf("%d:%g\t",n++,*pf); + printf("#0325:%d:%g\t",n++,*pf); *pf /= 2**pg; - printf("%d:%g\t",n++,*pf); + printf("#0327:%d:%g\t",n++,*pf); *pf -= 2**pg; - printf("%d:%g\t",n++,*pf); + printf("#0329:%d:%g\t",n++,*pf); *pf += 2**pg; - printf("%d:%g\t",n++,*pf); - printf("\n"); + printf("#0331:%d:%g\t",n++,*pf); + printf("#0332:\n"); return; @@ -343,7 +343,7 @@ if (i<=0) return f; #if 1 - printf("rec: %d %g\n",i,f); + printf("#0345:rec: %d %g\n",i,f); #endif g = f*2; h = f-0.5;