The following three problems in this Exercise refer to a function f that calls another function func.

Question:

The following three problems in this Exercise refer to a function f that calls another function func. The code for C function func is already compiled in another module using the MIPS calling convention from Figure 2.14. The function declaration for func is “int func(int a, int b);”. The code for function f is as follows:

Figure 2.14Name Register number $zero $v0-$vl $a0-$a3 $t0-$t7 $50-$s7 $t8-$t9 $gp $sp $fp $ra 0 2-3 4-7 8-15 16-23 24-25a. b. int f(int a, int b, int c, int d) { return func(func(a,b),c+d); } int f(int a, int b, int c, int d) {

we use the tail-call optimization in this function? If no, explain why not. If yes, what is the difference in the number of executed instructions in f with and without the optimization?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question

Computer Organization And Design The Hardware Software Interface

ISBN: 9780123747501

4th Revised Edition

Authors: David A. Patterson, John L. Hennessy

Question Posted: