Timeline for Does the "Avoid using floating-point" rule of thumb apply to a microcontroller with a floating point unit (FPU)?
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 21, 2020 at 15:30 | vote | accept | gbt | ||
Apr 18, 2020 at 10:04 | comment | added | awjlogan | @CodyGray - absolutely, that's why I said "check" :) Chances are, if you're using FP, then the FPU will be more power efficient, but it also might not be, say if you're just doing a single operation. Micros are so advanced now, there are lots of places assumptions will lead you astray - all good fun though! | |
Apr 18, 2020 at 9:57 | comment | added | Cody Gray | Note that blind assumptions like "the FPU uses more power" can often get you into trouble. Emulating FPU operations with fixed-point routines may end up using more cycles, and therefore more power, than if you'd simply used the built-in efficient hardware FPU. And while I'm sure there are things out there I'm not aware of, all the MCUs I've seen with hardware FPUs have dedicated floating-point registers (i.e., they don't overlap with the "core" integer registers). I absolutely agree, though, that floating point should not be used as a crutch for bad design. Use the right tool for the job. | |
Apr 16, 2020 at 18:27 | comment | added | gbt | +1 For the power consumption. I didn't though about this tradeoff. Thanks. | |
Apr 16, 2020 at 15:41 | history | edited | awjlogan | CC BY-SA 4.0 |
added 119 characters in body
|
Apr 16, 2020 at 15:23 | history | answered | awjlogan | CC BY-SA 4.0 |