General
嵌入式系统中三种可能的浮点数处理方式(转载自StackOverflow)
1. Use float instructions if your CPU has a FPU. (fast) 直接使用浮点指令,前提是CPU有一个浮点运算单元。速度最快。
2. Have your compiler translate floating point arithmetic to integer arithmetic. (slow) 编译器把浮点数转换成整数。速度次快。
3. Use float instructions and a CPU with no FPU. Your CPU will generate a exception (Reserved Instruction, Unimplemented Instruction or similar), and if your OS kernel includes a floating point emulator it will emulate those instructions (slowest). 使用浮点指令,CPU没有FPU,此时CPU会产生一个异常(保留指令,未实现的指令等),若操作系统内核包含一个浮点模拟算法,它会在异常处理里面模拟浮点运算。速度最慢。
ARM
ARM Floating Point architecture (VFP) provides hardware support for floating point operations in half-, single- and double-precision floating point arithmetic. It is fully IEEE 754 compliant with full software library support.
The floating point capabilities of the ARM VFP offer increased performance for floating point arithmetic used

ARM的Floating Point architecture (VFP)为浮点运算提供硬件支持,符合IEEE 754标准,广泛应用于工业、汽车和多媒体处理等领域。VFP与NEON技术结合,能大幅提升2D/3D变换、图像处理等应用的性能。编译时通过指定-mhard-float启用硬件浮点支持。
最低0.47元/天 解锁文章
5940

被折叠的 条评论
为什么被折叠?



