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/TMS320F28035: Variable assignment takes a long time

Part Number: TMS320F28035


Tool/software: TI C/C++ Compiler

Hi Champs,

My customer is writing F28035 code. When they found assign to variables, it would take 2us to complete each operation. They checked the assembly code, and they found there were some long call instruction as follows. 

Would you kindly help to explain what the meaning of "LCR I$$TOFS"? And how to optimize it?

Thanks.

BR,

Young

  • Hi Young,

    what are the compiler settings/optimization settings used? The C28x CPU reference guide www.ti.com/.../spru430f.pdf
    has details of LCR instruction.

    Regards,
    Sudharsanan
  • Hello,

    It seems that you try to assign an INTEGER value (Vrectified) to a float variable (CpuToCla.Vrect). This calls a library procedure "I$$TOFS" to convert an integer value into single-precision float value. F28035 has no FPU, so it cannot use hardware instructions for such conversions. That's why it calls a library procedure (LCR means "branch to a procedure").

    I can see, that you want to invoke CLA for floating-point calculations. Also i can see that you were trying to assign float to float values before.

    There is a hardwware operations in CLA for conversion: MI16TOF32, MI32TOF32. So it would be better to pass integer values to CLA, and then convert them into floating point in CLA code.

    Not sure, how to do it correctly, but maybe something like this:

    on C28 side:
    CpuToClaIntegers.Vrect = Vrectified;

    on CLA side:
    VrectFloat = (float)CpuToClaIntegers.Vrect