Mercurial > hg > CbC > old > device
diff test/code-gen.c @ 273:87b9cfc86a10
*** empty log message ***
author | kono |
---|---|
date | Fri, 21 May 2004 00:57:27 +0900 |
parents | 8cd8d72286ae |
children | 3ae68af07fce |
line wrap: on
line diff
--- a/test/code-gen.c Wed May 19 23:44:38 2004 +0900 +++ b/test/code-gen.c Fri May 21 00:57:27 2004 +0900 @@ -142,7 +142,8 @@ { int i,j; i = 123123123;j = 0; - printf("code_preinc i %d %d\n",++i,--j); + printf("code_preinc i %d %d",++i,--j); + printf(" %d %d\n",i,j); } // code_postinc(int e1,int e2,int dir,int sign,int sz,int reg) @@ -151,7 +152,8 @@ { unsigned int i,j; i = 123123123;j = 0; - printf("code_upreinc u %d %d\n",i++,j--); + printf("code_upreinc u %d %d",i++,j--); + printf(" %d %d\n",i,j); } // code_postinc(int e1,int e2,int dir,int sign,int sz,int reg) @@ -160,7 +162,8 @@ { int i,j; i = 123123123;j = 0; - printf("code_postinc i %d %d\n",i++,j--); + printf("code_postinc i %d %d",i++,j--); + printf(" %d %d\n",i,j); } // code_preinc(int e1,int e2,int dir,int sign,int sz,int reg) @@ -169,7 +172,48 @@ { unsigned int i,j; i = 123123123;j = 0; - printf("code_upreinc u %d %d\n",++i,--j); + printf("code_upreinc u %d %d",++i,--j); + printf(" %d %d\n",i,j); +} + +// code_preinc(int e1,int e2,int dir,int sign,int sz,int reg) +void +code_register_preinc() +{ + register int i,j; + i = 123123123;j = 0; + printf("code_preinc i r %d %d",++i,--j); + printf(" %d %d\n",i,j); +} + +// code_postinc(int e1,int e2,int dir,int sign,int sz,int reg) +void +code_register_upostinc() +{ + register unsigned int i,j; + i = 123123123;j = 0; + printf("code_upreinc u r %d %d",i++,j--); + printf(" %d %d\n",i,j); +} + +// code_postinc(int e1,int e2,int dir,int sign,int sz,int reg) +void +code_register_postinc() +{ + register int i,j; + i = 123123123;j = 0; + printf("code_postinc i r %d %d",i++,j--); + printf(" %d %d\n",i,j); +} + +// code_register_preinc(int e1,int e2,int dir,int sign,int sz,int reg) +void +code_register_upreinc() +{ + register unsigned int i,j; + i = 123123123;j = 0; + printf("code_upreinc u r %d %d",++i,--j); + printf(" %d %d\n",i,j); } // code_return(int creg) @@ -844,7 +888,7 @@ register double d0,d1; f0 = 0.0; f1 = 0.2; d0 = 10; d1 = 10e10; - printf("code_lvar float %f %f %g %g\n",f0,f1,d0,d1); + printf("code_lvar float r %f %f %g %g\n",f0,f1,d0,d1); } // code_dassign_gvar(int e2,int freg,int d) @@ -976,10 +1020,10 @@ { f0 = 0.0; f1 = 0.2; d0 = 10; d1 = 10e10; - printf("code_gvar float %f %f %g %g\n",f0,f1,d0,d1); + printf("code_gvar float 1 %f %f %g %g\n",f0,f1,d0,d1); s_f0 = 0.0; s_f1 = 0.2; s_d0 = 10; s_d1 = 10e10; - printf("code_gvar float %f %f %g %g\n",s_f0,s_f1,s_d0,s_d1); + printf("code_gvar float 2 %f %f %g %g\n",s_f0,s_f1,s_d0,s_d1); } // code_drlvar(int e2,int d,int freg) @@ -1081,6 +1125,34 @@ printf("code_dassop 4 %g\n",ui1); } +// code_dassop(int op,int d) +void +code_register_dassop() +{ + register double i1,i2; + register float ui1,ui2; + i1 = -555; i2= 555; + ui1 = 632423423; ui2= 32394234; + + i1 += 3; + printf("code_dassop r 1 %g\n",i1); + i1 -= 3; + printf("code_dassop r 2 %g\n",i1); + i1 /= 3; + printf("code_dassop r 3 %g\n",i1); + i1 *= 3; + printf("code_dassop r 4 %g\n",i1); + + ui1 += 3; + printf("code_dassop r 1 %g\n",ui1); + ui1 -= 3; + printf("code_dassop r 2 %g\n",ui1); + ui1 /= 3; + printf("code_dassop r 3 %g\n",ui1); + ui1 *= 3; + printf("code_dassop r 4 %g\n",ui1); +} + // code_dpreinc(int e1,int e2,int d,int reg) void @@ -1089,9 +1161,11 @@ double i,j; float ui,uj; i = 123123123;j = 0; - printf("code_dpreinc d %g %g\n",++i,--j); + printf("code_dpreinc d %g %g",++i,--j); + printf(" %g %g\n",i,j); ui = 123123123;uj = 0; - printf("code_dpreinc f %g %g\n",++ui,--uj); + printf("code_dpreinc f %g %g",++ui,--uj); + printf(" %g %g\n",ui,uj); } // code_dpostinc(int e1,int e2,int d,int reg) @@ -1101,9 +1175,39 @@ double i,j; float ui,uj; i = 123123123;j = 0; - printf("code_dpostinc d %g %g\n",i--,j--); + printf("code_dpostinc d %g %g",i--,j--); + printf(" %g %g\n",i,j); + ui = 123123123;uj = 0; + printf("code_dpostinc f %g %g",ui++,uj--); + printf(" %g %g\n",ui,uj); +} + +// code_dpreinc(int e1,int e2,int d,int reg) +void +code_register_dpreinc() +{ + register double i,j; + register float ui,uj; + i = 123123123;j = 0; + printf("code_dpreinc r d %g %g",++i,--j); + printf(" %g %g\n",i,j); ui = 123123123;uj = 0; - printf("code_dpostinc f %g %g\n",ui++,uj--); + printf("code_dpreinc r f %g %g",++ui,--uj); + printf(" %g %g\n",ui,uj); +} + +// code_dpostinc(int e1,int e2,int d,int reg) +void +code_register_dpostinc() +{ + register double i,j; + register float ui,uj; + i = 123123123;j = 0; + printf("code_dpostinc r d %g %g",i--,j--); + printf(" %g %g\n",i,j); + ui = 123123123;uj = 0; + printf("code_dpostinc r f %g %g",ui++,uj--); + printf(" %g %g\n",ui,uj); } // drexpr(int e1, int e2,int l1, int op) @@ -1640,7 +1744,8 @@ { long long i,j; i = 123123123;j = 0; - printf("code_preinc l %lld %lld\n",++i,--j); + printf("code_preinc l %lld %lld",++i,--j); + printf(" %lld %lld\n",i,j); } // code_lpostinc(int e1,int e2,int reg) @@ -1649,25 +1754,68 @@ { long long i,j; i = 123123123;j = 0; - printf("code_postinc l %lld %lld\n",i++,j--); + printf("code_postinc l %lld %lld",i++,j--); + printf(" %lld %lld\n",i,j); } // code_lpreinc(int e1,int e2,int reg) void code_lupreinc() { - unsigned long long i,j; + register unsigned long long i,j; i = 123123123;j = 0; - printf("code_preinc l %llu %llu\n",++i,--j); + printf("code_preinc l %llu %llu",++i,--j); + printf(" %lld %lld\n",i,j); } // code_lpostinc(int e1,int e2,int reg) void code_lupostinc() { - unsigned long long i,j; + register unsigned long long i,j; + i = 123123123;j = 0; + printf("code_postinc lu %llu %llu",i++,j--); + printf(" %lld %lld\n",i,j); +} + +// code_lpreinc(int e1,int e2,int reg) +void +code_register_lpreinc() +{ + register long long i,j; + i = 123123123;j = 0; + printf("code_preinc l r %lld %lld",++i,--j); + printf(" %lld %lld\n",i,j); +} + +// code_lpostinc(int e1,int e2,int reg) +void +code_register_lpostinc() +{ + register long long i,j; i = 123123123;j = 0; - printf("code_postinc lu %llu %llu\n",i++,j--); + printf("code_postinc l r %lld %lld",i++,j--); + printf(" %lld %lld\n",i,j); +} + +// code_lpreinc(int e1,int e2,int reg) +void +code_register_lupreinc() +{ + register unsigned long long i,j; + i = 123123123;j = 0; + printf("code_preinc l r %llu %llu",++i,--j); + printf(" %lld %lld\n",i,j); +} + +// code_lpostinc(int e1,int e2,int reg) +void +code_register_lupostinc() +{ + register unsigned long long i,j; + i = 123123123;j = 0; + printf("code_postinc lu r %llu %llu",i++,j--); + printf(" %lld %lld\n",i,j); } // code_lassop(int op)