This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Hi,
In Kernel-C programming, is there any effect in clock cycles if we increase the function arguments?
For example,
func(int, int, int, int) -> executed in x cycles
func(int, int, int, int, int, int) -> will this be executed in x or x+y or x-y cycles?
There is no change in the function body.
Thanks,
Vasanth
vasantha kumar raju angappan said:is there any effect in clock cycles if we increase the function arguments?
The short answer is: Yes, but not much.
I presume you execute on a C6000 core CPU. But, if you execute on an ARM core CPU, the answer is nearly the same.
Separate the issue into two pieces. How does the cycle count change at the point where the function is called? How does the cycle count change in the called function?
Where the function is called ... Expect a small increase in cycles because two more argument values are computed (probably loaded) into registers. If the register allocation works out well, and the values are the right registers anyway, it might even be free.
In the called function ... Because of ...
vasantha kumar raju angappan said:There is no change in the function body.
... expect no change in the cycle count.
Thanks and regards,
-George
vasantha kumar raju angappan said:1. The extra variables are not a calculation like x*y. They are numbers.
Then you should just see the instructions which load those constants into memory locations on the local stack frame. That should only be a few cycles.
vasantha kumar raju angappan said:One more point: Optimization level of CCS is OFF.
We are not concerned about the performance of code built with no optimization. It is all but certain that using optimization will solve your problem.
Thanks and regards,
-George