Changeset 3357


Ignore:
Timestamp:
Jun 14, 2013, 4:32:41 PM (4 years ago)
Author:
sacerdot
Message:

...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Papers/itp-2013/ccexec2.tex

    r3356 r3357  
    243243\autoref{subfig:example_input}). He compiles the program using
    244244a special compiler that first inserts in the code three label emission
    245 statements (\verb+EMIT L_i+) to mark the beginning of basic blocks
     245statements (\verb+EMIT $L_i$+) to mark the beginning of basic blocks
    246246(\autoref{subfig:example_input});
    247247then the compiler compiles the code to machine code (\autoref{subfig:example_oc}),
     
    256256that belong to the corresponding basic block. For example, the cost $k_1$
    257257associated to $L_1$ is the number of cycles required to execute the block
    258 $I_3$ and \verb+COND l_2+, while the cost $k_2$ associated to $L_2$ counts the
    259 cycles required by the block $I_4$, \verb+GOTO l_1+ and \verb+COND l_2+. The compiler also guarantees
     258$I_3$ and \verb+COND $l_2$+, while the cost $k_2$ associated to $L_2$ counts the
     259cycles required by the block $I_4$, \verb+GOTO $l_1$+ and \verb+COND $l_2$+. The compiler also guarantees
    260260that every executed instruction is in the scope of some code emission label,
    261261that each scope does not contain loops (to associate a finite cost), and that
     
    280280\begin{subfigure}[t]{.32\linewidth}
    281281\begin{lstlisting}[moredelim={[is][\color{red}]{|}{|}}]
    282 |EMIT L_1;|
     282|EMIT $L_1$;|
    283283$I_1$;
    284284for (i=0; i<2; i++) {
    285   |EMIT L_2;|
     285  |EMIT $L_2$;|
    286286  $I_2$;
    287287}
    288 |EMIT L_3;|
     288|EMIT $L_3$;|
    289289\end{lstlisting}
    290290\caption{The input program (black lines) with its labelling (red lines).}
     
    294294\begin{subfigure}[t]{.23\linewidth}
    295295\begin{lstlisting}
    296      EMIT L_1
    297      $I_3$
    298 l_1: COND l_2
    299      EMIT L_2
    300      $I_4$
    301      GOTO l_1
    302 l_2: EMIT L_3
     296   EMIT $L_1$
     297   $I_3$
     298$l_1$:$\!$  COND $l_2$
     299   EMIT $L_2$
     300   $I_4$
     301   GOTO $l_1$
     302$l_2$:$\!$  EMIT $L_3$
    303303\end{lstlisting}
    304304\caption{The output labelled object code.}
     
    311311$I_1$;
    312312for (i=0; i<2; i++) {
    313 cost += $k_2$;
     313  cost += $k_2$;
    314314  $I_2$;
    315315}
Note: See TracChangeset for help on using the changeset viewer.