# HG changeset patch # User Nobuyasu Oshiro # Date 1339790443 -32400 # Node ID 9b32bda0cb639af101b8e8577ca2d0afda7d5f8d # Parent 28a2460b085b7bc254d42e4328c0c240ce735ce8 modify table diff -r 28a2460b085b -r 9b32bda0cb63 paper/rectype.ind --- a/paper/rectype.ind Sat Jun 16 04:51:54 2012 +0900 +++ b/paper/rectype.ind Sat Jun 16 05:00:43 2012 +0900 @@ -281,65 +281,10 @@ --Comparison -Here is CbC program that finds the Fibonacci sequence. - - __code print(__rectype *p, long int num, - long int count, long int result, long int prev) { - printf("fibonacci(%d) = %ld\n",num,result); - goto cs_while(print, num, count, result, prev); - } - - __code fibonacci(__rectype *p, long int num, - long int count, long int result, long int prev) { - if (count == 0) { - result += 0; - count++; - } else if (count == 1) { - result += 1; - count++; - } else if (count > 1){ - long int tmp = prev; - prev = result; - result = result + tmp; - count++; - } else { - printf("please enter nutural number\n"); - exit(0); - } - if (num < count) { - goto p(fibonacci, num, count, result, prev); - } - goto fibonacci(p, num, count, result, prev); - } - __code cs_while(__rectype *p, long int num, - long int count, long int result, long int prev) { - if (num > 0) { - num--; - goto fibonacci(print, num, 0, 0, 0); - } - exit(0); - } - -It is written using \rectype{} syntax. -Do not use the \rectype{} syntax program would be the following declaration. - - __code print(__code (*p)(__code(*)(),long int,long int,long int,long int), - long int num, long int count, long int result, long int prev); - - __code fibonacci(__code (*p)(__code(*)(),long int,long int, long int,long int), - long int num, long int count, long int result, long int prev); - - __code cs_while(__code (*p)(__code(*)(),long int, long int, long int, long int), - long int num, long int count, long int result, long int prev); - -Comparing the program that made the declaration of each. -AST is almost the same should be created both. -Therefore, there should be no difference was the result. - -Here is the result in x64 architecture (Table\ref{tab:compare}). +Here is the result in IA32, and x64 architecture (Table\ref{tab:compare}). conv1 1 is function call. conv1 2, conv1 3 is optimized CPS transformed source. \begin{table}[htpb] @@ -347,10 +292,8 @@ \small \begin{tabular}{|l|r|r|r|} \hline & ./conv1 1 & ./conv1 2 & ./conv1 3 \\ \hline -GCC-4.4.3(-O2) & 3.096 & 1.092 & 1.632 \\ \hline -GCC-4.6.0(-O2) & 1.656 & 1.101 & 1.086 \\ \hline \hline -GCC-4.4.3(-O3) & 1.642 & 0.247 & 1.104 \\ \hline -GCC-4.6.0(-O3) & 1.674 & 0.280 & 1.127 \\ \hline +GCC-4.2.3(+omit)IA32 & 4.20 & 2.25 & 2.76 \\ \hline +GCC-4.6.0(+O2)x64 & 1.656 & 1.101 & 1.086 \\ \hline \hline \end{tabular} \caption{GCC bench mark(in sec)} \label{tab:compare}