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/TMS320F28335: Questions about epilogue and prolog when calling a function

Part Number: TMS320F28335

Tool/software: TI C/C++ Compiler

Hello,

I would like to see how the epilog and prolog work when calling a function.

I checked the document Code-Size Optimization(Compiler Document 18.12.0 / section 3.13).

Q1. Is this a way to automatically remove the epilogue and prolog of the function, not by selecting an option?
If not, I wonder how to set the --opt_for_space Option.

Q2. Through Code-Size Optimization, function calls are made through LCR instructions. At this time, the value of the RPC register is pushed to the stack, and when the function ends, the return address of the stack is POPed through the LRETR instruction.
Is it correct that I understand well?

Q3. Passing arguments to the function call is recorded in the ACC register.
Isn't XAR register when use CALL and LRETR? If it is used, I wonder how it is used.

Thanks, Regards

Han

  • Han SeungJae said:
    Is this a way to automatically remove the epilogue and prolog of the function, not by selecting an option?

    There is no compiler option specifically related to the function epilog and prolog.

    Han SeungJae said:
    I wonder how to set the --opt_for_space Option

    All of the compiler options are documented in the C28x compiler manual.  To see how to set them in Code Composer Studio, please see the article Finding Compiler Options in CCS.

    Han SeungJae said:
    Through Code-Size Optimization, function calls are made through LCR instructions. At this time, the value of the RPC register is pushed to the stack, and when the function ends, the return address of the stack is POPed through the LRETR instruction.
    Is it correct that I understand well?

    To understand the details of how specific instructions work, please search for them in the TMS320C28x DSP CPU and Instruction Set Reference Guide.

    Han SeungJae said:
    Passing arguments to the function call is recorded in the ACC register.
    Isn't XAR register when use CALL and LRETR? If it is used, I wonder how it is used.

    Please search the C28x compiler manual for the sub-chapter titled Function Structure and Calling Conventions.

    Thanks and regards,

    -George