I work with Cortex A7 at the level of hardware - Bare Metal programming. Implemented interrupt support. Programs in C and Assembler. Compiler GCC-Linaro gnueabihf. Everything works, but if I use floating arithmetic in the background task and in the interrupt handler, then the calculations in the background task do not work correctly and pops out 1 in 4 bits of the IXC - Inexact cumulative exception flag in the FPSCR register. In the interrupt handler, before working with the Floating point, I perform the saving of the context, and after that I restore it. Here are the procedures:

vfpPush:vpush {d0-d15} vmrs r0, fpscr push {r0} bx lr vfpPop: pop {r0} vmsr fpscr, r0 vpop {d0-d15} bx lr 

But it does not help! It is only necessary to perform multiplication, division, or any other operation with data of double type in the interrupt, as in the background task it fails (if it also works with double at the time of interruption)! Tell me, what is my mistake?

    1 answer 1

    It turned out all simple! Compiler options were set by NEON-VFPv4. In this case, the compiler uses the extended set of registers D0 - D31. In this case, the compiler itself incorrectly interprets the command PUSH {d15-d31}. I had to use the team

     ldc p11, cr0, [r0],#32*4 

    Now it all worked!