Mercurial > hg > Papers > 2012 > aplas
view paper/aplas2012.tex @ 7:bcacfe595c2a
add memo.txt
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 12 Jun 2012 01:03:27 +0900 |
parents | 635448a197ac |
children | a9c4eb2b29b8 |
line wrap: on
line source
\documentclass[envcountsame]{llncs} \usepackage[dvipdfmx]{graphicx} \usepackage{llncsdoc} \usepackage{url} \usepackage{listings} %\title{The implementation of recursive type syntax on GCC-4.6 for CbC} \title{Recursive type syntax in Continuation based C} \titlerunning{title running} \toctitle{toc title} %\subtitle{sub title} \author{Shinji Kono\inst{1} Nobuyasu Oshiro\inst{2}} \authorrunning{authorrunning} \institute{University of the Ryukyus} \email{} \begin{document} \maketitle \begin{abstract} We have implemented Continuation based C (CbC). CbC is an extension of C, which has parameterized goto statement. It is useful for finite state automaton or many core tasks. Goto statement is a way to force tail call elimination. The destination of goto statement is called Code Segment, which is actually a normal function of C. To represent recursive function call, the type system of C is not enough, because it has no recursive types. We introduce \verb+__rectype+ keyword for recursive type, and it is implemented in GCC-4.6.0. We will compare the conventional methods, \verb+__rectype+ keyword and a method using C structure. Also we show usage of CbC and it's benchmark. \end{abstract} \section{Introduce} \subsection{subsection} \subsubsection{subsubsection} \paragraph{paragraph} \section{Continuation based C} \section{recursive type syntax} We implemeted \verb+__rectype+ syntax on GCC. \verb+__rectype+ syntax is declare a recursive type. \subsection{What is recursive type} Recursive type is \begin{lstlisting} __code csA( __code (*p)( __code (*)( __code (*)( __code )))) { goto p(csB); } \end{lstlisting} This example is rectype syntax: \begin{lstlisting} __code csA( __rectype *p) { goto p(csB); } \end{lstlisting} \begin{figure}[htpb] \begin{minipage}{0.5\hsize} \begin{center} \scalebox{0.35}{\includegraphics{figure/tree1.pdf}} \end{center} \caption{} \label{fig:tree1} \end{minipage} \begin{minipage}{0.2\hsize} \begin{center} \scalebox{0.35}{\includegraphics{figure/tree2.pdf}} \end{center} \caption{\_\_rectype} \label{fig:tree2} \end{minipage} \end{figure} \begin{lstlisting} struct interface { __code (*next)(struct interface); }; __code csA(struct interface p) { struct interface ds = { csB }; goto p.next(ds); } int main() { struct interface ds = { print }; goto csA(ds); return 0; } \end{lstlisting} \begin{lstlisting} __code fibonacci(__rectype *p, int num, int count, int result, int prev) { \end{lstlisting} \begin{table}[htpb] \centering \small \begin{tabular}{|l|r|r|r|} \hline (unit: s) & ./conv1 1 & ./conv1 2 & ./conv1 3 \\ \hline Micro-C(32bit) & 9.93 & 6.31 & 7.18 \\ \hline Micro-C(64bit) & 5.03 & 5.12 & 5.00 \\ \hline \hline GCC -O3(32bit) & 2.52 & 2.34 & 1.53 \\ \hline GCC -O3(64bit) & 1.80 & 1.20 & 1.44 \\ \hline \end{tabular} \caption{Micro-C, GCC bench mark (in sec)} \label{tab:mc,gcc,compare} \end{table} \bibliographystyle{junsrt} \bibliography{cbc} \nocite{kono:2002a, kono:2000a, kono:2008a, yogi:2008a, yogi:2008b, yan:2002a,gcc_internals} \end{document}