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 A