4 ms·
Something seems off about your numbers given that you can emulate fp with integer ops in much less than 1000 instructions.
by petermcneeley 7y ago
Something seems off about your numbers given that you can emulate fp with integer ops in much less than 1000 instructions.
- gpderetta 7y agoprobably because on cpu without fp units, fp instructions cause invalid instruction exceptions to be raised that need to handled by the kernel, and that can be very expensive (that used to be a thing on x86 in the past).
- Symmetry 7y agoKernel? What kernel? You probably aren't using a separate kernel with an M3, though you might have an RTOS. You'll, as a rule, have the compiler putting the floating point emulations in directly. I think the performance hit is only around a factor of 100 or so for an M3 though.
- brandmeyer 7y agoIt is way off. GCC has had optimized assembly routines for performing software floating point on ARM that run in dozens of cycles. IIRC, the license is liberal enough that LLVM could copy them by-value into their compiler support libraries without difficulty, so I would just assume that they were until proven otherwise.
- roland35 7y agoI am referring to gcc on an ARM Cortex M3/4 processor (Tiva TM4C123). I measured this using Texas Instrument's code composer studio a few years ago, with no optimizations (just with some basic test like 1.3 * 3.5 = ?) without the FPU enabled. Maybe there are better ways to do it, I could be wrong!