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.

Compiler/TMS570LS3137: ARM Hercules: memcpy()

Part Number: TMS570LS3137

Tool/software: TI C/C++ Compiler

On invoking memcpy() and analyzing the assembly routines, I understand that apart from routines related to copying of data from source to destination (of different byte sizes) many other instructions are there which are not getting covered by the function (viewed in disassembly window in CCS). Function declaration which I invoked is: memcpy(src, dest, 3) [where, src and dest are arrays with unsigned integer elements of size 20, and third parameter is size of data to be copied from src to dest]. Can anyone throw some light on the assembly instructions which are not getting covered by the mentioned function invocation? Am I doing any mistake in function invocation? For your reference, I will attach a portion of .lst file for memcpy() with instructions (Line No.- 169 to 259) I am missing in this entire process. If anyone can suggest any design document from TI regarding these library files (in "\ti\ccsv5\tools\compiler\arm_5.0.4\lib\rtssrc.zip") it will be very helpful to me.

Thanks.


  • mempcy is a commonly used operation, so it is worth spending extra effort to make it run as fast as possible.  For all the possible combinations of address alignment (16 bytes, 8 bytes, 4 bytes, etc.) on both the source and destination, as well as the number of bytes being copied, there are different optimal methods for performing the copy.  That's why you see all the code which makes those decisions.  This also explains why, for any one call to memcpy, many instructions do not execute.

    PREETISH SANKHUA said:
    Am I doing any mistake in function invocation?

    No.

    One additional comment ... TI ARM compiler version 5.0.4 is 5 years old.  Please consider upgrading.  

    Thanks and regards,

    -George