An application I'm working on uses the FPU.
When the FPU is used with the CTL - all FPU registers are saved on the task's stack. FPU related resisters take up about 100 bytes of ram.
I'm going to modify the CTL by adding some flags to the task's TCB - one of which states whether floating point operations are used in that task. If no FP operations are used - then the time and resources associated with saving the FPU on the stack is wasted.
Can you see any pitfalls associated with selectively saving the FPU registers?
I would program the arm to use FP instructions but not perform FPU register stacking. When a task is made active or placed on hold, the modified CTL would push/pull the FPU registers only as required.
Each interrupt would have to know if a save was required also.
My application uses 5 tasks, of which only 2 use FP instructions --- so I would save approximately 300 bytes of ram.
Do you see why this is not possible?
Please sign in to leave a comment.