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.

IAR Floating point code options

Dear all,

    I am working on TMDX570LS20SUSB development board with IAR compiler. In this i am facing a scenario during Floating point implementation as FIQ / IRQ interrupt.

When i define the ISR with the attributes ( __fiq __arm ), the following codes which are marked as red, inserted automatically at the start and end of the function;

__fiq __arm void Floatoperation()

{
0x0008257C:   E24EE004 SUB             R14, R14, #4
0x00082580:   E92D501F STMFD           R13!, {R0, R1, R2, R3, R4, R12, R14}
0x00082584:   EEF10A10 FMXR            R0, FPSCR
0x00082588:   E92D0001 STMFD           R13!, {R0}
0x0008258C:   E3C00A70 BIC             R0, R0, #458752
0x00082590:   EEE10A10 FMRX            FPSCR, R0
0x00082594:   ED2D0B10 FSTMDBD         R13!, {D0-D7}

.
..
.
..
..
0x000826E0:   EBFFF667 BL              0x80084                                              /* Branch to Some function */
0x000826E4:   E28DD018 ADD             R13, R13, #24
0x000826E8:   ECBD0B10 FMRRD           R0, R13, D0
0x000826EC:   E8BD0001 LDMFD           R13!, {R0}
0x000826F0:   EEE10A10 FMRX            FPSCR, R0                                 
0x000826F4:   E8FD901F LDMFD           R13!, {R0, R1, R2, R3, R4, R12, PC}^

}

But, if i define the same function, without those attributes, these statements are not generated. Is there anybody knows how to avoid this or is it compiler default. Is there any other suggestions please let me know.

Thanks and Regards

Gowdham Natarajan

  • Hi Gowdham,

    The inserted codes are related to floating point coprocessor registers. Do you use vfp option when compiling the project? In FMXR (should be R0 --> VFP regsiters) and FMRX((should be VFP regsiters -> R0) statements, the registers are swapped and look wrong to me. Please check with IAR for details.

    Regards,

    QJ

  • Hi QJ,

    Thanks for your response and sorry for the delayed response. For your first question, Do you use vfp option when compiling the project? Yes I am using. Yeah i understood the purpose and working of FMXR and FMRX instruction.

    I will contact IAR people. If you find any updates regarding this, please post it here.

    Thanks and Regards

    Gowdham Natarajan