i960 Processor Compiler User's Guide
11-14
11
Here is C code to illustrate a simple tail recursion.
print_bool (int v)
{
if (v== 0)
printf ("FALSE");
else
printf ("TRUE");
return;
}
Here is the generated assembly code.
cmpibne 0,g0,L4
lda LC0,g0
b _printf
L4:
lda LC1,g0
b _printf
Loop Optimizations
Movement of Loop-invariant Code
Loops are the bodies of do, while, and for statements. The loop-
invariant code optimization identifies computations that do not change
within a loop (loop-invariant code) and moves them to a point before the
entry to the loop.
Induction Variable Elimination
Loops that traverse arrays occur in many programs. To compute the
address for references in these arrays the compiler must multiply the array
subscript by the size of an array element.