Tool/software: TI C/C++ Compiler
I run into a strange problem when using asm function. I have a program written in c, which consists of several functions. I want to rewrite one of the function in asm. As a first try, I copy the asm code generated by CCS, which is achieved by using the Disassembly window in CCS. But then this function run much lower. When the function is written in C, it uses about 23000 cycles. When I replace it with asm code, it uses about 150000 cycles. I wander why the asm code run much slower?
Here are some information about my program:
1) The whole program is written in C, and I run it in TMX320C6678 demo board. The program runs in single core mode.
2) I use _itoll(TSCH, TSCL); to measure the time consumed by this function.
3) In this function, it reads data from an input buffer, do some multiplication and addition, and then writes the data to an output buffer. So it does not call any other functions.
4) The only change I make to the asm code is that I change the name of the label in it.
5) The section .text is placed in the L2/SRAM, all other sections are placed in Multicore shared Memmory.
Thank you!