|
@@ -2155,10 +2155,10 @@ programs.
|
|
|
|
|
|
In Chapter~\ref{ch:int-exp} we simplified the generation of x86
|
|
|
assembly by placing all variables on the stack. We can improve the
|
|
|
-performance of the generated code considerably if we instead try to
|
|
|
-place as many variables as possible into registers. The CPU can
|
|
|
-access a register in a single cycle, whereas accessing the stack takes
|
|
|
-many cycles to go to cache or many more to access main memory.
|
|
|
+performance of the generated code considerably if we instead place as
|
|
|
+many variables as possible into registers. The CPU can access a
|
|
|
+register in a single cycle, whereas accessing the stack takes many
|
|
|
+cycles to go to cache or many more to access main memory.
|
|
|
Figure~\ref{fig:reg-eg} shows a program with four variables that
|
|
|
serves as a running example. We show the source program and also the
|
|
|
output of instruction selection. At that point the program is almost
|
|
@@ -2169,7 +2169,7 @@ stack locations or registers.
|
|
|
\begin{minipage}{0.45\textwidth}
|
|
|
Source program:
|
|
|
\begin{lstlisting}
|
|
|
-(program
|
|
|
+(program ()
|
|
|
(let ([v 1])
|
|
|
(let ([w 46])
|
|
|
(let ([x (+ v 7)])
|