4 ms·
Floating Point Fun on Cortex-M Processors
- Neywiny 6mo agoInteresting. I was just thinking about this because of another post on floating point. I'm wondering if I can disable the fpu every so often and turn it on only if code needs it and it raises an exception.
- bobmcnamara 6mo agoYes, you could turn it off every context switch.
- glitchc 6mo agoIt's unclear why one would ever need to do this. Is it for power savings? What other use-cases would benefit from turning the FPU off between instructions?
- russdill 6mo agoThere is overhead, and applications that don't use the FPU avoid that overhead. https://www.netbsd.org/docs/kernel/lazyfpu.html https://www.netbsd.org/docs/kernel/lazyfpu.html
- Neywiny 6mo agoYes, for power savings. But I'd need to do a bit of a study on my code to see if it's even worth it. Since the majority of it doesn't use the FPU, it could help. But it might not be worth the effort.
- summa_tech 6mo agoZephyr support lazy FPU context switches. So the downside from enabling FPU sharing is fairly limited.