gcc 浮点简单总结

1.-msoft-float和-mhard-float可以认为是-mfloat-abi=[soft|softfp|hard]的别名,所以

-mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a7 -msoft-float生成的代码是调用的软件模拟函数,

-msoft-float -mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon生成的代码是浮点指令

ref:https://github.com/riscv/riscv-gnu-toolchain/issues/187

  ARM's -msoft-float and -mhard-float are alias to -mfloat-abi= for

backward compatibility and it's mark as undocumented for long time.


2.浮点指令为vsub.f64/vadd.f64/vmul.f64

对应的模拟函数为__adddf3/__subdf3/__muldf3,见https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html

对应的区别可以通过读反汇编代码看出来。

你可能感兴趣的:(gcc 浮点简单总结)