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: How will i know where exactly __aeabi_memcpy/4/8 methods will be added by the compiler

Part Number: TMS570LS3137


Tool/software: TI C/C++ Compiler

HI Ti Experts,

I am using TMS570LS3137 controller for development.

After compiling my project i observed that compiler is adding memcpy for copying large amount of data.

When i looked at the memcpy assembly file provided by the Ti which i pasted below.

My query here is, as i could see implementation is same for memcpy, __aeabi_memcpy, __aeabi_memcpy4, __aeabi_memcpy8 functiond

how would i know in what conditions compiler adds which memcpy function?

.thumb

.if __TI_EABI_ASSEMBLER
.asg memcpy, __TI_C$MEMCPY
.thumbfunc __aeabi_memcpy
.thumbfunc __aeabi_memcpy4
.thumbfunc __aeabi_memcpy8
.global __aeabi_memcpy
.global __aeabi_memcpy4
.global __aeabi_memcpy8
__aeabi_memcpy:
__aeabi_memcpy4:
__aeabi_memcpy8:

.thumbfunc __TI_C$MEMCPY
.global __TI_C$MEMCPY
__TI_C$MEMCPY: .asmfunc stack_usage(0)

Thanks.

Somesh

  • These functions are required by the specification ABI for the ARM architecture (AEABI) which all ARM compilers follow.  In the particular code you show, all 3 names are for the same implementation.  In the AEABI spec, it explains ...

    • __aeabi_memcpy: This function is the same as ANSI C memcpy, except that the return value is void.
    • __aeabi_memcpy4: This function is the same as __aeabi_memcpy, but may assume the pointers are 4-byte aligned.
    • __aeabi_memcpy8 :This function is the same as __aeabi_memcpy, but may assume the pointers are 8-byte aligned.

    Thanks and regards,

    -George